From e2c0e6052eb476dd6f47e49117d1323daf4fdd57 Mon Sep 17 00:00:00 2001 From: ThanKarab Date: Sun, 22 Sep 2024 15:59:31 +0300 Subject: [PATCH] chore: Minor fixes to update dev deployment setup --- .../portalbackend-integration-tests.yml | 17 ++++++++++------- dev/start.sh | 11 ++++------- dev/test.sh | 5 ----- dev/tests/test_federation_info.py | 2 +- 4 files changed, 15 insertions(+), 20 deletions(-) delete mode 100755 dev/test.sh diff --git a/.github/workflows/portalbackend-integration-tests.yml b/.github/workflows/portalbackend-integration-tests.yml index b82a05a0..41987468 100644 --- a/.github/workflows/portalbackend-integration-tests.yml +++ b/.github/workflows/portalbackend-integration-tests.yml @@ -11,18 +11,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - - name: Install Docker Compose - run: | - sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f 4)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - docker-compose --version + - name: Install docker compose + uses: KengoTODA/actions-setup-docker-compose@v1 + with: + version: '2.30.1' - name: Deploy portalbackend and exareme2 working-directory: ./dev/ @@ -31,6 +30,10 @@ jobs: - name: Get deployment status run: docker ps + - name: Install python dependencies + working-directory: ./dev/ + run: pip install -r requirements.txt + - name: Run the dev tests working-directory: ./dev/ run: pytest -k "not test_federation_info.py" diff --git a/dev/start.sh b/dev/start.sh index 2e6bb42a..be382960 100755 --- a/dev/start.sh +++ b/dev/start.sh @@ -1,19 +1,16 @@ #!/bin/env bash -docker-compose --env-file ../.versions_env down -docker-compose --env-file ../.versions_env up -d - -echo -n "Installing pip requirements ..." -pip install -r requirements.txt +docker compose --env-file ../.versions_env down +docker compose --env-file ../.versions_env up -d echo -n "Waiting for containers to start ..." sleep 10 echo -n "Loading data into exareme2 db ..." docker exec dev-exareme2_global_mipdb-1 mipdb init -docker exec dev-exareme2_local_mipdb-1 /bin/bash -c "mipdb init && mipdb load-folder /opt/data" +docker exec dev-exareme2_local_mipdb_1 /bin/bash -c "mipdb init && mipdb load-folder /opt/data" -sleep 10 +sleep 20 echo -n "Triggering engine to see the added pathologies ..." curl -X POST 172.17.0.1:5000/wla diff --git a/dev/test.sh b/dev/test.sh deleted file mode 100755 index 5dccf476..00000000 --- a/dev/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/env bash - -pytest -k "not test_federation_info.py" tests -pytest tests/test_federation_info.py - diff --git a/dev/tests/test_federation_info.py b/dev/tests/test_federation_info.py index 16bfeefd..f27cb498 100644 --- a/dev/tests/test_federation_info.py +++ b/dev/tests/test_federation_info.py @@ -6,7 +6,7 @@ def test_federation_info(): - cmd = f"docker logs dev-portalbackend-1 | python3 ../federation_info.py show-portal-backend-audit-entries" + cmd = f"docker logs dev-portalbackend_1 | python3 ../federation_info.py show-portal-backend-audit-entries" res = subprocess.run( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )