Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/export-TestCases-Button-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
az108 authored Apr 26, 2024
2 parents 5059b97 + b23891d commit f91f117
Show file tree
Hide file tree
Showing 185 changed files with 3,141 additions and 1,112 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/analysis-of-endpoint-connections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Analysis-of-Endpoint-Connections

on:
pull_request:
types:
- opened
- synchronize
paths:
- 'src/main/java/**'
- 'src/main/webapp/**'

jobs:
show-modified-files:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get list of modified files
run: |
git diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD > modified_files.txt
- name: Display modified files
run: |
echo "Modified files in this pull request:"
cat modified_files.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Refer to [Using JHipster in production](http://www.jhipster.tech/production) for
The following command can automate the deployment to a server. The example shows the deployment to the main Artemis test server (which runs a virtual machine):

```shell
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.0.1.war
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.0.2.war
```

## Architecture
Expand Down
30 changes: 15 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {
}

group = "de.tum.in.www1.artemis"
version = "7.0.1"
version = "7.0.2"
description = "Interactive Learning with Individual Feedback"

java {
Expand Down Expand Up @@ -253,7 +253,7 @@ dependencies {
implementation "oauth.signpost:signpost-commonshttp4:2.1.1"

// https://mvnrepository.com/artifact/net.sourceforge.plantuml/plantuml
implementation "net.sourceforge.plantuml:plantuml:1.2024.3"
implementation "net.sourceforge.plantuml:plantuml:1.2024.4"
implementation "org.jasypt:jasypt:1.9.3"
implementation "me.xdrop:fuzzywuzzy:1.4.0"
implementation("org.yaml:snakeyaml") {
Expand Down Expand Up @@ -296,7 +296,7 @@ dependencies {

implementation "tech.jhipster:jhipster-framework:${jhipster_dependencies_version}"
implementation "org.springframework.boot:spring-boot-starter-cache:${spring_boot_version}"
implementation "io.micrometer:micrometer-registry-prometheus:1.12.4"
implementation "io.micrometer:micrometer-registry-prometheus:1.12.5"
implementation "net.logstash.logback:logstash-logback-encoder:7.4"

// Defines low-level streaming API, and includes JSON-specific implementations
Expand All @@ -316,7 +316,7 @@ dependencies {
implementation "javax.cache:cache-api:1.1.1"
implementation "org.hibernate.orm:hibernate-core:${hibernate_version}"
implementation "com.zaxxer:HikariCP:5.1.0"
implementation "org.apache.commons:commons-text:1.11.0"
implementation "org.apache.commons:commons-text:1.12.0"
implementation "org.apache.commons:commons-math3:3.6.1"
implementation "javax.transaction:javax.transaction-api:1.3"
implementation "org.liquibase:liquibase-core:${liquibase_version}"
Expand All @@ -337,8 +337,8 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:${spring_boot_version}"

implementation "org.springframework.ldap:spring-ldap-core:3.2.2"
implementation "org.springframework.data:spring-data-ldap:3.2.4"
implementation "org.springframework.ldap:spring-ldap-core:3.2.3"
implementation "org.springframework.data:spring-data-ldap:3.2.5"

implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:4.1.1") {
// NOTE: these modules contain security vulnerabilities and are not needed
Expand All @@ -349,9 +349,9 @@ dependencies {

implementation "org.springframework.cloud:spring-cloud-commons:4.1.2"

implementation "io.netty:netty-all:4.1.108.Final"
implementation "io.projectreactor.netty:reactor-netty:1.1.17"
implementation "org.springframework:spring-messaging:6.1.5"
implementation "io.netty:netty-all:4.1.109.Final"
implementation "io.projectreactor.netty:reactor-netty:1.1.18"
implementation "org.springframework:spring-messaging:6.1.6"
implementation "org.springframework.retry:spring-retry:2.0.5"

implementation "org.springframework.security:spring-security-config:${spring_security_version}"
Expand All @@ -378,8 +378,8 @@ dependencies {
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jwt_version}"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jwt_version}"

implementation "org.bouncycastle:bcpkix-jdk18on:1.77"
implementation "org.bouncycastle:bcprov-jdk18on:1.77"
implementation "org.bouncycastle:bcpkix-jdk18on:1.78.1"
implementation "org.bouncycastle:bcprov-jdk18on:1.78.1"

implementation("io.springfox:springfox-swagger2:3.0.0") {
exclude module: "mapstruct"
Expand All @@ -391,7 +391,7 @@ dependencies {

implementation "org.zalando:problem-spring-web:0.29.1"
implementation "org.zalando:jackson-datatype-problem:0.27.1"
implementation "com.ibm.icu:icu4j:74.2"
implementation "com.ibm.icu:icu4j:75.1"
implementation "com.github.seancfoley:ipaddress:5.5.0"
implementation "org.apache.maven:maven-model:3.9.6"
implementation "org.apache.pdfbox:pdfbox:3.0.2"
Expand Down Expand Up @@ -441,11 +441,11 @@ dependencies {
testImplementation "org.gradle:gradle-tooling-api:8.7"
testImplementation "org.apache.maven.surefire:surefire-report-parser:3.2.5"
testImplementation "com.opencsv:opencsv:5.9"
testImplementation("io.zonky.test:embedded-database-spring-test:2.5.0") {
testImplementation("io.zonky.test:embedded-database-spring-test:2.5.1") {
exclude group: "org.testcontainers", module: "mariadb"
exclude group: "org.testcontainers", module: "mssqlserver"
}
testImplementation "com.tngtech.archunit:archunit:1.2.1"
testImplementation "com.tngtech.archunit:archunit:1.3.0"
testImplementation("org.skyscreamer:jsonassert:1.5.1") {
exclude module: "android-json"
}
Expand All @@ -454,7 +454,7 @@ dependencies {
strictly "1.14.13"
}
}
testImplementation "io.github.classgraph:classgraph:4.8.165"
testImplementation "io.github.classgraph:classgraph:4.8.172"

// Lightweight JSON library needed for the internals of the MockRestServiceServer
testImplementation "org.json:json:20240303"
Expand Down
13 changes: 0 additions & 13 deletions docker/aeolus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,9 @@ services:
image: ghcr.io/ls1intum/aeolus/api:nightly
pull_policy: always
restart: unless-stopped
environment:
BAMBOO_GENERATOR_API_HOST: "http://aeolus-bamboo-api:8091"
ports:
- "8090:80"
networks:
- aeolus
- artemis
aeolus-bamboo-api:
container_name: aeolus-bamboo-api
hostname: aeolus-bamboo-api
image: ghcr.io/ls1intum/aeolus/bamboo-generator:nightly
command: "--api"
pull_policy: always
restart: unless-stopped
networks:
- aeolus
- artemis

networks:
Expand Down
119 changes: 119 additions & 0 deletions docs/admin/setup/distributed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ Artemis uses to approaches for this:
You must add the ``Scheduling`` profile to **exactly one** instance of your cluster.
This instance will then perform scheduled tasks whereas the other instances will not.

.. _nginx_configuration:

nginx configuration
^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -504,6 +505,124 @@ It relays message between instances:
:align: center


Integrated Code Lifecycle
^^^^^^^^^^^^^^^^^^^^^^^^^
The integrated code lifecycle (ICL) can integrate build agents into a multi instance server setup. In ICL, we differentiate between two types of server node: **core nodes** and **build agent nodes**.
Core nodes provide the full Artemis functionality, while build agents simply execute build jobs for the testing of programming exercises.
Both node types run the Artemis application, albeit with different profile sets and different application configuration files.
Compared to core nodes, build agents nodes are much more light-weight, as they have less service dependencies and provide less functionality. Thus, they require less system resources and start much quicker than core nodes.

The previously mentioned steps concerning the multiple Artemis instance setup remain unchanged, as we only need to adapt the run and application configurations for each node.

Core nodes
""""""""""

Core nodes serve the main functionality of Artemis. In ICL, this additionally includes the :ref:`CI Management <ci_management>`,
responsible for managing and interacting with the build job queue (adding, cancelling and viewing build jobs), and the :ref:`Local VC system <local_vc>`.

For ICL, the run configuration for core nodes need to include the additional profiles ``core``, ``localvc`` and ``localci``, e.g.:

::

--spring.profiles.active=prod,core,ldap-only,localvc,localci,athena,scheduling,iris,lti

Core nodes do not require further adjustments to the ``application-prod.yml``, as long as you have added the necessary variables as described in the :ref:`Integrated Code Lifecycle Setup <Integrated Code Lifecycle Setup>`.

Build Agents
""""""""""""

Build agents can be added to and removed from the server cluster depending on the build capacity needed to conduct the automatic
assessment of programming exercises. If desired, build agents can execute multiple build jobs concurrently. In this case, you need to make sure that the server node your build agents is running on has enough resources.
We recommend at least 2 CPUs and 2 GB of RAM for each concurrently running build job.

Build agents do **not** require access to the Shared File System as the repositories used in the build jobs are cloned using HTTPS. Furthermore, as Build Agents do not handle client requests,
they should be left out from the :ref:`nginx configuration <nginx_configuration>`.


The run configuration contains just two profiles:

::

--spring.profiles.active=prod,buildagent

Build agents depend on much fewer services than the core nodes, thus we can adapt the ``application-prod.yml`` to exclude some of these dependencies.
This heavily reduces the application start up time and resource demand.

You can make following adaptations to the ``application-prod.yml``:

1. Disable Liquibase and loadbalancer cache:

.. code-block:: yaml
spring:
liquibase:
enabled: false
cloud:
loadbalancer:
cache:
enabled: false
2. Autoconfigure exclusions

.. code-block:: yaml
spring:
autoconfigure:
exclude:
# Hibernate and DataSource are not needed in the build agent
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
# Those metrics are repeated here, because overriding the `exclude` array is not possible
- org.springframework.boot.actuate.autoconfigure.metrics.data.RepositoryMetricsAutoConfiguration
- org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourcePoolMetricsAutoConfiguration
- org.springframework.boot.actuate.autoconfigure.metrics.startup.StartupTimeMetricsListenerAutoConfiguration
- org.springframework.boot.actuate.autoconfigure.metrics.task.TaskExecutorMetricsAutoConfiguration
- org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat.TomcatMetricsAutoConfiguration
Furthermore, you will need some configuration related to version control and continuous integration.

3. Build agents require access to the VC server. Therefore, you need to add Artemis admin credentials so the build agent can access the repositories:

.. code-block:: yaml
artemis:
version-control:
url: <url-to-your-vc-server>
default-branch: main # The branch that should be used as default branch for all newly created repositories. This does NOT have to be equal to the default branch of the VCS
# Artemis admin credentials
user: <artemis-admin>
password: <artemis-admin-password>
4. Configuration related to the execution of build jobs:

.. code-block:: yaml
artemis:
continuous-integration:
docker-connection-uri: unix:///var/run/docker.sock
specify-concurrent-builds: true # Set to false, if the number of concurrent build jobs should be chosen automatically based on system resources
concurrent-build-size: 1 # If previous value is true: Set to desired value but keep available system resources in mind
asynchronous: true
timeout-seconds: 240 # Time limit of a build before it will be cancelled
build-container-prefix: local-ci-
image-cleanup:
enabled: true # If set to true (recommended), old Docker images will be deleted on a schedule.
expiry-days: 2 # The number of days since the last use after which a Docker image is considered outdated and can be removed.
cleanup-schedule-time: 0 0 3 * * * # CRON expression for cleanup schedule
container-cleanup:
expiry-minutes: 5 # Time after a hanging container will automatically be removed
cleanup-schedule-minutes: 60 # Schedule for container cleanup
Build agents run as `Hazelcast Lite Members <https://docs.hazelcast.com/hazelcast/5.3/maintain-cluster/lite-members>`__ and require a full member, in our case a core node, to be running.
Thus, before starting a build agent make sure that at least the primary node is running. You can then add and remove build agents to the cluster as desired.

You can verify that a build agent has been successfully added to the cluster by checking the Build Agent View in the Server Administration. It may take a few seconds for the build agent to show up:

.. figure:: distributed/build_agent_view.png
:align: center


Running multiple instances locally
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For testing purposes, you can also run multiple instances on the same machine. You can do this by using
Expand Down
Binary file added docs/admin/setup/distributed/build_agent_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f91f117

Please sign in to comment.