Skip to content

Commit

Permalink
Merge branch 'develop' into feature/fix-edx-lti1p3
Browse files Browse the repository at this point in the history
  • Loading branch information
krusche authored Feb 26, 2024
2 parents 85d8d6a + 771eda7 commit eef0d27
Show file tree
Hide file tree
Showing 580 changed files with 2,535 additions and 2,096 deletions.
13 changes: 13 additions & 0 deletions .idea/runConfigurations/Artemis__BuildAgent_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Artemis__Server_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Artemis__Server__Aeolus_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/runConfigurations/Artemis__Server___Client_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker/artemis/config/cypress-local.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Artemis configuration overrides for the Cypress E2E Postgres setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE="artemis,scheduling,localvc,localci,buildagent,prod,docker"
SPRING_PROFILES_ACTIVE="artemis,scheduling,localvc,localci,buildagent,core,prod,docker"

ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"
ARTEMIS_VERSIONCONTROL_URL='https://localhost'
Expand Down
2 changes: 1 addition & 1 deletion docker/artemis/config/cypress-mysql.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Artemis configuration overrides for the Cypress E2E MySQL setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE="artemis,scheduling,bamboo,bitbucket,jira,prod,docker"
SPRING_PROFILES_ACTIVE="artemis,scheduling,bamboo,bitbucket,jira,core,prod,docker"

SPRING_DATASOURCE_URL="jdbc:mysql://artemis-mysql:3306/Artemis?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
SPRING_DATASOURCE_USERNAME="root"
Expand Down
2 changes: 1 addition & 1 deletion docker/artemis/config/cypress-postgres.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Artemis configuration overrides for the Cypress E2E Postgres setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE="artemis,scheduling,jenkins,gitlab,prod,docker"
SPRING_PROFILES_ACTIVE="artemis,scheduling,jenkins,gitlab,core,prod,docker"

ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"

Expand Down
2 changes: 1 addition & 1 deletion docker/artemis/config/dev-local-vc-local-ci.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://docs.artemis.cit.tum.de/dev/setup.html#debugging-with-docker
_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005

SPRING_PROFILES_ACTIVE: artemis,scheduling,localci,localvc,buildagent,dev,docker
SPRING_PROFILES_ACTIVE: artemis,scheduling,localci,localvc,buildagent,core,dev,docker

# Integrated Code Lifecycle settings with Jira
ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"
Expand Down
2 changes: 1 addition & 1 deletion docker/artemis/config/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# The default Artemis Spring profiles for Docker are defined here.
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker
SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,core,dev,docker

# The following enables the Java Remote Debugging port. More infos in the documentation:
# https://docs.artemis.cit.tum.de/dev/setup.html#debugging-with-docker
Expand Down
2 changes: 1 addition & 1 deletion docker/artemis/config/migration-check.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SPRING_PROFILES_ACTIVE="artemis,scheduling,prod,docker"
SPRING_PROFILES_ACTIVE="artemis,scheduling,core,prod,docker"
2 changes: 1 addition & 1 deletion docker/artemis/config/node1.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SPRING_PROFILES_ACTIVE='prod,localvc,localci,scheduling,docker'
SPRING_PROFILES_ACTIVE='prod,localvc,localci,buildagent,core,scheduling,docker'
EUREKA_INSTANCE_INSTANCEID='Artemis:1'
EUREKA_INSTANCE_HOSTNAME='artemis-app-node-1'
SPRING_HAZELCAST_INTERFACE='artemis-app-node-1'
2 changes: 1 addition & 1 deletion docker/artemis/config/node2.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SPRING_PROFILES_ACTIVE='prod,localvc,localci,docker'
SPRING_PROFILES_ACTIVE='prod,localvc,localci,buildagent,core,docker'
EUREKA_INSTANCE_INSTANCEID='Artemis:2'
EUREKA_INSTANCE_HOSTNAME='artemis-app-node-2'
SPRING_HAZELCAST_INTERFACE='artemis-app-node-2'
2 changes: 1 addition & 1 deletion docker/artemis/config/node3.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SPRING_PROFILES_ACTIVE='prod,localvc,localci,docker'
SPRING_PROFILES_ACTIVE='prod,localvc,localci,buildagent,core,docker'
EUREKA_INSTANCE_INSTANCEID='Artemis:3'
EUREKA_INSTANCE_HOSTNAME='artemis-app-node-3'
SPRING_HAZELCAST_INTERFACE='artemis-app-node-3'
2 changes: 1 addition & 1 deletion docker/artemis/config/prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ----------------------------------------------------------------------------------------------------------------------
# The default Artemis Spring profiles for Docker are defined here.
# ----------------------------------------------------------------------------------------------------------------------
SPRING_PROFILES_ACTIVE="artemis,scheduling,athena,prod,docker"
SPRING_PROFILES_ACTIVE="artemis,scheduling,athena,core,prod,docker"

# ----------------------------------------------------------------------------------------------------------------------
# Secret Overrides
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.PROFILE_BUILDAGENT;
import static de.tum.in.www1.artemis.config.Constants.PROFILE_CORE;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationServiceException;

@Configuration
public class ApplicationConfiguration {

// this prevents default authentication when the build agent is enabled without the core profile
@Profile({ "!" + PROFILE_CORE, PROFILE_BUILDAGENT })
@Bean
public AuthenticationManager noopAuthenticationManager() {
return authentication -> {
throw new AuthenticationServiceException("Authentication is disabled");
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.PROFILE_BUILDAGENT;
import static de.tum.in.www1.artemis.config.Constants.PROFILE_CORE;

import java.util.concurrent.Executor;

import org.slf4j.Logger;
Expand All @@ -9,13 +12,15 @@
import org.springframework.boot.autoconfigure.task.TaskExecutionProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import tech.jhipster.async.ExceptionHandlingAsyncTaskExecutor;

@Profile({ PROFILE_CORE, PROFILE_BUILDAGENT })
@Configuration
@EnableAsync(proxyTargetClass = true)
@EnableScheduling
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.PROFILE_LOCALCI;
import static de.tum.in.www1.artemis.config.Constants.*;

import java.nio.file.Path;
import java.util.Arrays;
Expand All @@ -26,6 +26,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;

import com.hazelcast.config.*;
Expand All @@ -39,6 +40,7 @@
import tech.jhipster.config.JHipsterProperties;
import tech.jhipster.config.cache.PrefixedKeyGenerator;

@Profile({ PROFILE_CORE, PROFILE_BUILDAGENT })
@Configuration
@EnableCaching
public class CacheConfiguration {
Expand Down Expand Up @@ -181,11 +183,17 @@ public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties

// only add the queue config if the profile "localci" is active
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains(PROFILE_LOCALCI)) {
if (activeProfiles.contains(PROFILE_LOCALCI) || activeProfiles.contains(PROFILE_BUILDAGENT)) {
// add queue config for local ci shared queue
configureQueueCluster(config, jHipsterProperties);
}

// build agents should not hold partitions and only be a lite member
if (!activeProfiles.contains(PROFILE_CORE) && activeProfiles.contains(PROFILE_BUILDAGENT)) {
log.info("Joining cluster as lite member");
config.setLiteMember(true);
}

QuizScheduleService.configureHazelcast(config);
return Hazelcast.newHazelcastInstance(config);
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/de/tum/in/www1/artemis/config/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,16 @@ public final class Constants {
*/
public static final String PROFILE_LOCALCI = "localci";

/**
* The name of the Spring profile used to process build jobs in a local CI setup.
*/
public static final String PROFILE_BUILDAGENT = "buildagent";

/**
* The name of the Spring profile used for Artemis core functionality.
*/
public static final String PROFILE_CORE = "core";

/**
* Size of an unsigned tinyInt in SQL, that is used in the database
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.PROFILE_BUILDAGENT;
import static de.tum.in.www1.artemis.config.Constants.PROFILE_CORE;

import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.messaging.simp.user.SimpUserRegistry;

import de.tum.in.www1.artemis.web.rest.CustomMetricsExtension;
Expand All @@ -19,6 +23,7 @@
*/
public class CustomMetricsExtensionConfiguration {

@Profile({ PROFILE_CORE, PROFILE_BUILDAGENT })
@Configuration
@ConditionalOnClass(Timed.class)
@AutoConfigureAfter(JHipsterMetricsEndpointConfiguration.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.PROFILE_CORE;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import de.tum.in.www1.artemis.repository.RepositoryImpl;

@Profile(PROFILE_CORE)
@Configuration
@EnableJpaRepositories(basePackages = "de.tum.in.www1.artemis.repository", repositoryBaseClass = RepositoryImpl.class)
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.PROFILE_CORE;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.format.FormatterRegistry;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
* Configure the converters to use the ISO format for dates by default.
*/
@Profile(PROFILE_CORE)
@Configuration
public class DateTimeFormatConfiguration implements WebMvcConfigurer {

Expand Down
Loading

0 comments on commit eef0d27

Please sign in to comment.