From 94cedc2bd30a293af991acb46cc990bae4baf835 Mon Sep 17 00:00:00 2001 From: Francesco Giacomini Date: Fri, 12 Apr 2024 18:04:26 +0200 Subject: [PATCH] New compose file suitable to develop VOMS The idea is to have a service for each platform, client and server, which mounts the source read-only. The build can then be done off-source and installed locally. --- compose/assets/dev-scripts/prepare-dev-env.sh | 16 +++ compose/docker-compose.dev.yml | 109 +++++++++++++++--- 2 files changed, 109 insertions(+), 16 deletions(-) create mode 100755 compose/assets/dev-scripts/prepare-dev-env.sh diff --git a/compose/assets/dev-scripts/prepare-dev-env.sh b/compose/assets/dev-scripts/prepare-dev-env.sh new file mode 100755 index 0000000..e025bf5 --- /dev/null +++ b/compose/assets/dev-scripts/prepare-dev-env.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ -z "${VOMS_SRC}" ]; then + echo "Set the VOMS_SRC environment variable to point to the VOMS sources. Exiting..." + exit 1 +fi + +docker compose -f compose/docker-compose.dev.yml up -d + +uid=$(id -u) +gid=$(id -g) + +for service in testsuite voms-7-stable voms-7-beta voms-9-beta; do + docker compose -f compose/docker-compose.dev.yml exec $service sudo groupmod -g ${gid} test + docker compose -f compose/docker-compose.dev.yml exec $service sudo usermod -u ${uid} test +done diff --git a/compose/docker-compose.dev.yml b/compose/docker-compose.dev.yml index c308197..1333790 100644 --- a/compose/docker-compose.dev.yml +++ b/compose/docker-compose.dev.yml @@ -1,31 +1,108 @@ -version: '3.5' - volumes: - vscode-server: - dotlocal: + trustanchors: + cabundle: + voms-src: + driver: local + driver_opts: + o: bind + type: none + device: ${VOMS_SRC} services: - testsuite-init: - image: italiangrid/voms-testsuite-centos7 + + db: + image: mariadb:10.11.2 + init: true + + volumes: + - ./assets/db:/home/mysql/ + - ./assets/scripts:/scripts/ + + environment: + - MYSQL_ROOT_PASSWORD=pwd + - MYSQL_USER=user + - MYSQL_PASSWORD=pwd + + voms-7-stable: + image: italiangrid/voms:centos7-stable + init: true + + environment: + - TZ=Europe/Rome + + volumes: + - ./assets/scripts:/scripts + - ./assets/vomsdir/:/etc/grid-security/vomsdir + - ./assets/conf/vo0.conf:/etc/voms/vo.0/voms.conf + - ./assets/conf/vo1.conf:/etc/voms/vo.1/voms.conf + - voms-src:/voms-src:ro + + command: ["sleep", "infinity"] + + privileged: true + + networks: + default: + aliases: + - voms-7-stable.test.example + + voms-7-beta: + image: italiangrid/voms:centos7-beta + init: true + + environment: + - TZ=Europe/Rome + volumes: - - vscode-server:/home/test/.vscode-server - - dotlocal:/home/test/.local - command: sudo chown -R test:test /home/test/.vscode-server /home/test/.local + - ./assets/scripts:/scripts + - ./assets/vomsdir/:/etc/grid-security/vomsdir + - ./assets/conf/vo0.conf:/etc/voms/vo.0/voms.conf + - ./assets/conf/vo1.conf:/etc/voms/vo.1/voms.conf + - voms-src:/voms-src:ro + + command: ["sleep", "infinity"] + + privileged: true + + networks: + default: + aliases: + - voms-7-beta.test.example + + voms-9-beta: + image: italiangrid/voms:centos9-beta + init: true + + environment: + - TZ=Europe/Rome + + volumes: + - ..:/voms-testsuite + - ./assets/scripts:/scripts + - ./assets/vomsdir/:/etc/grid-security/vomsdir + - ./assets/conf/vo0.conf:/etc/voms/vo.0/voms.conf + - ./assets/conf/vo1.conf:/etc/voms/vo.1/voms.conf + - voms-src:/voms-src:ro + + command: ["sleep", "infinity"] + + privileged: true + + networks: + default: + aliases: + - voms-9-beta.test.example testsuite: image: italiangrid/voms-testsuite-centos7 - - depends_on: - - testsuite-init + init: true environment: - TZ=Europe/Rome - - X509_USER_PROXY=/tmp/x509up_u501 volumes: - - vscode-server:/home/test/.vscode-server - - dotlocal:/home/test/.local - - ..:/home/test/voms-testsuite:cached + - ..:/voms-testsuite + - voms-src:/voms-src:ro - ./assets/vomses:/etc/vomses - ./assets/vomsdir:/etc/grid-security/vomsdir