-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add integrationtest-sda-doa and build-sda-doa to Makefile #1305
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,132 @@ | ||||||||||
services: | ||||||||||
certfixer: | ||||||||||
command: | ||||||||||
- /bin/sh | ||||||||||
- /scripts/make_certs.sh | ||||||||||
container_name: certfixer | ||||||||||
image: alpine:latest | ||||||||||
volumes: | ||||||||||
- ./scripts:/scripts | ||||||||||
- certs:/certs | ||||||||||
- client_certs:/client_certs | ||||||||||
- /tmp:/temp | ||||||||||
|
||||||||||
postgres: | ||||||||||
build: | ||||||||||
context: ../../postgresql | ||||||||||
container_name: postgres | ||||||||||
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}-postgres | ||||||||||
depends_on: | ||||||||||
certfixer: | ||||||||||
condition: service_completed_successfully | ||||||||||
ports: | ||||||||||
- 5432:5432 | ||||||||||
environment: | ||||||||||
- LEGA_IN_PASSWORD=password | ||||||||||
- LEGA_OUT_PASSWORD=password | ||||||||||
- POSTGRES_PASSWORD=rootpasswd | ||||||||||
- POSTGRES_SERVER_CACERT=/certs/ca.crt | ||||||||||
- POSTGRES_SERVER_CERT=/certs/db.crt | ||||||||||
- POSTGRES_SERVER_KEY=/certs/db.key | ||||||||||
|
||||||||||
healthcheck: | ||||||||||
test: [ "CMD", "pg_isready", "-h", "localhost", "-U", "lega_out" ] | ||||||||||
interval: 5s | ||||||||||
timeout: 20s | ||||||||||
retries: 3 | ||||||||||
volumes: | ||||||||||
- certs:/certs | ||||||||||
|
||||||||||
mockauth: | ||||||||||
container_name: mockauth | ||||||||||
image: python:3.11-slim | ||||||||||
ports: | ||||||||||
- 8000:8000 | ||||||||||
volumes: | ||||||||||
- ../../sda-doa/test/mock_auth.py:/mock_auth.py | ||||||||||
- client_certs:/client_certs | ||||||||||
command: > | ||||||||||
sh -c "pip install --upgrade pip && pip install aiohttp Authlib && python -u /mock_auth.py 0.0.0.0 8000" | ||||||||||
|
||||||||||
|
||||||||||
|
||||||||||
rabbitmq: | ||||||||||
build: | ||||||||||
context: ../../rabbitmq | ||||||||||
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}-rabbitmq | ||||||||||
container_name: rabbitmq | ||||||||||
depends_on: | ||||||||||
certfixer: | ||||||||||
condition: service_completed_successfully | ||||||||||
environment: | ||||||||||
- RABBITMQ_SERVER_CACERT=/etc/rabbitmq/ssl/ca.crt | ||||||||||
- RABBITMQ_SERVER_CERT=/etc/rabbitmq/ssl/mq.crt | ||||||||||
- RABBITMQ_SERVER_KEY=/etc/rabbitmq/ssl/mq.key | ||||||||||
- RABBITMQ_SERVER_VERIFY=verify_none | ||||||||||
healthcheck: | ||||||||||
test: | ||||||||||
[ | ||||||||||
"CMD", | ||||||||||
"bash", | ||||||||||
"-c", | ||||||||||
"rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms", | ||||||||||
] | ||||||||||
interval: 5s | ||||||||||
timeout: 20s | ||||||||||
retries: 3 | ||||||||||
restart: always | ||||||||||
volumes: | ||||||||||
- certs:/etc/rabbitmq/ssl/ | ||||||||||
- rabbitmq_data:/var/lib/rabbitmq | ||||||||||
ports: | ||||||||||
- 5671:5671 | ||||||||||
- 25671:15671 | ||||||||||
|
||||||||||
doa: | ||||||||||
container_name: doa | ||||||||||
build: | ||||||||||
context: ../../sda-doa | ||||||||||
dockerfile: ../../sda-doa/Dockerfile | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Implicit and should not be needed |
||||||||||
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}-sda-doa | ||||||||||
depends_on: | ||||||||||
postgres: | ||||||||||
condition: service_healthy | ||||||||||
rabbitmq: | ||||||||||
condition: service_healthy | ||||||||||
certfixer: | ||||||||||
condition: service_completed_successfully | ||||||||||
links: | ||||||||||
- rabbitmq | ||||||||||
- postgres | ||||||||||
Comment on lines
+98
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Handled by proper configuration. |
||||||||||
ports: | ||||||||||
- "8080:8080" | ||||||||||
environment: | ||||||||||
- SSL_MODE=verify-ca | ||||||||||
- POSTGRES_USER=postgres | ||||||||||
- POSTGRES_DB=sda | ||||||||||
- POSTGRES_PASSWORD=rootpasswd | ||||||||||
- DB_INSTANCE=postgres | ||||||||||
- SSL_ENABLED=false | ||||||||||
- BROKER_HOST=rabbitmq | ||||||||||
- BROKER_VALIDATE=false | ||||||||||
- OPENID_CONFIGURATION_URL=http://mockauth:8000/openid-configuration | ||||||||||
- USERINFO_ENDPOINT_URL=http://mockauth:8000/userinfo | ||||||||||
Comment on lines
+112
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Or this will not be usable in an interactive case. |
||||||||||
- CRYPT4GH_PRIVATE_KEY_PATH=test/crypt4gh.sec.pem | ||||||||||
- CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH=test/crypt4gh.pass | ||||||||||
- OUTBOX_TYPE=POSIX | ||||||||||
- OUTBOX_LOCATION=/outbox/%s/files/ | ||||||||||
- SSL_ENABLED=false | ||||||||||
- ROOT_CERT_PATH=/certs/ca.crt | ||||||||||
- CERT_PATH=/certs/client.crt | ||||||||||
- CERT_KEY=/certs/client.der | ||||||||||
- BROKER_USERNAME=guest | ||||||||||
|
||||||||||
volumes: | ||||||||||
- client_certs:/certs | ||||||||||
- ../../sda-doa/test/body.enc:/test/body.enc | ||||||||||
- ../../sda-doa/outbox:/outbox | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't write data to the repository, always use the system temp for this. |
||||||||||
|
||||||||||
volumes: | ||||||||||
certs: | ||||||||||
client_certs: | ||||||||||
rabbitmq_data: |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,163 @@ | ||||||||||
services: | ||||||||||
certfixer: | ||||||||||
command: | ||||||||||
- /bin/sh | ||||||||||
- /scripts/make_certs.sh | ||||||||||
container_name: certfixer | ||||||||||
image: alpine:latest | ||||||||||
volumes: | ||||||||||
- ./scripts:/scripts | ||||||||||
- certs:/certs | ||||||||||
- client_certs:/client_certs | ||||||||||
- /tmp:/temp | ||||||||||
|
||||||||||
postgres: | ||||||||||
build: | ||||||||||
context: ../../postgresql | ||||||||||
container_name: postgres | ||||||||||
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}-postgres | ||||||||||
depends_on: | ||||||||||
certfixer: | ||||||||||
condition: service_completed_successfully | ||||||||||
ports: | ||||||||||
- 5432:5432 | ||||||||||
environment: | ||||||||||
- LEGA_IN_PASSWORD=password | ||||||||||
- LEGA_OUT_PASSWORD=password | ||||||||||
- POSTGRES_PASSWORD=rootpasswd | ||||||||||
- POSTGRES_SERVER_CACERT=/certs/ca.crt | ||||||||||
- POSTGRES_SERVER_CERT=/certs/db.crt | ||||||||||
- POSTGRES_SERVER_KEY=/certs/db.key | ||||||||||
|
||||||||||
healthcheck: | ||||||||||
test: [ "CMD", "pg_isready", "-h", "localhost", "-U", "lega_out" ] | ||||||||||
interval: 5s | ||||||||||
timeout: 20s | ||||||||||
retries: 3 | ||||||||||
volumes: | ||||||||||
- certs:/certs | ||||||||||
|
||||||||||
mockauth: | ||||||||||
container_name: mockauth | ||||||||||
image: python:3.11-slim | ||||||||||
ports: | ||||||||||
- 8000:8000 | ||||||||||
volumes: | ||||||||||
- ../../sda-doa/test/mock_auth.py:/mock_auth.py | ||||||||||
- client_certs:/client_certs | ||||||||||
command: > | ||||||||||
sh -c "pip install --upgrade pip && pip install aiohttp Authlib && python -u /mock_auth.py 0.0.0.0 8000" | ||||||||||
|
||||||||||
rabbitmq: | ||||||||||
build: | ||||||||||
context: ../../rabbitmq | ||||||||||
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}-rabbitmq | ||||||||||
container_name: rabbitmq | ||||||||||
depends_on: | ||||||||||
certfixer: | ||||||||||
condition: service_completed_successfully | ||||||||||
environment: | ||||||||||
- RABBITMQ_SERVER_CACERT=/etc/rabbitmq/ssl/ca.crt | ||||||||||
- RABBITMQ_SERVER_CERT=/etc/rabbitmq/ssl/mq.crt | ||||||||||
- RABBITMQ_SERVER_KEY=/etc/rabbitmq/ssl/mq.key | ||||||||||
- RABBITMQ_SERVER_VERIFY=verify_none | ||||||||||
healthcheck: | ||||||||||
test: | ||||||||||
[ | ||||||||||
"CMD", | ||||||||||
"bash", | ||||||||||
"-c", | ||||||||||
"rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms", | ||||||||||
] | ||||||||||
interval: 5s | ||||||||||
timeout: 20s | ||||||||||
retries: 3 | ||||||||||
restart: always | ||||||||||
volumes: | ||||||||||
- certs:/etc/rabbitmq/ssl/ | ||||||||||
- rabbitmq_data:/var/lib/rabbitmq | ||||||||||
ports: | ||||||||||
- 5671:5671 | ||||||||||
- 25671:15671 | ||||||||||
|
||||||||||
outbox: | ||||||||||
container_name: outbox | ||||||||||
image: minio/minio | ||||||||||
ports: | ||||||||||
- 9000:9000 | ||||||||||
environment: | ||||||||||
- MINIO_ACCESS_KEY=minio | ||||||||||
- MINIO_SECRET_KEY=miniostorage | ||||||||||
command: server /data | ||||||||||
healthcheck: | ||||||||||
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ] | ||||||||||
interval: 10s | ||||||||||
timeout: 5s | ||||||||||
retries: 5 | ||||||||||
|
||||||||||
init-bucket: | ||||||||||
container_name: init-bucket | ||||||||||
image: minio/mc | ||||||||||
depends_on: | ||||||||||
outbox: | ||||||||||
condition: service_healthy | ||||||||||
entrypoint: > | ||||||||||
/bin/sh -c " | ||||||||||
/usr/bin/mc config host add s3 http://outbox:9000 minio miniostorage; | ||||||||||
/usr/bin/mc mb s3/lega; | ||||||||||
exit 0; | ||||||||||
" | ||||||||||
|
||||||||||
doa: | ||||||||||
container_name: doa | ||||||||||
build: | ||||||||||
context: ../../sda-doa | ||||||||||
dockerfile: ../../sda-doa/Dockerfile | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}-sda-doa | ||||||||||
depends_on: | ||||||||||
postgres: | ||||||||||
condition: service_healthy | ||||||||||
rabbitmq: | ||||||||||
condition: service_healthy | ||||||||||
certfixer: | ||||||||||
condition: service_completed_successfully | ||||||||||
links: | ||||||||||
- rabbitmq | ||||||||||
- postgres | ||||||||||
Comment on lines
+124
to
+126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
ports: | ||||||||||
- "8080:8080" | ||||||||||
environment: | ||||||||||
- SSL_MODE=verify-ca | ||||||||||
- POSTGRES_USER=postgres | ||||||||||
- POSTGRES_DB=sda | ||||||||||
- POSTGRES_PASSWORD=rootpasswd | ||||||||||
- DB_INSTANCE=postgres | ||||||||||
- SSL_ENABLED=false | ||||||||||
- BROKER_HOST=rabbitmq | ||||||||||
- BROKER_VALIDATE=false | ||||||||||
- OPENID_CONFIGURATION_URL=http://mockauth:8000/openid-configuration | ||||||||||
- USERINFO_ENDPOINT_URL=http://mockauth:8000/userinfo | ||||||||||
Comment on lines
+138
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
- CRYPT4GH_PRIVATE_KEY_PATH=test/crypt4gh.sec.pem | ||||||||||
- CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH=test/crypt4gh.pass | ||||||||||
- OUTBOX_TYPE=S3 | ||||||||||
- SSL_ENABLED=false | ||||||||||
- ROOT_CERT_PATH=/certs/ca.crt | ||||||||||
- CERT_PATH=/certs/client.crt | ||||||||||
- CERT_KEY=/certs/client.der | ||||||||||
- BROKER_USERNAME=guest | ||||||||||
- S3_OUT_ENDPOINT=outbox | ||||||||||
- S3_OUT_PORT=9000 | ||||||||||
- S3_OUT_SECURE=false | ||||||||||
|
||||||||||
volumes: | ||||||||||
- client_certs:/certs | ||||||||||
- ../../sda-doa/test/body.enc:/test/body.enc | ||||||||||
|
||||||||||
|
||||||||||
volumes: | ||||||||||
postgres: | ||||||||||
certs: | ||||||||||
client_certs: | ||||||||||
postgres_data: | ||||||||||
rabbitmq_data: | ||||||||||
shared: |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -36,6 +36,8 @@ build-sda-sftp-inbox: | |||||
@cd sda-sftp-inbox && docker build -t ghcr.io/neicnordic/sensitive-data-archive:PR$$(date +%F)-sftp-inbox . | ||||||
build-sda-admin: | ||||||
@cd sda-admin && go build | ||||||
build-sda-doa: | ||||||
@cd sda-doa && docker build -t ghcr.io/neicnordic/sensitive-data-archive:PR$$(date +%F)-sda-doa . | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
In order to match the rest of the artifacts generated. |
||||||
|
||||||
|
||||||
go-version-check: SHELL:=/bin/bash | ||||||
|
@@ -127,6 +129,8 @@ integrationtest-sda-sync-run: | |||||
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-sync-integration.yml run integration_test | ||||||
integrationtest-sda-sync-down: | ||||||
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-sync-integration.yml down -v --remove-orphans | ||||||
integrationtest-sda-doa: | ||||||
@cd sda-doa/test/run && sh run_sda_doa_tests.sh | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rework this to match the rest of the test suite i.e.
|
||||||
|
||||||
# lint go code | ||||||
lint-all: lint-sda lint-sda-download lint-sda-admin | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should us the same mock-auth as the pother services, update to match if needed.