diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01b861a5ab94ee88c993ae9e20d2fe8542134d16..b3a80a57b203b91dbaa40c0af17d138da95022c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ docker-deploy-master: - chmod 644 ~/.ssh/known_hosts script: - ssh -o StrictHostKeyChecking=no vermaas@sdc.astron.nl "docker pull "$CI_REGISTRY_IMAGE"" - - ssh -o StrictHostKeyChecking=no vermaas@sdc.astron.nl "docker-compose -p atdb -f /docker_compose/atdb-ldv/docker-compose-cd.yml up -d" + - ssh -o StrictHostKeyChecking=no vermaas@sdc.astron.nl "docker-compose -p atdb -f /docker_compose/atdb-ldv/docker-compose-dev-cd.yml up -d" when: manual only: - master diff --git a/README.md b/README.md index 4ccf2cf1858a4b0462dd629eb2cf8e01a0d98bf4..1dea0b70d1550b11bcbf38a7f856730a490bc6f9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ These diagrams roughly serves as the specifications for adapting ATDB for LDV. * workflow: https://support.astron.nl/confluence/display/LDV/WORKFLOW * datamodel: https://dbdiagram.io/d/5ffc5fb180d742080a35d560 -## Overview Diagrams +## Overview Diagrams (current implementation) +These diagrams show the current implementation and are kept up-to-date. ### Datamodel: * https://drive.google.com/file/d/1v5hMBQS0jT8DQJwySVISfRa1zF4o0fCQ/view?usp=sharing @@ -29,7 +30,7 @@ These diagrams roughly serves as the specifications for adapting ATDB for LDV.  -### Test Environment on sdc-dev.astron.nl: +## Test Environment on sdc-dev.astron.nl: ### main GUI: * https://sdc.astron.nl:5554/atdb/ @@ -43,29 +44,32 @@ serializers: * tasks: http://sdc.astron.nl:5554/atdb/tasks/ get_size: +Return the sum the sizes of all tasks with a given list of statusses * https://sdc.astron.nl:5554/atdb/tasks/get_size * https://sdc.astron.nl:5554/atdb/tasks/get_size?status__in=staged,processing,processed,validating,validated,ingesting,removing,removed +## Build & Deploy + ### Deployment Diagram: * https://drive.google.com/file/d/1_j9Fp505pZTxcmzAEdgftdPkoIFrKfAX/view?usp=sharing  -## CI/CD (semi) automatic deploy in Docker +### CI/CD (semi) automatic deploy in Docker For the `master` branch there is a CI/CD pipeline in place which builds and deploys the backend at https://sdc.astron.nl:5554/atdb/ The deploy step requires pushing the 'play' button in the gitlab pipelines section. This is done to not have a mandatory deploy for every minor commmit. -## Manual deploy in Docker (alternative to CI/CD) +### Manual deploy in Docker (alternative to CI/CD) -### initial +#### initial > cd ~/my_docker > cd atdb-ldv > git clone https://git.astron.nl/astron-sdc/atdb-ldv.git -### update: +#### update: > export DOCKER_BUILD_DIR=$HOME/my_docker/atdb-ldv/atdb-ldv/atdb > export DOCKER_COMPOSE_DIR=$DOCKER_BUILD_DIR/docker @@ -75,7 +79,7 @@ This is done to not have a mandatory deploy for every minor commmit. > cd $DOCKER_COMPOSE_DIR > docker-compose -p atdb up -d -### Database changes and migrations +#### Database changes and migrations When the `models.py` is changed, then the database must be migrated. This is the procedure for that. diff --git a/atdb/docker-compose-atdb-ldv-acc-cd.yml b/atdb/docker/docker-compose-atdb-ldv-acc-cd.yml similarity index 100% rename from atdb/docker-compose-atdb-ldv-acc-cd.yml rename to atdb/docker/docker-compose-atdb-ldv-acc-cd.yml diff --git a/atdb/docker-compose-atdb-ldv-acc.yml b/atdb/docker/docker-compose-atdb-ldv-acc.yml similarity index 100% rename from atdb/docker-compose-atdb-ldv-acc.yml rename to atdb/docker/docker-compose-atdb-ldv-acc.yml diff --git a/atdb/docker-compose-cd.yml b/atdb/docker/docker-compose-dev-cd.yml similarity index 90% rename from atdb/docker-compose-cd.yml rename to atdb/docker/docker-compose-dev-cd.yml index c6bb0c0cb2c32d67fc6f2cabcdd7790e36af63f5..c512b0811af71e01f825746afb89271c51819a90 100644 --- a/atdb/docker-compose-cd.yml +++ b/atdb/docker/docker-compose-dev-cd.yml @@ -34,7 +34,7 @@ services: - "traefik.enable=true" - "traefik.http.routers.atdb-backend.entryPoints=atdb-ldv" - "traefik.http.routers.atdb-backend.service=atdb-backend" - - "traefik.http.routers.atdb-backend.rule=Host(`sdc.astron.nl`) && PathPrefix(`/atdb`)" + - "traefik.http.routers.atdb-backend.rule=Host(`sdc-dev.astron.nl`) && PathPrefix(`/atdb`)" - "traefik.http.services.atdb-backend.loadbalancer.server.port=8000" depends_on: diff --git a/atdb/docker-compose.yml b/atdb/docker/docker-compose-dev.yml similarity index 91% rename from atdb/docker-compose.yml rename to atdb/docker/docker-compose-dev.yml index 7bc5022251d69fd7d4ffdc9c8b886e6fa2177114..0dd72dd8416b712f42401f78396037fdf8165ebf 100644 --- a/atdb/docker-compose.yml +++ b/atdb/docker/docker-compose-dev.yml @@ -40,7 +40,7 @@ services: - "traefik.enable=true" - "traefik.http.routers.atdb-backend.entryPoints=atdb-ldv" - "traefik.http.routers.atdb-backend.service=atdb-backend" - - "traefik.http.routers.atdb-backend.rule=Host(`sdc.astron.nl`) && PathPrefix(`/atdb`)" + - "traefik.http.routers.atdb-backend.rule=Host(`sdc-dev.astron.nl`) && PathPrefix(`/atdb`)" - "traefik.http.services.atdb-backend.loadbalancer.server.port=8000" depends_on: