Skip to content

Commit

Permalink
test: pilot tests with extended pilots
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Apr 29, 2024
1 parent 08c6656 commit 93a6132
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 47 deletions.
34 changes: 34 additions & 0 deletions tests/.dirac-ci-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
config:
DIRAC_CI_SETUP_SCRIPT: DIRAC/tests/Jenkins/dirac_ci.sh
PILOT_INSTALLATION_COMMAND: dirac-pilot.py --modules /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC -M 1 -S dirac-JenkinsSetup -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID=whatever12345 --cert --certLocation=/home/dirac/PilotInstallDIR/etc/grid-security --CVMFS_locations=/home/dirac/PilotInstallDIR -o diracInstallOnly --wnVO=vo --debug
PILOT_JSON: "{
\"timestamp\": \"2023-02-13T14:34:26.725499\",
\"CEs\": {
\"jenkins.cern.ch\": {
\"Site\": \"DIRAC.Jenkins.ch\",
\"GridCEType\": \"TEST-FULL\"
}
},
\"Defaults\": {
\"Pilot\": {
\"RemoteLogging\": \"False\",
\"Version\": \"integration\",
\"Commands\": {
\"TEST-FULL\": \"CheckWorkerNode, InstallDIRAC, ConfigureBasics, RegisterPilot, CheckCECapabilities, CheckWNCapabilities, ConfigureSite, ConfigureArchitecture, ConfigureCPURequirements, LaunchAgent\"
}
}
},
\"vo\": {
\"Pilot\": {
\"CheckVersion\": \"False\",
\"pilotFileServer\": \"should_not_matter\",
\"pilotRepoBranch\": \"should_not_matter\",
\"pilotRepo\": \"https://github.com/should_not_matter/Pilot.git\",
\"GenericPilotGroup\": \"dirac_user\",
\"GenericPilotDN\": \"/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser\",
\"PilotLogLevel\": \"DEBUG\"
}
},
\"ConfigurationServers\": [
\"https://server:9135/Configuration/Server\"
]
}"
PILOT_DOWNLOAD_COMMAND: "git clone --single-branch --branch master https://github.com/DIRACGrid/Pilot.git && mv Pilot/Pilot/*.py . && rm -rf Pilot"

# List of feature variables which must be passed when preparing
required-feature-flags: []
Expand Down
58 changes: 11 additions & 47 deletions tests/CI/run_pilot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,25 @@ set -eo pipefail
# IFS=$'\n\t'
set -x

TESTCODE=$PWD/LocalRepo/ALTERNATIVE_MODULES/
PILOTINSTALLDIR=$PWD/PilotInstallDIR/
# Install jq
# if ! command -v jq &> /dev/null
# then
# sudo yum install -y jq
# fi

source CONFIG

# Creating "the worker node"
cd "${PILOTINSTALLDIR}"
cd /home/dirac/PilotInstallDIR
mkdir -p etc/grid-security/vomsdir
mkdir -p etc/grid-security/vomses
touch etc/grid-security/vomsdir/vomsdir
touch etc/grid-security/vomses/vomses

# Get the pilot code
git clone --single-branch -b master https://github.com/DIRACGrid/Pilot.git
mv Pilot/Pilot/*.py .
rm -rf Pilot
eval "${PILOT_DOWNLOAD_COMMAND}"

# shellcheck disable=SC2034
CSURL=https://$SERVER_HOST:9135/Configuration/Server

echo "
{
\"timestamp\": \"2023-02-13T14:34:26.725499\",
\"CEs\": {
\"jenkins.cern.ch\": {
\"Site\": \"DIRAC.Jenkins.ch\",
\"GridCEType\": \"TEST-FULL\"
}
},
\"Defaults\": {
\"Pilot\": {
\"RemoteLogging\": \"False\",
\"Version\": \"integration\",
\"Commands\": {
\"TEST-FULL\": \"CheckWorkerNode, InstallDIRAC, ConfigureBasics, RegisterPilot, CheckCECapabilities, CheckWNCapabilities, ConfigureSite, ConfigureArchitecture, ConfigureCPURequirements, LaunchAgent\"
}
}
},
\"vo\": {
\"Pilot\": {
\"CheckVersion\": \"False\",
\"pilotFileServer\": \"should_not_matter\",
\"pilotRepoBranch\": \"should_not_matter\",
\"pilotRepo\": \"https://github.com/should_not_matter/Pilot.git\",
\"GenericPilotGroup\": \"dirac_user\",
\"GenericPilotDN\": \"/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser\",
\"PilotLogLevel\": \"DEBUG\"
}
},
\"ConfigurationServers\": [
\"${CSURL}\"
]
}
" > pilot.json
# echo "${PILOT_JSON}" | jq . > pilot.json
echo "${PILOT_JSON}" > pilot.json

if command -v python &> /dev/null; then
py='python'
Expand All @@ -71,7 +36,6 @@ elif command -v python2 &> /dev/null; then
py='python2'
fi

pilotUUID="${GITHUB_JOB//-/}""$(shuf -i 2000-65000 -n 1)"
pilotUUID=$(echo "$pilotUUID" | rev | cut -c 1-32 | rev)
more pilot.json

$py dirac-pilot.py --modules "${TESTCODE}/DIRAC" -M 1 -S dirac-JenkinsSetup -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID="${pilotUUID}" --cert --certLocation="${PILOTINSTALLDIR}"/etc/grid-security --CVMFS_locations="${PILOTINSTALLDIR}" -o diracInstallOnly --wnVO=vo --debug
$py "${PILOT_INSTALLATION_COMMAND}"

0 comments on commit 93a6132

Please sign in to comment.