From 97640406d8e860a01bfd6e157aaaed155f963b4b Mon Sep 17 00:00:00 2001 From: Enrique Garcia <40355845+garciagenrique@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:19:59 +0100 Subject: [PATCH] Improve output iam-rucio-sync output (#291) * trigger build of image for debug iam-sync * trigger creation of the image via the branch * return to normal CI behavious and add the new image for the cronjob --- containers/iam-rucio-sync/sync_iam_rucio.py | 1 + .../cluster/flux/rucio/rucio-cronjobs.yaml | 20 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/containers/iam-rucio-sync/sync_iam_rucio.py b/containers/iam-rucio-sync/sync_iam_rucio.py index 2443bf73..c93aae6a 100644 --- a/containers/iam-rucio-sync/sync_iam_rucio.py +++ b/containers/iam-rucio-sync/sync_iam_rucio.py @@ -281,6 +281,7 @@ def make_gridmap_compatible(self, certificate): # get all users from IAM iam_users = syncer.get_list_of_users(access_token) + logging.info(f"Syncing {len(iam_users)} users retrieved from IAM.") # DEBUG user output to file if debug: diff --git a/infrastructure/cluster/flux/rucio/rucio-cronjobs.yaml b/infrastructure/cluster/flux/rucio/rucio-cronjobs.yaml index 21b1a82a..f79e8191 100644 --- a/infrastructure/cluster/flux/rucio/rucio-cronjobs.yaml +++ b/infrastructure/cluster/flux/rucio/rucio-cronjobs.yaml @@ -15,12 +15,7 @@ spec: restartPolicy: OnFailure containers: - name: iam-sync - image: ghcr.io/vre-hub/vre-iam-rucio-sync:v1.0.0-rc.2 - volumeMounts: - - name: rucio-cfg - mountPath: /opt/rucio/etc/ - - name: daemons-rucio-x509up - mountPath: /tmp/ + image: ghcr.io/vre-hub/vre-iam-rucio-sync:v1.0.0-rc.2-82-aea1b65 env: - name: IAM_SERVER value: "https://iam-escape.cloud.cnaf.infn.it/" @@ -34,22 +29,17 @@ spec: secretKeyRef: name: rucio-admin-iam-client key: admin-client_id + # For clarity/completeness the client_id value is can be passed via a secret/env var, + # but it is already passed as a value within the `iam-sync.conf` file. tty: true imagePullPolicy: Always command: - /bin/sh - -c - - date; echo Hello from iam-rucio-sync container; - pwd; ls;rucio whoami; + - date; echo '* Hello from iam-rucio-sync container *'; + pwd; ls; echo $IAM_SERVER; echo $IAM_CLIENT_ID; echo $IAM_CLIENT_SECRET; python3 /home/sync_iam_rucio.py; echo '* Sync to IAM * Done!' - volumes: - - name: rucio-cfg - secret: - secretName: escape-service-account - - name: daemons-rucio-x509up - secret: - secretName: daemons-rucio-x509up # --- # apiVersion: batch/v1 # kind: CronJob