forked from DIRACGrid/DIRAC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add rucio to the integration_tests.py
- Loading branch information
Showing
5 changed files
with
184 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Should be called with PGPASSWORD=mysecretpassword | ||
|
||
#!/bin/bash | ||
dbMissing=true; | ||
allDBs=(rucio) | ||
while ${dbMissing}; | ||
do | ||
dbMissing=false; | ||
allExistingDBs=$(psql -U postgres -h rucio-db -p 5432 -c "\l"); | ||
for db in "${allDBs[@]}"; | ||
do | ||
if grep -q "${db}" <<< "${allExistingDBs}"; | ||
then | ||
echo "${db} OK"; | ||
else | ||
echo "${db} not created"; | ||
dbMissing=true; | ||
fi; | ||
done; | ||
if ${dbMissing}; | ||
then | ||
sleep 1; | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
# copy user certs to fix permissions | ||
voms-proxy-init -valid 9999:00 -cert /home/user/.globus/usercert.pem -key /home/user/.globus/userkey.pem | ||
|
||
|
||
# add the storage element (xrd) | ||
RSE="STORAGE-1" | ||
rucio rse add --rse-name "STORAGE-1" | ||
rucio rse protocol add \ | ||
--rse-name "${RSE}" \ | ||
--host "rucio-storage-1" \ | ||
--scheme root \ | ||
--prefix //rucio \ | ||
--port 1094 \ | ||
--impl rucio.rse.protocols.gfal.Default \ | ||
--domain-json '{"wan": {"read": 1, "write": 1, "delete": 1, "third_party_copy_read": 1, "third_party_copy_write": 1}, "lan": {"read": 1, "write": 1, "delete": 1}}' \ | ||
|
||
rucio rse attribute add --rse "${RSE}" --key fts --value https://fts:8446 | ||
|
||
# this is for some reason I really don't understand needed by the DIRAC-Rucio integration | ||
rucio rse attribute add --rse "${RSE}" --key ANY --value true | ||
rucio account limit add --account root --rse-exp "${RSE}" --bytes "infinity" | ||
|
||
# add a scope | ||
rucio scope add --account root --scope test | ||
fts-rest-whoami -s https://fts:8446 | ||
fts-rest-delegate -vf -s https://fts:8446 -H 9999 | ||
|
||
# also needed for the DIRAC integration, due to idiosyncrasies of the belle2 code | ||
rucio scope add --account root --scope root | ||
# the root container for the VO already needs to exist | ||
rucio did add --type container -d /testvo.example.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
volumes: | ||
# Volume used to store the certificates | ||
dirac-certificates-store: | ||
# Volume used to store the config of diracx | ||
diracx-cs-store: | ||
# Volume used to store the pair of keys to sign the tokens | ||
diracx-key-store: | ||
# Volume used to store the jwks of the IAM service | ||
diracx-iam-key-store: | ||
# Volume used to store the rucio config | ||
rucio-server-config: | ||
|
||
services: | ||
mysql: | ||
|
@@ -125,12 +129,17 @@ services: | |
volumes: | ||
- diracx-cs-store:/cs_store | ||
- diracx-key-store:/signing-key | ||
- dirac-certificates-store:/etc/DiracCertificates | ||
- dirac-certificates-store:/etc/DiracCA | ||
environment: | ||
- DIRACX_CONFIG_BACKEND_URL=git+file:///cs_store/initialRepo | ||
- DIRACX_SERVICE_AUTH_TOKEN_KEY=file:///signing-key/rs256.key | ||
pull_policy: always | ||
command: ["sleep", "infinity"] # This is necessary because of the issue described in https://github.com/moby/moby/issues/42275. What is added here is a hack/workaround. | ||
|
||
# command: ["sleep", "infinity"] # This is necessary because of the issue described in https://github.com/moby/moby/issues/42275. What is added here is a hack/workaround. | ||
# We need to allow everybody to read the private keys | ||
# Because the users are different between the DIRAC and DiracX containers | ||
entrypoint: | | ||
bash -xc "chmod -R o=u /etc/DiracCertificates && chmod -R o=u /etc/DiracCA" | ||
dirac-client: | ||
image: ${CI_REGISTRY_IMAGE}/${HOST_OS}-dirac | ||
|
@@ -248,3 +257,91 @@ services: | |
retries: 15 | ||
start_period: 60s | ||
pull_policy: always | ||
|
||
### Rucio | ||
|
||
rucio-db: | ||
hostname: rucio-db | ||
image: "postgres:15" | ||
environment: | ||
POSTGRES_USER: rucio | ||
POSTGRES_DB: rucio | ||
POSTGRES_PASSWORD: secret | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] | ||
timeout: 10s | ||
start_period: 30s | ||
pull_policy: always | ||
|
||
rucio-wait-for-db: | ||
image: "postgres:15" | ||
container_name: rucio-wait-for-db | ||
environment: | ||
POSTGRES_USER: rucio | ||
POSTGRES_DB: rucio | ||
PGPASSWORD: secret | ||
depends_on: | ||
rucio-db: | ||
condition: service_healthy | ||
command: /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC/tests/CI/check_rucio_db_initialized.sh | ||
pull_policy: always | ||
|
||
rucio-init: | ||
profiles: | ||
- init | ||
image: rucio/rucio-init:release-36.1.0 | ||
environment: | ||
RUCIO_CFG_DATABASE_DEFAULT: "postgresql://rucio:secret@rucio-db/rucio" | ||
RUCIO_CFG_BOOTSTRAP_USERPASS_IDENTITY: "test-user" | ||
RUCIO_CFG_BOOTSTRAP_USERPASS_PWD: "secret" | ||
RUCIO_CFG_BOOTSTRAP_X509_IDENTITY: "CN=Test User" | ||
RUCIO_CFG_BOOTSTRAP_X509_EMAIL: "[email protected]" | ||
RUCIO_CFG_POLICY_PACKAGE: "dirac_rucio_policy" | ||
RUCIO_CFG_COMMON_EXTRACT_SCOPE: "dirac" | ||
RUCIO_CFG_POLICY_LFN2PFN_ALGORITHM_DEFAULT: "dirac" | ||
PYTHONPATH: /opt/rucio | ||
depends_on: | ||
rucio-db: | ||
condition: service_healthy | ||
volumes: | ||
- rucio-server-config:/opt/rucio/etc/ | ||
- ./rucio_policy:/opt/rucio/dirac_rucio_policy | ||
|
||
rucio-server: | ||
hostname: rucio-server | ||
image: rucio/rucio-server:release-36.1.0 | ||
environment: | ||
RUCIO_ENABLE_SSL: "True" | ||
RUCIO_HTTPD_ENCODED_SLASHES: "True" | ||
RUCIO_HTTPD_GRID_SITE_ENABLED: "True" | ||
depends_on: | ||
dirac-server: | ||
condition: service_started | ||
rucio-db: | ||
condition: service_healthy | ||
rucio-storage-1: | ||
condition: service_started | ||
volumes: | ||
- rucio-server-config:/opt/rucio/etc/ | ||
- dirac-certificates-store:/etc/grid-security | ||
# - ./certs/hostcert_rucio-server.pem:/etc/grid-security/hostcert.pem:z | ||
# - ./certs/hostcert_rucio-server.key.pem:/etc/grid-security/hostkey.pem:z | ||
# - ./certs/test_ca.pem:/etc/grid-security/ca.pem:z | ||
- ${RUCIO_REPOSITORY:-/dev/null}:/src/rucio | ||
|
||
rucio-storage-1: | ||
hostname: rucio-storage-1 | ||
image: rucio/xrootd | ||
environment: | ||
XRDPORT: "1094" | ||
volumes: | ||
- dirac-certificates-store:/etc/grid-security | ||
- dirac-certificates-store:/certs | ||
# - ./certs/test_ca.pem:/etc/grid-security/certificates/37cc428d.0 | ||
# - ./certs/hostcert_rucio-storage-1.pem:/tmp/xrdcert.pem:z | ||
# - ./certs/hostcert_rucio-storage-1.key.pem:/tmp/xrdkey.pem:z | ||
ulimits: | ||
nofile: | ||
soft: 1024 | ||
hard: 2048 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters