Skip to content

Commit

Permalink
Move to docker compose v. 2
Browse files Browse the repository at this point in the history
V. 1 (docker-compose) is not available anymore in gh actions.
  • Loading branch information
giacomini committed Apr 2, 2024
1 parent b77bb5a commit eb0c261
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ jobs:
uses: actions/checkout@v4

- name: Provide trustanchors
run: docker-compose --file docker-compose.ci.yml up trust
run: docker compose --file docker-compose.ci.yml up trust
working-directory: compose

- name: Start compose
run: docker-compose --file docker-compose.ci.yml up --detach db voms testsuite
run: docker compose --file docker-compose.ci.yml up --detach db voms testsuite
working-directory: compose
env:
TS_IMAGE: italiangrid/voms-testsuite:centos${{ matrix.client }}
VOMS_IMAGE: italiangrid/voms:centos${{ matrix.server }}

- name: Deploy db and voms
run: |
docker-compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
docker-compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
docker compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
docker compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
working-directory: compose

- name: Create artifacts dir
Expand All @@ -121,24 +121,24 @@ jobs:
- name: Enable legacy OpenSSL crypto policies on EL9
if: matrix.client == '9-beta'
run: docker-compose --file docker-compose.ci.yml exec testsuite bash -c "sudo update-crypto-policies --set LEGACY"
run: docker compose --file docker-compose.ci.yml exec testsuite bash -c "sudo update-crypto-policies --set LEGACY"

- name: Run testsuite for java clients
run: docker-compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
run: docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
working-directory: compose
continue-on-error: true

- name: Collect test report for java clients
if: ${{ always() }}
run: |
docker container cp voms-testsuite_testsuite_1:/tmp/reports ${ARTIFACTS_PATH}/java
docker-compose --file docker-compose.ci.yml exec -T testsuite rm -rf /tmp/reports
docker compose --file docker-compose.ci.yml exec -T testsuite rm -rf /tmp/reports
working-directory: compose

- name: Run testsuite for cpp clients
run: |
docker-compose --file docker-compose.ci.yml exec -T -u root testsuite bash -c "update-alternatives --set voms-proxy-init /usr/bin/voms-proxy-init2; update-alternatives --set voms-proxy-info /usr/bin/voms-proxy-info2; update-alternatives --set voms-proxy-destroy /usr/bin/voms-proxy-destroy2"
docker-compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh --variable client_version:2 --include legacy
docker compose --file docker-compose.ci.yml exec -T -u root testsuite bash -c "update-alternatives --set voms-proxy-init /usr/bin/voms-proxy-init2; update-alternatives --set voms-proxy-info /usr/bin/voms-proxy-info2; update-alternatives --set voms-proxy-destroy /usr/bin/voms-proxy-destroy2"
docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh --variable client_version:2 --include legacy
working-directory: compose
continue-on-error: true

Expand All @@ -150,13 +150,13 @@ jobs:
- name: Collect logs
if: ${{ always() }}
run: |
docker-compose --file docker-compose.ci.yml logs --no-color testsuite > ${ARTIFACTS_PATH}/logs/testsuite.log
docker-compose --file docker-compose.ci.yml logs --no-color voms > ${ARTIFACTS_PATH}/logs/voms.log
docker compose --file docker-compose.ci.yml logs --no-color testsuite > ${ARTIFACTS_PATH}/logs/testsuite.log
docker compose --file docker-compose.ci.yml logs --no-color voms > ${ARTIFACTS_PATH}/logs/voms.log
working-directory: compose

- name: Stop compose
if: ${{ always() }}
run: docker-compose --file docker-compose.ci.yml down --volumes
run: docker compose --file docker-compose.ci.yml down --volumes
working-directory: compose

- name: Upload artifacts
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/iam-dev.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
uses: actions/checkout@v4

- name: Provide trustanchors
run: docker-compose --file docker-compose.ci.yml up trust
run: docker compose --file docker-compose.ci.yml up trust
working-directory: compose

- name: Start compose
run: docker-compose --file docker-compose.ci.yml up --detach db voms testsuite
run: docker compose --file docker-compose.ci.yml up --detach db voms testsuite
working-directory: compose
env:
TS_IMAGE: italiangrid/voms-testsuite:centos${{ matrix.client }}
VOMS_IMAGE: italiangrid/voms:centos7-stable

- name: Deploy db and voms
run: |
docker-compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
docker-compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
docker compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
docker compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
working-directory: compose

- name: Create artifacts dir
Expand All @@ -49,21 +49,21 @@ jobs:
mkdir -p ${ARTIFACTS_PATH}/logs ${ARTIFACTS_PATH}/java ${ARTIFACTS_PATH}/cpp
- name: Run testsuite for java clients
run: docker-compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
run: docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
working-directory: compose
continue-on-error: true

- name: Collect test report for java clients
if: ${{ always() }}
run: |
docker container cp voms-testsuite_testsuite_1:/tmp/reports ${ARTIFACTS_PATH}/java
docker-compose --file docker-compose.ci.yml exec -T testsuite rm -rf /tmp/reports
docker compose --file docker-compose.ci.yml exec -T testsuite rm -rf /tmp/reports
working-directory: compose

