Skip to content

Commit ebaeed5

Browse files
sawenzelclaude
andcommitted
Give the tests an AliEn token from the runner host
This lets the AnalysisQC execution reach alice-ccdb.cern.ch, which DPL's CCDB backend refuses to do without a token. - JALIEN_TOKEN_CERT and JALIEN_TOKEN_KEY point at a short-lived token that a root-owned timer mints on the host from a service certificate. - The certificate is never readable by the runner account, only the token. - A new step fails with a clear message when the token is missing or about to expire, instead of letting a DPL device abort mid-workflow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 95112b0 commit ebaeed5

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/sim-tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,28 @@ jobs:
9393
exit 1
9494
}
9595
96+
- name: Check the AliEn token
97+
if: steps.gate.outputs.skip != 'true'
98+
env:
99+
JALIEN_TOKEN_CERT: /run/alien-ci/tokencert.pem
100+
JALIEN_TOKEN_KEY: /run/alien-ci/tokenkey.pem
101+
run: |
102+
set -eu
103+
# DPL's CCDB backend refuses to talk to alice-ccdb.cern.ch without a
104+
# token and aborts the whole device, so check up front rather than
105+
# letting it surface as a confusing task crash deep in a workflow.
106+
for f in "$JALIEN_TOKEN_CERT" "$JALIEN_TOKEN_KEY" ; do
107+
test -r "$f" || {
108+
echo "::error title=No AliEn token::$f is missing or unreadable. On the runner host: systemctl start alien-ci-token.service"
109+
exit 1
110+
}
111+
done
112+
if ! openssl x509 -in "$JALIEN_TOKEN_CERT" -noout -checkend 3600 >/dev/null 2>&1 ; then
113+
echo "::error title=AliEn token expiring::the token expires within the hour. On the runner host: systemctl start alien-ci-token.service"
114+
exit 1
115+
fi
116+
echo "AliEn token valid until $(openssl x509 -in "$JALIEN_TOKEN_CERT" -noout -enddate | cut -d= -f2)"
117+
96118
- name: Resolve the O2PDPSuite tag
97119
id: tag
98120
if: steps.gate.outputs.skip != 'true'
@@ -131,6 +153,13 @@ jobs:
131153
# matters here: anything readable by this account is readable by the
132154
# fork-pull-request code that runs as it.
133155
JALIEN_USER: alien-ci
156+
# DPL's CCDB backend needs a GRID token for alice-ccdb.cern.ch. These
157+
# are *paths* to a short-lived token minted from a service certificate
158+
# by a root-owned timer on the runner host; the certificate itself is
159+
# never readable by this account. Verified that paths work — the same
160+
# variables also accept PEM content, which is what ali-bot passes.
161+
JALIEN_TOKEN_CERT: /run/alien-ci/tokencert.pem
162+
JALIEN_TOKEN_KEY: /run/alien-ci/tokenkey.pem
134163
run: |
135164
set -eu
136165
# Everything after "-c" is joined into one string and re-evaluated

0 commit comments

Comments
 (0)