File tree Expand file tree Collapse file tree 5 files changed +64
-4
lines changed Expand file tree Collapse file tree 5 files changed +64
-4
lines changed Original file line number Diff line number Diff line change 62
62
- name : Building wheels
63
63
run : |
64
64
# Clone diracx
65
- git clone --single-branch --branch robin-pilot-management https://github.com/Robin-Van-de-Merghel/diracx.git $GITHUB_WORKSPACE/diracx
65
+ git clone --single-branch --branch robin-pilot-registrations https://github.com/Robin-Van-de-Merghel/diracx.git $GITHUB_WORKSPACE/diracx
66
66
67
67
# Create dist dir
68
68
mkdir -p $GITHUB_WORKSPACE/diracx-dist
Original file line number Diff line number Diff line change 4
4
CLIENT_UPLOAD_BASE64 : SSBsaWtlIHBpenphIQo=
5
5
CLIENT_UPLOAD_LFN : LFN:/vo/test_lfn.txt
6
6
CLIENT_UPLOAD_FILE : test_lfn.txt
7
- PILOT_INSTALLATION_COMMAND : dirac-pilot.py --modules /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC -M 2 -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID=whatever12345 --CVMFS_locations=/home/dirac/ -o diracInstallOnly --wnVO=vo --debug
7
+ PILOT_INSTALLATION_COMMAND : dirac-pilot.py --modules /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC -M 2 -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID=whatever12345 --CVMFS_locations=/home/dirac/ -o diracInstallOnly --wnVO=vo --debug --diracx_URL=http://diracx:8000 --clientID=072afab5-ed92-46e0-a61d-4ecbc96e0770
8
8
PILOT_JSON : " {
9
9
\" timestamp\" : \" 2023-02-13T14:34:26.725499\" ,
10
10
\" CEs\" : {
@@ -37,7 +37,7 @@ config:
37
37
\" https://server:9135/Configuration/Server\"
38
38
]
39
39
}"
40
- PILOT_DOWNLOAD_COMMAND : " git clone --single-branch --branch master https://github.com/DIRACGrid /Pilot.git && mv Pilot/Pilot/*.py . && rm -rf Pilot"
40
+ PILOT_DOWNLOAD_COMMAND : " git clone --single-branch --branch adding-jwt-support https://github.com/Robin-Van-de-Merghel /Pilot.git && mv Pilot/Pilot/*.py . && rm -rf Pilot"
41
41
42
42
# List of feature variables which must be passed when preparing
43
43
required-feature-flags : []
Original file line number Diff line number Diff line change @@ -94,4 +94,14 @@ if [[ -z "${INSTALLATION_BRANCH}" ]]; then
94
94
echo " JobName = \" ${GITHUB_JOB} _$( date +" %Y-%m-%d_%T" | sed ' s/://g' ) \" " >> test_dl.jdl
95
95
echo " ]" >> test_dl.jdl
96
96
dirac-wms-job-submit test_dl.jdl " ${DEBUG} " | & tee -a clientTestOutputs.txt
97
+
98
+ # -------------------------------------------------------------------------------#
99
+ if [[ " ${TEST_DIRACX:- } " = " Yes" ]]; then
100
+ echo -e " *** $( date -u) **** Creates DiracX credentials to run commands ****\n"
101
+ installDIRACX cli
102
+ setDiracXCreds prod
103
+ # Generate secrets
104
+ secret=$( dirac pilots generate-pilot-secrets vo 1 | jq -r ' .[0].pilot_secret' )
105
+ echo " $secret " > /ca/certs/pilot_secret.txt
106
+ fi
97
107
fi
Original file line number Diff line number Diff line change @@ -42,5 +42,13 @@ elif command -v python2 &> /dev/null; then
42
42
py=' python2'
43
43
fi
44
44
45
+ additional_params=" "
46
+
47
+ if [[ -n " $TEST_DIRACX " && " $TEST_DIRACX " == " Yes" ]]; then
48
+ # Read the pilot secret from file
49
+ secret=$( cat /ca/certs/pilot_secret.txt)
50
+ additional_params=" --pilotSecret $secret "
51
+ fi
52
+
45
53
# shellcheck disable=SC2086
46
- $py ${PILOT_INSTALLATION_COMMAND}
54
+ $py ${PILOT_INSTALLATION_COMMAND} ${additional_params}
Original file line number Diff line number Diff line change @@ -729,3 +729,45 @@ stopRunsv() {
729
729
730
730
echo ' ==> [Done stopRunsv]'
731
731
}
732
+
733
+
734
+
735
+ # .............................................................................
736
+ #
737
+ # setDiracXCreds
738
+ #
739
+ # gets creds from x509, extract token, and put it in the right place
740
+ #
741
+ # .............................................................................
742
+ setDiracXCreds () {
743
+ # $1 = DIRAC group
744
+ local group=" $1 "
745
+ local cache_dir=" $HOME /.cache/diracx"
746
+ local creds_file=" $cache_dir /credentials.json"
747
+ local tmpfile
748
+
749
+ if [[ -z " $group " ]]; then
750
+ echo " Usage: setDiracXCreds <DIRAC_GROUP>" >&2
751
+ return 1
752
+ fi
753
+
754
+ # 1. Init DIRAC proxy
755
+ dirac-proxy-init -g " $group "
756
+
757
+ # 2. Extract DiracX token from proxy PEM
758
+ tmpfile=$( mktemp)
759
+ python - << 'EOF ' > "$tmpfile"
760
+ from DIRAC.Core.Security.DiracX import diracxTokenFromPEM
761
+ from DIRAC.Core.Security.Locations import getProxyLocation
762
+ import json
763
+ pem_location = getProxyLocation()
764
+ token = diracxTokenFromPEM(pem_location)
765
+ if token:
766
+ print(json.dumps(token))
767
+ EOF
768
+
769
+ # 3. Move to ~/.cache/diracx/credentials.json
770
+ mkdir -p " $cache_dir "
771
+ mv " $tmpfile " " $creds_file "
772
+ echo " DiracX credentials updated at $creds_file "
773
+ }
You can’t perform that action at this time.
0 commit comments