- name: Run testsuite for cpp clients
run: |
docker-compose --file docker-compose.ci.yml exec -T -u root testsuite bash -c "update-alternatives --set voms-proxy-init /usr/bin/voms-proxy-init2; update-alternatives --set voms-proxy-info /usr/bin/voms-proxy-info2; update-alternatives --set voms-proxy-destroy /usr/bin/voms-proxy-destroy2"
docker-compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh --variable client_version:2 --include legacy
docker compose --file docker-compose.ci.yml exec -T -u root testsuite bash -c "update-alternatives --set voms-proxy-init /usr/bin/voms-proxy-init2; update-alternatives --set voms-proxy-info /usr/bin/voms-proxy-info2; update-alternatives --set voms-proxy-destroy /usr/bin/voms-proxy-destroy2"
docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh --variable client_version:2 --include legacy
working-directory: compose
continue-on-error: true

Expand All @@ -75,13 +75,13 @@ jobs:
- name: Collect logs
if: ${{ always() }}
run: |
docker-compose --file docker-compose.ci.yml logs --no-color testsuite > ${ARTIFACTS_PATH}/logs/testsuite.log
docker-compose --file docker-compose.ci.yml logs --no-color voms > ${ARTIFACTS_PATH}/logs/voms.log
docker compose --file docker-compose.ci.yml logs --no-color testsuite > ${ARTIFACTS_PATH}/logs/testsuite.log
docker compose --file docker-compose.ci.yml logs --no-color voms > ${ARTIFACTS_PATH}/logs/voms.log
working-directory: compose

- name: Stop compose
if: ${{ always() }}
run: docker-compose --file docker-compose.ci.yml down --volumes
run: docker compose --file docker-compose.ci.yml down --volumes
working-directory: compose

- name: Upload artifacts
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ Use the `italiangrid/voms-testsuite` docker image to run the testsuite.
For other parameters, see the [variables file](./lib/variables.robot).


### Using docker-compose
### Using docker compose

A [docker-compose](./compose/docker-compose.ci.yml) file collecting all the necessary services can be used to run the testsuite.
A [docker compose](./compose/docker-compose.ci.yml) file collecting all the necessary services can be used to run the testsuite.

#### Tests using local VOMS server

Start the trustanchor job with

```
$ cd compose
$ docker-compose --file docker-compose.ci.yml up trust
$ docker compose --file docker-compose.ci.yml up trust
trust_1 | + FETCH_CRL_TIMEOUT_SECS=5
trust_1 | + [[ -z 1 ]]
trust_1 | + fetch-crl --verbose -T 5
Expand All @@ -51,21 +51,21 @@ voms-testsuite_trust_1 exited with code 0
Start the db, VOMS and testsuite containers

```
$ docker-compose --file docker-compose.ci.yml up --detach db voms testsuite
$ docker compose --file docker-compose.ci.yml up --detach db voms testsuite
```

Populate the VOMS DB with a dbdump for testing and start VOMS

```
$ docker-compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
$ docker-compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
$ docker compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
$ docker compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
```

Run the testsuite. Some variables will be overridden using the `ROBOT_OPTIONS` environment variable

```
$ export ROBOT_OPTIONS="--variable vo1:vo.0 --variable vo1_host:voms.test.example --variable vo1_issuer:/C=IT/O=IGI/CN=*.test.example --variable vo2:vo.1 --variable vo2_host:voms.test.example --variable vo2_issuer:/C=IT/O=IGI/CN=*.test.example"
$ docker-compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
$ docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
```

#### Tests using the VOMS-AA microservice
Expand All @@ -74,7 +74,7 @@ Start the trustanchor job with

```
$ cd compose
$ docker-compose --file docker-compose.ci.yml up trust
$ docker compose --file docker-compose.ci.yml up trust
trust_1 | + FETCH_CRL_TIMEOUT_SECS=5
trust_1 | + [[ -z 1 ]]
trust_1 | + fetch-crl --verbose -T 5
Expand All @@ -87,14 +87,14 @@ voms-testsuite_trust_1 exited with code 0
Start the testsuite container

```
$ docker-compose --file docker-compose.ci.yml up --detach testsuite
$ docker compose --file docker-compose.ci.yml up --detach testsuite
```

Run the testsuite. Some variables will be overridden using the `ROBOT_OPTIONS` environment variable

```
$ export ROBOT_OPTIONS="--variable vo1:test.vo --variable vo1_host:voms-dev.cloud.cnaf.infn.it --variable vo1_issuer:'/DC=org/DC=terena/DC=tcs/C=IT/ST=Roma/O=Istituto Nazionale di Fisica Nucleare/CN=voms-dev.cloud.cnaf.infn.it' --variable vo1_legacy_fqan_enabled:False --variable vo2:vo.1 --variable vo2_host:voms.test.example --variable vo2_issuer:/C=IT/O=IGI/CN=*.test.example"
$ docker-compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
$ docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
```

[robot-framework]: https://robotframework.org/

0 comments on commit eb0c261

Please sign in to comment.