From 9e8bd093c101740d1b5630732d3906711837534f Mon Sep 17 00:00:00 2001 From: Ludwig <33753999+4ludwig4@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:51:37 +0200 Subject: [PATCH 1/5] Development: Add postgres docker compose setup (#6759) --- .gitignore | 2 + .../artemis-postgres-data/.gitkeep | 0 docker/artemis-dev-mysql.yml | 7 +-- docker/artemis-dev-postgres.yml | 39 ++++++++++++++++ docker/artemis-migration-check-postgres.yml | 6 ++- docker/artemis-prod-postgres.yml | 38 ++++++++++++++++ docker/artemis/config/cypress-mysql.env | 40 ++--------------- docker/artemis/config/cypress-postgres.env | 45 +------------------ docker/artemis/config/cypress.env | 44 ++++++++++++++++++ docker/artemis/config/dev.env | 11 +++++ docker/artemis/config/postgres.env | 9 ++++ docker/artemis/config/prod.env | 15 ++++++- docker/cypress-E2E-tests-mysql.yml | 1 + docker/cypress-E2E-tests-postgres.yml | 16 ++++--- docker/mailhog.yml | 2 +- docker/{postgresql.yml => postgres.yml} | 19 ++++---- docker/{postgresql => postgres}/default.env | 1 + docker/test-server-postgresql.yml | 14 +++--- docs/admin/productionSetupTips.rst | 21 +++++++++ docs/dev/setup.rst | 16 +++++-- 20 files changed, 231 insertions(+), 115 deletions(-) create mode 100644 docker/.docker-data/artemis-postgres-data/.gitkeep create mode 100644 docker/artemis-dev-postgres.yml create mode 100644 docker/artemis-prod-postgres.yml create mode 100644 docker/artemis/config/cypress.env create mode 100644 docker/artemis/config/dev.env create mode 100644 docker/artemis/config/postgres.env rename docker/{postgresql.yml => postgres.yml} (64%) rename docker/{postgresql => postgres}/default.env (65%) diff --git a/.gitignore b/.gitignore index f897ea313607..fe02c2ff3875 100644 --- a/.gitignore +++ b/.gitignore @@ -185,6 +185,8 @@ data-exports/ !/docker/.docker-data/artemis-data/.gitkeep /docker/.docker-data/artemis-mysql-data/* !/docker/.docker-data/artemis-mysql-data/.gitkeep +/docker/.docker-data/artemis-postgres-data/* +!/docker/.docker-data/artemis-postgres-data/.gitkeep ###################### # Cypress diff --git a/docker/.docker-data/artemis-postgres-data/.gitkeep b/docker/.docker-data/artemis-postgres-data/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/docker/artemis-dev-mysql.yml b/docker/artemis-dev-mysql.yml index 2e218cf60b7e..65655ef1b970 100644 --- a/docker/artemis-dev-mysql.yml +++ b/docker/artemis-dev-mysql.yml @@ -17,11 +17,8 @@ services: # expose the port to make it reachable docker internally even if the external port mapping changes expose: - "5005" - environment: - # The following enables the Java Remote Debugging port. More infos in the documentation: - # https://ls1intum.github.io/Artemis/dev/setup.html#debugging-with-docker - _JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker + env_file: + - ./artemis/config/dev.env depends_on: mysql: condition: service_healthy diff --git a/docker/artemis-dev-postgres.yml b/docker/artemis-dev-postgres.yml new file mode 100644 index 000000000000..5e1344511b6f --- /dev/null +++ b/docker/artemis-dev-postgres.yml @@ -0,0 +1,39 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis-Dev-Postgres Setup +# ---------------------------------------------------------------------------------------------------------------------- + +services: + artemis-app: + extends: + file: ./artemis.yml + service: artemis-app + # just add this linux workaround for docker compose in a development version of artemis as developers + # might want to access external services on the docker host + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "8080:8080" + - "5005:5005" # Java Remote Debugging port declared in the java cmd options + # expose the port to make it reachable docker internally even if the external port mapping changes + expose: + - "5005" + env_file: + - ./artemis/config/dev.env + - ./artemis/config/postgres.env + depends_on: + postgres: + condition: service_healthy + postgres: + extends: + file: ./postgres.yml + service: postgres + +networks: + artemis: + driver: "bridge" + name: artemis +volumes: + artemis-postgres-data: + name: artemis-postgres-data + artemis-data: + name: artemis-data diff --git a/docker/artemis-migration-check-postgres.yml b/docker/artemis-migration-check-postgres.yml index 2ddd82d07132..0d801be844d2 100644 --- a/docker/artemis-migration-check-postgres.yml +++ b/docker/artemis-migration-check-postgres.yml @@ -8,6 +8,8 @@ services: file: ./artemis.yml service: artemis-app env_file: + - ./artemis/config/postgres.env + - ./artemis/config/cypress.env - ./artemis/config/cypress-postgres.env - ./artemis/config/migration-check.env depends_on: @@ -32,7 +34,7 @@ networks: driver: "bridge" name: artemis volumes: - artemis-postgresql-data: - name: artemis-postgresql-data + artemis-postgres-data: + name: artemis-postgres-data artemis-data: name: artemis-data diff --git a/docker/artemis-prod-postgres.yml b/docker/artemis-prod-postgres.yml new file mode 100644 index 000000000000..fdb0c691f0ef --- /dev/null +++ b/docker/artemis-prod-postgres.yml @@ -0,0 +1,38 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis-Prod-Postgres Setup +# ---------------------------------------------------------------------------------------------------------------------- + +services: + artemis-app: + extends: + file: ./artemis.yml + service: artemis-app + depends_on: + postgres: + condition: service_healthy + restart: on-failure:3 + volumes: + - ./.docker-data/artemis-data:/opt/artemis/data + env_file: + - ./artemis/config/postgres.env + postgres: + extends: + file: ./postgres.yml + service: postgres + restart: on-failure:3 + volumes: + - ./.docker-data/artemis-postgres-data:/var/lib/postgresql/data + nginx: + extends: + file: ./nginx.yml + service: nginx + # the artemis-app service needs to be started, otherwise there are problems with name resolution in docker + depends_on: + artemis-app: + condition: service_started + restart: on-failure:3 + +networks: + artemis: + driver: "bridge" + name: artemis diff --git a/docker/artemis/config/cypress-mysql.env b/docker/artemis/config/cypress-mysql.env index 17177a7afbf3..b9f006a4b395 100644 --- a/docker/artemis/config/cypress-mysql.env +++ b/docker/artemis/config/cypress-mysql.env @@ -1,34 +1,21 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configuration overrides for the Cypress E2E MySQL setups +# ---------------------------------------------------------------------------------------------------------------------- + SPRING_PROFILES_ACTIVE="artemis,scheduling,bamboo,bitbucket,jira,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" -SPRING_DATASOURCE_PASSWORD="" -SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100" SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.MySQL8Dialect" SPRING_JPA_DATABASE="MYSQL" -SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true" - -SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160" - -# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port -# 54321 is internally open for the bamboo agents -# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate -SERVER_URL="http://${HOST_HOSTNAME}:54321" -# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest -ARTEMIS_BCRYPTSALTROUNDS="4" ARTEMIS_USERMANAGEMENT_USEEXTERNAL="true" ARTEMIS_USERMANAGEMENT_EXTERNAL_URL="https://jira-prelive.ase.in.tum.de" ARTEMIS_USERMANAGEMENT_EXTERNAL_USER="${bamboo_jira_prelive_admin_user}" ARTEMIS_USERMANAGEMENT_EXTERNAL_PASSWORD="${bamboo_jira_prelive_admin_password}" ARTEMIS_USERMANAGEMENT_EXTERNAL_ADMINGROUPNAME="artemis-dev" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}" -ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM" ARTEMIS_VERSIONCONTROL_URL="https://bitbucket-prelive.ase.in.tum.de" ARTEMIS_VERSIONCONTROL_USER="${bamboo_jira_prelive_admin_user}" @@ -40,22 +27,3 @@ ARTEMIS_CONTINUOUSINTEGRATION_PASSWORD="${bamboo_jira_prelive_admin_password}" ARTEMIS_CONTINUOUSINTEGRATION_TOKEN="${bamboo_ARTEMIS_CONTINUOUS_INTEGRATION_TOKEN_SECRET}" ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE="${bamboo_ARTEMIS_CONTINUOUS_INTEGRATION_ARTEMIS_AUTHENTICATION_TOKEN_VALUE_SECRET}" ARTEMIS_CONTINUOUSINTEGRATION_VCSAPPLICATIONLINKNAME="Bitbucket Prelive" -ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true" - -ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter" - -# Token is valid 3 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200" -# Token is valid 30 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000" - -# Properties to be exposed on the /info management endpoint - -INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint" -INFO_TESTSERVER="true" -INFO_TEXTASSESSMENTANALYTICSENABLED="true" -INFO_STUDENTEXAMSTORESESSIONDATA="true" - -LOGGING_FILE_NAME="/opt/artemis/data/artemis.log" - -MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true" diff --git a/docker/artemis/config/cypress-postgres.env b/docker/artemis/config/cypress-postgres.env index d0ab68263c90..73254a9afebc 100644 --- a/docker/artemis/config/cypress-postgres.env +++ b/docker/artemis/config/cypress-postgres.env @@ -1,34 +1,10 @@ # ---------------------------------------------------------------------------------------------------------------------- -# Artemis configurations for Postgres setups +# Artemis configuration overrides for the Cypress E2E Postgres setups # ---------------------------------------------------------------------------------------------------------------------- SPRING_PROFILES_ACTIVE="artemis,scheduling,jenkins,gitlab,prod,docker" -SPRING_DATASOURCE_URL="jdbc:postgresql://artemis-postgresql:5432/Artemis?sslmode=disable" -SPRING_DATASOURCE_USERNAME="postgres" -SPRING_DATASOURCE_PASSWORD="" -SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100" - -SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.PostgreSQL10Dialect" -SPRING_JPA_DATABASE="POSTGRESQL" -SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true" - -SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160" - -# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port -# 54321 is internally open for the bamboo agents -# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate -SERVER_URL="http://${HOST_HOSTNAME}:54321" - -# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest -ARTEMIS_BCRYPTSALTROUNDS="4" - ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}" -ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM" ARTEMIS_VERSIONCONTROL_URL="https://gitlab-test.artemis.in.tum.de" ARTEMIS_VERSIONCONTROL_USER="${bamboo_gitlab_admin_user}" @@ -44,26 +20,7 @@ ARTEMIS_CONTINUOUSINTEGRATION_SECRETPUSHTOKEN="${bamboo_jenkins_secret_push_toke ARTEMIS_CONTINUOUSINTEGRATION_VCSCREDENTIALS="${bamboo_jenkins_vcs_credentials_secret}" ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENKEY="${bamboo_jenkins_artemis_ci_authentication_token_key_secret}" ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE="${bamboo_jenkins_artemis_ci_authentication_token_value_secret}" -ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true" ARTEMIS_CONTINUOUSINTEGRATION_BUILDTIMEOUT="30" -ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter" - -# Token is valid 3 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200" -# Token is valid 30 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000" - -# Properties to be exposed on the /info management endpoint - -INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint" -INFO_TESTSERVER="true" -INFO_TEXTASSESSMENTANALYTICSENABLED="true" -INFO_STUDENTEXAMSTORESESSIONDATA="true" - -LOGGING_FILE_NAME="/opt/artemis/data/artemis.log" - -MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true" - JENKINS_INTERNALURLS_CIURL="https://jenkins-test.artemis.in.tum.de" JENKINS_INTERNALURLS_VCNURL="https://gitlab-test.artemis.in.tum.de" diff --git a/docker/artemis/config/cypress.env b/docker/artemis/config/cypress.env new file mode 100644 index 000000000000..c056a8d9004c --- /dev/null +++ b/docker/artemis/config/cypress.env @@ -0,0 +1,44 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Common Artemis configurations for the Cypress E2E MySQL and Postgres setups +# ---------------------------------------------------------------------------------------------------------------------- + +SPRING_DATASOURCE_PASSWORD="" +SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100" + +SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4" +SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4" +SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true" + +SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160" + +# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port +# 54321 is internally open for the bamboo agents +# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate +SERVER_URL="http://${HOST_HOSTNAME}:54321" + +# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest +ARTEMIS_BCRYPTSALTROUNDS="4" + +ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}" +ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}" +ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM" + +ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true" + +ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter" + +# Token is valid 3 days +JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200" +# Token is valid 30 days +JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000" + +# Properties to be exposed on the /info management endpoint + +INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint" +INFO_TESTSERVER="true" +INFO_TEXTASSESSMENTANALYTICSENABLED="true" +INFO_STUDENTEXAMSTORESESSIONDATA="true" + +LOGGING_FILE_NAME="/opt/artemis/data/artemis.log" + +MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true" diff --git a/docker/artemis/config/dev.env b/docker/artemis/config/dev.env new file mode 100644 index 000000000000..4dc4617261bd --- /dev/null +++ b/docker/artemis/config/dev.env @@ -0,0 +1,11 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configurations for Dev Artemis setups +# ---------------------------------------------------------------------------------------------------------------------- +# The default Artemis Spring profiles for Docker are defined here. +# ---------------------------------------------------------------------------------------------------------------------- + +SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker + +# The following enables the Java Remote Debugging port. More infos in the documentation: +# https://ls1intum.github.io/Artemis/dev/setup.html#debugging-with-docker +_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 diff --git a/docker/artemis/config/postgres.env b/docker/artemis/config/postgres.env new file mode 100644 index 000000000000..2c8a07e95f37 --- /dev/null +++ b/docker/artemis/config/postgres.env @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configurations for Postgres setups +# ---------------------------------------------------------------------------------------------------------------------- + +SPRING_DATASOURCE_URL="jdbc:postgresql://artemis-postgres:5432/Artemis?sslmode=disable" +SPRING_DATASOURCE_USERNAME="postgres" + +SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.PostgreSQL10Dialect" +SPRING_JPA_DATABASE="POSTGRESQL" diff --git a/docker/artemis/config/prod.env b/docker/artemis/config/prod.env index 3f708bdc709e..a86a87bcf51a 100644 --- a/docker/artemis/config/prod.env +++ b/docker/artemis/config/prod.env @@ -1,6 +1,15 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configurations for Prod Artemis setups +# ---------------------------------------------------------------------------------------------------------------------- +# The default Artemis Spring profiles for Docker are defined here. +# ---------------------------------------------------------------------------------------------------------------------- SPRING_PROFILES_ACTIVE="artemis,scheduling,athena,prod,docker" +# ---------------------------------------------------------------------------------------------------------------------- # Secret Overrides +# ---------------------------------------------------------------------------------------------------------------------- +# Change these default secrets in another not-commited environment override file for prod systems! +# ---------------------------------------------------------------------------------------------------------------------- ARTEMIS_ATHENA_SECRET="abcdefg12345" ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="artemis_admin" ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="artemis_admin" @@ -17,6 +26,10 @@ SPRING_WEBSOCKET_BROKER_PASSWORD="guest" JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64SECRET="bXktc2VjcmV0LWtleS13aGljaC1zaG91bGQtYmUtY2hhbmdlZC1pbi1wcm9kdWN0aW9uLWFuZC1iZS1iYXNlNjQtZW5jb2RlZAo=" JHIPSTER_REGISTRY_PASSWORD="AN-ADMIN-PASSWORD-THAT-MUST-BE-CHANGED (FROM REGISTRY CONFIG)" - +# ---------------------------------------------------------------------------------------------------------------------- # Plain Prod Artemis Overrides +# ---------------------------------------------------------------------------------------------------------------------- +# Keep these at a minimum! Try to change the default values either in the application-docker.yml or even better +# in one of the other application.yml or application-*.yml files. +# ---------------------------------------------------------------------------------------------------------------------- ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false" diff --git a/docker/cypress-E2E-tests-mysql.yml b/docker/cypress-E2E-tests-mysql.yml index 835b6880e033..96f9fe67989f 100644 --- a/docker/cypress-E2E-tests-mysql.yml +++ b/docker/cypress-E2E-tests-mysql.yml @@ -16,6 +16,7 @@ services: mysql: condition: service_healthy env_file: + - ./artemis/config/cypress.env - ./artemis/config/cypress-mysql.env nginx: diff --git a/docker/cypress-E2E-tests-postgres.yml b/docker/cypress-E2E-tests-postgres.yml index 3d24c792a177..a42d2232adc7 100644 --- a/docker/cypress-E2E-tests-postgres.yml +++ b/docker/cypress-E2E-tests-postgres.yml @@ -1,21 +1,23 @@ # ---------------------------------------------------------------------------------------------------------------------- -# Cypress Setup PostgreSQL +# Cypress Setup Postgres # ---------------------------------------------------------------------------------------------------------------------- services: - postgresql: + postgres: extends: - file: ./postgresql.yml - service: postgresql + file: ./postgres.yml + service: postgres artemis-app: extends: file: ./artemis.yml service: artemis-app depends_on: - postgresql: + postgres: condition: service_healthy env_file: + - ./artemis/config/postgres.env + - ./artemis/config/cypress.env - ./artemis/config/cypress-postgres.env nginx: @@ -51,7 +53,7 @@ networks: driver: "bridge" name: artemis volumes: - artemis-postgresql-data: - name: artemis-postgresql-data + artemis-postgres-data: + name: artemis-postgres-data artemis-data: name: artemis-data diff --git a/docker/mailhog.yml b/docker/mailhog.yml index 5145f67cdff4..70af79096071 100644 --- a/docker/mailhog.yml +++ b/docker/mailhog.yml @@ -7,7 +7,7 @@ services: mailhog: container_name: artemis-mailhog - image: mailhog/mailhog + image: docker.io/mailhog/mailhog pull_policy: always ports: - "1025:1025" diff --git a/docker/postgresql.yml b/docker/postgres.yml similarity index 64% rename from docker/postgresql.yml rename to docker/postgres.yml index aec7d23cfee7..097c9530baee 100644 --- a/docker/postgresql.yml +++ b/docker/postgres.yml @@ -3,19 +3,22 @@ # ---------------------------------------------------------------------------------------------------------------------- services: - postgresql: - container_name: artemis-postgresql - image: postgres:15.3-alpine + postgres: + container_name: artemis-postgres + image: docker.io/library/postgres:15.3-alpine pull_policy: always user: postgres command: ["postgres", "-c", "max_connections=200"] volumes: - - artemis-postgresql-data:/var/lib/postgresql/data + - artemis-postgres-data:/var/lib/postgresql/data # DO NOT use this default file for production systems! env_file: - - ./postgresql/default.env + - ./postgres/default.env ports: - - "5432:5432" + - "127.0.0.1:5432:5432" + # expose the port to make it reachable docker internally even if the external port mapping changes + expose: + - "5432" healthcheck: test: pg_isready -U postgres -d Artemis interval: 5s @@ -32,5 +35,5 @@ networks: name: artemis volumes: - artemis-postgresql-data: - name: artemis-postgresql-data + artemis-postgres-data: + name: artemis-postgres-data diff --git a/docker/postgresql/default.env b/docker/postgres/default.env similarity index 65% rename from docker/postgresql/default.env rename to docker/postgres/default.env index 9d69c3af68ff..d92a5b5f2722 100644 --- a/docker/postgresql/default.env +++ b/docker/postgres/default.env @@ -1,3 +1,4 @@ POSTGRES_HOST_AUTH_METHOD=trust POSTGRES_USER=postgres POSTGRES_DB=Artemis +PGDATA=/var/lib/postgresql/data/pgdata diff --git a/docker/test-server-postgresql.yml b/docker/test-server-postgresql.yml index 140d77a0cb3b..e9740206ed52 100644 --- a/docker/test-server-postgresql.yml +++ b/docker/test-server-postgresql.yml @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------------------------------------------------- -# Setup for a test server with PostgreSQL +# Setup for a test server with Postgres # ---------------------------------------------------------------------------------------------------------------------- # It is designed to take in a lot of environment variables to take in all the configuration of the test server. # ---------------------------------------------------------------------------------------------------------------------- @@ -11,7 +11,7 @@ services: service: artemis-app image: ghcr.io/ls1intum/artemis:${ARTEMIS_DOCKER_TAG:-latest} depends_on: - postgresql: + postgres: condition: service_healthy pull_policy: always restart: always @@ -22,15 +22,15 @@ services: - ${ARTEMIS_LEGAL_MOUNT:-./.docker-data/artemis-legal}:/opt/artemis/legal - ${ARTEMIS_DATA_EXPORT_MOUNT:-./.docker-data/artemis-data-exports}:/opt/artemis/data-exports - postgresql: + postgres: extends: - file: ./postgresql.yml - service: postgresql + file: ./postgres.yml + service: postgres restart: always env_file: - - ${DATABASE_ENV_FILE:-./postgresql/default.env} + - ${DATABASE_ENV_FILE:-./postgres/default.env} volumes: - - ${DATABASE_VOLUME_MOUNT:-./.docker-data/artemis-postgresql-data}:/var/lib/postgresql/data + - ${DATABASE_VOLUME_MOUNT:-./.docker-data/artemis-postgres-data}:/var/lib/postgresql/data nginx: extends: diff --git a/docs/admin/productionSetupTips.rst b/docs/admin/productionSetupTips.rst index fadaebb46766..cc95bee1b4ee 100644 --- a/docs/admin/productionSetupTips.rst +++ b/docs/admin/productionSetupTips.rst @@ -35,3 +35,24 @@ Place the webpage that should be shown in case of Artemis being unreachable (in error_page 501 502 503 /service_down.html; } + +## Gather all Docker Compose-related tips here which are not relevant for developers! +.. _docker_compose_setup_prod: + +Docker Compose Setup +-------------------- + +The :ref:`development section of the documentation ` provides a introduction to +Docker Compose setups for Artemis. +This section provides additional information for administrators. + +File Permissions +^^^^^^^^^^^^^^^^ +If you use the production Docker Compose Setups (``artemis-prod-*.yml``) with bind mounts change +the file permissions accordingly: + +.. code:: bash + + sudo chown -R $(id -u):70 docker/.docker-data/artemis-postgres-data + sudo chown -R $(id -u):999 docker/.docker-data/artemis-mysql-data + sudo chown -R $(id -u):1337 docker/.docker-data/artemis-data diff --git a/docs/dev/setup.rst b/docs/dev/setup.rst index 082a792a6be0..47d87eb8fa82 100644 --- a/docs/dev/setup.rst +++ b/docs/dev/setup.rst @@ -119,7 +119,8 @@ PostgreSQL Setup No special PostgreSQL settings are required. You can either use your package manager’s version, or set it up using a container. -An example Docker Compose setup based on the `official container image `_ is provided in ``src/main/docker/postgresql.yml``. +An example Docker Compose setup based on the `official container image `_ +is provided in ``src/main/docker/postgres.yml``. When setting up the Artemis server, the following values need to be added/updated in the server configuration (see setup steps below) to connect to PostgreSQL instead of MySQL: @@ -719,6 +720,8 @@ HTTP. We need to extend the configuration in the file ------------------------------------------------------------------------------------------------------------------------ +.. _docker_compose_setup_dev: + Alternative: Docker Compose Setup --------------------------------- @@ -765,7 +768,11 @@ The easiest way to configure a local deployment via Docker is a deployment with In the directory ``docker/`` you can find the following *docker compose* files for different **setups**: * ``artemis-dev-mysql.yml``: **Artemis-Dev-MySQL** Setup containing the development build of Artemis and a MySQL DB +* ``artemis-dev-postgres.yml``: **Artemis-Dev-Postgres** Setup containing the development build of Artemis and + a PostgreSQL DB * ``artemis-prod-mysql.yml``: **Artemis-Prod-MySQL** Setup containing the production build of Artemis and a MySQL DB +* ``artemis-prod-postgres.yml``: **Artemis-Prod-Postgres** Setup containing the production build of Artemis and + a PostgreSQL DB * ``atlassian.yml``: **Atlassian** Setup containing a Jira, Bitbucket and Bamboo instance (see `Bamboo, Bitbucket and Jira Setup Guide <#bamboo-bitbucket-and-jira-setup>`__ for the configuration of this setup) @@ -775,14 +782,15 @@ In the directory ``docker/`` you can find the following *docker compose* files f * ``monitoring.yml``: **Prometheus-Grafana** Setup containing a Prometheus and Grafana instance * ``mysql.yml``: **MySQL** Setup containing a MySQL DB instance * ``nginx.yml``: **Nginx** Setup containing a preconfigured Nginx instance -* ``postgresql.yml``: **PostgreSQL** Setup containing a PostgreSQL DB instance +* ``postgres.yml``: **Postgres** Setup containing a PostgreSQL DB instance -Two example commands to run such setups: +Three example commands to run such setups: .. code:: bash docker compose -f docker/atlassian.yml up docker compose -f docker/mysql.yml -f docker/gitlab-jenkins.yml up + docker compose -f docker/artemis-dev-postgres.yml up .. tip:: There is also a single ``docker-compose.yml`` in the directory ``docker/`` which mirrors the setup of ``artemis-prod-mysql.yml``. @@ -796,7 +804,7 @@ is defined in the following files: * ``artemis.yml``: **Artemis Service** * ``mysql.yml``: **MySQL DB Service** * ``nginx.yml``: **Nginx Service** -* ``postgresql.yml``: **PostgreSQL DB Service** +* ``postgres.yml``: **PostgreSQL DB Service** * ``gitlab.yml``: **GitLab Service** * ``jenkins.yml``: **Jenkins Service** From d3075d01c145185312f6d9ff777e6fc7ab9f42ce Mon Sep 17 00:00:00 2001 From: Lennart Keller <44754405+lennart-keller@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:57:04 +0200 Subject: [PATCH 2/5] Communication: Create channels for test-exams (#7171) --- .../service/metis/conversation/ChannelService.java | 3 --- .../app/exam/manage/exams/exam-update.component.ts | 2 +- .../tum/in/www1/artemis/exam/ExamIntegrationTest.java | 5 ++++- .../spec/component/exam/exam-update.component.spec.ts | 11 ++++++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/service/metis/conversation/ChannelService.java b/src/main/java/de/tum/in/www1/artemis/service/metis/conversation/ChannelService.java index 5bf92bc64838..1bea6402da04 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/metis/conversation/ChannelService.java +++ b/src/main/java/de/tum/in/www1/artemis/service/metis/conversation/ChannelService.java @@ -283,9 +283,6 @@ public Channel createExerciseChannel(Exercise exercise, Optional channel * @return the created channel */ public Channel createExamChannel(Exam exam, Optional channelName) { - if (exam.isTestExam()) { - return null; - } Channel channelToCreate = createDefaultChannel(channelName, "exam-", exam.getTitle()); channelToCreate.setIsPublic(false); channelToCreate.setExam(exam); diff --git a/src/main/webapp/app/exam/manage/exams/exam-update.component.ts b/src/main/webapp/app/exam/manage/exams/exam-update.component.ts index 3541b4d1a46a..0997d8694461 100644 --- a/src/main/webapp/app/exam/manage/exams/exam-update.component.ts +++ b/src/main/webapp/app/exam/manage/exams/exam-update.component.ts @@ -74,7 +74,7 @@ export class ExamUpdateComponent implements OnInit { next: (response: HttpResponse) => { this.exam.course = response.body!; this.course = response.body!; - this.hideChannelNameInput = exam.testExam || (exam.id !== undefined && exam.channelName === undefined) || !isMessagingEnabled(this.course); + this.hideChannelNameInput = (exam.id !== undefined && exam.channelName === undefined) || !isMessagingEnabled(this.course); }, error: (err: HttpErrorResponse) => onError(this.alertService, err), }); diff --git a/src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java index 3d3a23e2b37e..b325756679bd 100644 --- a/src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exam/ExamIntegrationTest.java @@ -1028,9 +1028,12 @@ private List createExamsWithInvalidDates(Course course) { void testCreateTestExam_asInstructor() throws Exception { // Test the creation of a test exam Exam examA = ExamFactory.generateTestExam(course1); - request.post("/api/courses/" + course1.getId() + "/exams", examA, HttpStatus.CREATED); + URI examUri = request.post("/api/courses/" + course1.getId() + "/exams", examA, HttpStatus.CREATED); + Exam savedExam = request.get(String.valueOf(examUri), HttpStatus.OK, Exam.class); verify(examAccessService).checkCourseAccessForInstructorElseThrow(course1.getId()); + Channel channelFromDB = channelRepository.findChannelByExamId(savedExam.getId()); + assertThat(channelFromDB).isNotNull(); } @Test diff --git a/src/test/javascript/spec/component/exam/exam-update.component.spec.ts b/src/test/javascript/spec/component/exam/exam-update.component.spec.ts index bc8f77f8d679..a5e668ad7e97 100644 --- a/src/test/javascript/spec/component/exam/exam-update.component.spec.ts +++ b/src/test/javascript/spec/component/exam/exam-update.component.spec.ts @@ -12,7 +12,7 @@ import { of, throwError } from 'rxjs'; import { RouterTestingModule } from '@angular/router/testing'; import { FormsModule } from '@angular/forms'; import { FontAwesomeTestingModule } from '@fortawesome/angular-fontawesome/testing'; -import { Course } from 'app/entities/course.model'; +import { Course, CourseInformationSharingConfiguration } from 'app/entities/course.model'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { FormDateTimePickerComponent } from 'app/shared/date-time-picker/date-time-picker.component'; import { MarkdownEditorComponent } from 'app/shared/markdown-editor/markdown-editor.component'; @@ -57,6 +57,7 @@ describe('Exam Update Component', () => { const course = new Course(); course.id = 1; + course.courseInformationSharingConfiguration = CourseInformationSharingConfiguration.COMMUNICATION_AND_MESSAGING; const routes = [ { path: 'course-management/:courseId/exams/:examId', component: DummyComponent }, { path: 'course-management/:courseId/exams', component: DummyComponent }, @@ -211,6 +212,14 @@ describe('Exam Update Component', () => { expect(component.isValidConfiguration).toBeFalse(); }); + it('should show channel name input for test exams', fakeAsync(() => { + examWithoutExercises.testExam = true; + examWithoutExercises.channelName = 'test-exam'; + component.ngOnInit(); + tick(); + expect(component.hideChannelNameInput).toBeFalse(); + })); + it('should validate the example solution publication date correctly', () => { const newExamWithoutExercises = new Exam(); newExamWithoutExercises.id = 2; From 9acb62fd1a12adf0efa96dbd505349522ddc2f11 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:58:13 +0200 Subject: [PATCH 3/5] Development: Disable secure cookies for local testing with dev profile (#7162) --- .../tum/in/www1/artemis/security/jwt/JWTCookieService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/security/jwt/JWTCookieService.java b/src/main/java/de/tum/in/www1/artemis/security/jwt/JWTCookieService.java index f16565a28e9f..bc58f81579c9 100644 --- a/src/main/java/de/tum/in/www1/artemis/security/jwt/JWTCookieService.java +++ b/src/main/java/de/tum/in/www1/artemis/security/jwt/JWTCookieService.java @@ -17,6 +17,8 @@ public class JWTCookieService { private static final String CYPRESS_PROFILE = "cypress"; + private static final String DEVELOPMENT_PROFILE = "dev"; + private final TokenProvider tokenProvider; private final Environment environment; @@ -56,12 +58,13 @@ public ResponseCookie buildLogoutCookie() { */ private ResponseCookie buildJWTCookie(String jwt, Duration duration) { + // TODO - Remove cypress workaround once cypress uses https and find a better solution for testing locally in Safari Collection activeProfiles = Arrays.asList(environment.getActiveProfiles()); - boolean isCypress = activeProfiles.contains(CYPRESS_PROFILE); + boolean isSecure = !activeProfiles.contains(CYPRESS_PROFILE) && !activeProfiles.contains(DEVELOPMENT_PROFILE); return ResponseCookie.from(JWT_COOKIE_NAME, jwt).httpOnly(true) // Must be httpOnly .sameSite("Lax") // Must be Lax to allow navigation links to Artemis to work - .secure(!isCypress) // Must be secure - TODO - Remove cypress workaround once cypress uses https + .secure(isSecure) // Must be secure .path("/") // Must be "/" to be sent in ALL request .maxAge(duration) // Duration should match the duration of the jwt .build(); // Build cookie From 21e611bde4b188bfc199f6d0c5b4fa397a6bd0f5 Mon Sep 17 00:00:00 2001 From: Lucas Welscher Date: Thu, 14 Sep 2023 10:59:12 +0200 Subject: [PATCH 4/5] Development: Execute architecture tests during java style action (#7160) --- .github/workflows/test.yml | 10 ++++++ build.gradle | 13 +++++-- .../artemis/AbstractArchitectureTest.java | 13 ++++--- ...ava => AuthorizationArchitectureTest.java} | 31 +--------------- .../AuthorizationEndpointTest.java | 36 +++++++++++++++++++ 5 files changed, 65 insertions(+), 38 deletions(-) rename src/test/java/de/tum/in/www1/artemis/authorization/{AuthorizationTest.java => AuthorizationArchitectureTest.java} (73%) create mode 100644 src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationEndpointTest.java diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1cd3fd6437fd..5daa40581328 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -209,6 +209,16 @@ jobs: - name: Java Documentation run: ./gradlew checkstyleMain -x webapp if: success() || failure() + - name: Java Architecture Tests + run: ./gradlew test -DincludeTags='ArchitectureTest' -x webapp + if: success() || failure() + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Java Architecture Tests + path: build/test-results/test/*.xml + reporter: java-junit client-tests: runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index 19452c131ffa..b59c9016479f 100644 --- a/build.gradle +++ b/build.gradle @@ -96,10 +96,17 @@ modernizer { } // Execute the test cases: ./gradlew test - +// Execute only architecture tests: ./gradlew test -DincludeTags='ArchitectureTest' test { - useJUnitPlatform() - exclude "**/*IT*", "**/*IntTest*" + if (System.getProperty("includeTags")) { + useJUnitPlatform { + includeTags System.getProperty("includeTags") + } + } else { + useJUnitPlatform() + exclude "**/*IT*", "**/*IntTest*" + } + testLogging { events "FAILED", "SKIPPED" } diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java index 1f0a80ac3352..ded1b8c42ab4 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java @@ -3,12 +3,14 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Tag; import com.tngtech.archunit.core.domain.JavaClasses; import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.core.importer.ImportOption; -public abstract class AbstractArchitectureTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +@Tag("ArchitectureTest") +public abstract class AbstractArchitectureTest { protected static final String ARTEMIS_PACKAGE = "de.tum.in.www1.artemis"; @@ -20,10 +22,11 @@ public abstract class AbstractArchitectureTest extends AbstractSpringIntegration @BeforeAll static void loadClasses() { - testClasses = new ClassFileImporter().withImportOption(new ImportOption.OnlyIncludeTests()).importPackages(ARTEMIS_PACKAGE); - productionClasses = new ClassFileImporter().withImportOption(new ImportOption.DoNotIncludeTests()).importPackages(ARTEMIS_PACKAGE); - allClasses = new ClassFileImporter().importPackages(ARTEMIS_PACKAGE); - + if (allClasses == null) { + testClasses = new ClassFileImporter().withImportOption(new ImportOption.OnlyIncludeTests()).importPackages(ARTEMIS_PACKAGE); + productionClasses = new ClassFileImporter().withImportOption(new ImportOption.DoNotIncludeTests()).importPackages(ARTEMIS_PACKAGE); + allClasses = new ClassFileImporter().importPackages(ARTEMIS_PACKAGE); + } ensureClassSetsNonEmpty(); ensureAllClassesFound(); } diff --git a/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationTest.java b/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationArchitectureTest.java similarity index 73% rename from src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationTest.java rename to src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationArchitectureTest.java index 6974f06d5f6a..49d7c38acc90 100644 --- a/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationArchitectureTest.java @@ -2,34 +2,16 @@ import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.*; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; -import java.util.stream.Collectors; - import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.mvc.method.RequestMappingInfo; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import com.tngtech.archunit.lang.ArchRule; import de.tum.in.www1.artemis.AbstractArchitectureTest; import de.tum.in.www1.artemis.security.annotations.*; -/** - * Contains the one automatic test covering all rest endpoints for authorization tests. - */ -class AuthorizationTest extends AbstractArchitectureTest { - - @Autowired - private ApplicationContext applicationContext; - - @Autowired - private AuthorizationTestService authorizationTestService; +class AuthorizationArchitectureTest extends AbstractArchitectureTest { private static final String ARTEMIS_PACKAGE = "de.tum.in.www1.artemis"; @@ -39,17 +21,6 @@ class AuthorizationTest extends AbstractArchitectureTest { private static final String REST_OPEN_PACKAGE = REST_BASE_PACKAGE + ".open"; - @Test - void testEndpoints() throws InvocationTargetException, IllegalAccessException { - var requestMappingHandlerMapping = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); - Map endpointMap = requestMappingHandlerMapping.getHandlerMethods(); - // Filter out endpoints that should not be tested. - endpointMap = endpointMap.entrySet().stream().filter(entry -> authorizationTestService.validEndpointToTest(entry.getValue(), false)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - - authorizationTestService.testEndpoints(endpointMap); - } - @Test void testNoPreAuthorizeOnRestControllers() { ArchRule rule = noClasses().that().areAnnotatedWith(RestController.class).should().beAnnotatedWith(PreAuthorize.class).because( diff --git a/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationEndpointTest.java b/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationEndpointTest.java new file mode 100644 index 000000000000..365a07916d17 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationEndpointTest.java @@ -0,0 +1,36 @@ +package de.tum.in.www1.artemis.authorization; + +import java.util.Map; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; + +/** + * Contains the one automatic test covering all rest endpoints for authorization tests. + */ +class AuthorizationEndpointTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { + + @Autowired + private ApplicationContext applicationContext; + + @Autowired + private AuthorizationTestService authorizationTestService; + + @Test + void testEndpoints() { + var requestMappingHandlerMapping = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); + Map endpointMap = requestMappingHandlerMapping.getHandlerMethods(); + // Filter out endpoints that should not be tested. + endpointMap = endpointMap.entrySet().stream().filter(entry -> authorizationTestService.validEndpointToTest(entry.getValue(), false)) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + + authorizationTestService.testEndpoints(endpointMap); + } +} From dfe461c601842f8dfe190b12446f2d6f1d2739d2 Mon Sep 17 00:00:00 2001 From: Florian Gareis Date: Thu, 14 Sep 2023 11:55:12 +0200 Subject: [PATCH 5/5] Development: Remove --legacy-peer-deps and fix postgres file link (#7198) --- docker/artemis-migration-check-postgres.yml | 4 ++-- docker/cypress-E2E-tests-mysql.yml | 2 +- docker/cypress-E2E-tests-postgres.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/artemis-migration-check-postgres.yml b/docker/artemis-migration-check-postgres.yml index 0d801be844d2..5f7cf661c39f 100644 --- a/docker/artemis-migration-check-postgres.yml +++ b/docker/artemis-migration-check-postgres.yml @@ -17,8 +17,8 @@ services: condition: service_healthy postgresql: extends: - file: ./postgresql.yml - service: postgresql + file: ./postgres.yml + service: postgres migration-check: image: alpine container_name: migration-check diff --git a/docker/cypress-E2E-tests-mysql.yml b/docker/cypress-E2E-tests-mysql.yml index 96f9fe67989f..99e96f8b7c87 100644 --- a/docker/cypress-E2E-tests-mysql.yml +++ b/docker/cypress-E2E-tests-mysql.yml @@ -45,7 +45,7 @@ services: environment: CYPRESS_DB_TYPE: "MySQL" SORRY_CYPRESS_PROJECT_ID: "artemis-mysql" - command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci --legacy-peer-deps && npm run cypress:setup && (npm run cypress:record:mysql & sleep 60 && npm run cypress:record:mysql & wait)" + command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && (npm run cypress:record:mysql & sleep 60 && npm run cypress:record:mysql & wait)" networks: artemis: diff --git a/docker/cypress-E2E-tests-postgres.yml b/docker/cypress-E2E-tests-postgres.yml index a42d2232adc7..0c2ed641ee70 100644 --- a/docker/cypress-E2E-tests-postgres.yml +++ b/docker/cypress-E2E-tests-postgres.yml @@ -46,7 +46,7 @@ services: environment: CYPRESS_DB_TYPE: "Postgres" SORRY_CYPRESS_PROJECT_ID: "artemis-postgres" - command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci --legacy-peer-deps && npm run cypress:setup && (npm run cypress:record:postgres & sleep 60 && npm run cypress:record:postgres & wait)" + command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && (npm run cypress:record:postgres & sleep 60 && npm run cypress:record:postgres & wait)" networks: artemis: