diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4d26bc42ba1..ccf1c592b2a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -4,18 +4,18 @@ on: push: paths-ignore: # Docs - - 'docs/**' - - 'README.rst' + - "docs/**" + - "README.rst" # When push new release - - 'release.notes' - - 'src/DIRAC/__init__.py' # It is expected that only the version number will change here - - 'releases.cfg' + - "release.notes" + - "src/DIRAC/__init__.py" # It is expected that only the version number will change here + - "releases.cfg" pull_request: paths-ignore: # RPs with docs - - 'docs/**' - - 'README.rst' - - 'release.notes' + - "docs/**" + - "README.rst" + - "release.notes" jobs: Integration: @@ -36,63 +36,63 @@ jobs: - TEST_NAME: "Force DEncode and MySQL8" ARGS: DIRAC_USE_JSON_ENCODE=NO MYSQL_VER=mysql:8.0.40 - TEST_NAME: "Backward Compatibility" - ARGS: CLIENT_INSTALLATION_BRANCH=rel-v8r0 PILOT_INSTALLATION_BRANCH=rel-v8r0 + ARGS: CLIENT_INSTALLATION_BRANCH=rel-v9r0 PILOT_INSTALLATION_BRANCH=rel-v9r0 - TEST_NAME: "Test DiracX latest" ARGS: TEST_DIRACX=Yes steps: - - uses: actions/checkout@v4 - - name: Fail-fast for outdated pipelines - run: .github/workflows/fail-fast.sh - - run: | - git fetch --prune --unshallow - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - uses: cvmfs-contrib/github-action-cvmfs@v5 - - name: Installing dependencies - run: | - python -m pip install \ - gitpython \ - packaging \ - pyyaml \ - requests \ - typer - - name: Prepare environment - run: ./integration_tests.py prepare-environment ${{ matrix.ARGS }} - - name: Install server - run: ./integration_tests.py install-server - - name: Install client - run: ./integration_tests.py install-client - - name: Install pilot - run: ./integration_tests.py install-pilot - - name: Server tests - run: ./integration_tests.py test-server || touch server-tests-failed - - name: Client tests - run: ./integration_tests.py test-client || touch client-tests-failed - - name: Pilot tests - run: ./integration_tests.py test-pilot || touch pilot-tests-failed - - name: Opensearch logs - run: docker logs opensearch - - name: Check test status - run: | - has_error=0 - if [ -f server-tests-failed ]; then has_error=1; echo "Server tests failed"; fi - if [ -f client-tests-failed ]; then has_error=1; echo "Client tests failed"; fi - if [ -f pilot-tests-failed ]; then has_error=1; echo "pilot tests failed"; fi - if [ ${has_error} = 1 ]; then exit 1; fi - - name: diracx filtered requests logs - if: contains(matrix.ARGS, 'TEST_DIRACX=Yes') - run: | - docker logs diracx 2>/dev/null | grep '/api/' \ - | awk -F\" '{print $2, $3}' \ - | awk '{print $1, $2, $4}' \ - | sort | uniq -c | sort + - uses: actions/checkout@v4 + - name: Fail-fast for outdated pipelines + run: .github/workflows/fail-fast.sh + - run: | + git fetch --prune --unshallow + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - uses: cvmfs-contrib/github-action-cvmfs@v5 + - name: Installing dependencies + run: | + python -m pip install \ + gitpython \ + packaging \ + pyyaml \ + requests \ + typer + - name: Prepare environment + run: ./integration_tests.py prepare-environment ${{ matrix.ARGS }} + - name: Install server + run: ./integration_tests.py install-server + - name: Install client + run: ./integration_tests.py install-client + - name: Install pilot + run: ./integration_tests.py install-pilot + - name: Server tests + run: ./integration_tests.py test-server || touch server-tests-failed + - name: Client tests + run: ./integration_tests.py test-client || touch client-tests-failed + - name: Pilot tests + run: ./integration_tests.py test-pilot || touch pilot-tests-failed + - name: Opensearch logs + run: docker logs opensearch + - name: Check test status + run: | + has_error=0 + if [ -f server-tests-failed ]; then has_error=1; echo "Server tests failed"; fi + if [ -f client-tests-failed ]; then has_error=1; echo "Client tests failed"; fi + if [ -f pilot-tests-failed ]; then has_error=1; echo "pilot tests failed"; fi + if [ ${has_error} = 1 ]; then exit 1; fi + - name: diracx filtered requests logs + if: contains(matrix.ARGS, 'TEST_DIRACX=Yes') + run: | + docker logs diracx 2>/dev/null | grep '/api/' \ + | awk -F\" '{print $2, $3}' \ + | awk '{print $1, $2, $4}' \ + | sort | uniq -c | sort - - name: diracx error logs - if: ${{ failure() && contains(matrix.ARGS, 'TEST_DIRACX=Yes') }} - run: | - mkdir -p /tmp/service-logs - docker logs diracx 2>&1 | tee /tmp/service-logs/diracx.log - cd /tmp/DIRACRepo - ./integration_tests.py logs --no-follow --lines 1000 2>&1 | tee /tmp/service-logs/dirac.log + - name: diracx error logs + if: ${{ failure() && contains(matrix.ARGS, 'TEST_DIRACX=Yes') }} + run: | + mkdir -p /tmp/service-logs + docker logs diracx 2>&1 | tee /tmp/service-logs/diracx.log + cd /tmp/DIRACRepo + ./integration_tests.py logs --no-follow --lines 1000 2>&1 | tee /tmp/service-logs/dirac.log diff --git a/integration_tests.py b/integration_tests.py index f46b8c7c5b6..ffb1ecf9f98 100755 --- a/integration_tests.py +++ b/integration_tests.py @@ -128,7 +128,7 @@ def list_commands(self, ctx): MYSQL_VER: {DEFAULT_MYSQL_VER!r} ES_VER: {DEFAULT_ES_VER!r} IAM_VER: {DEFAULT_IAM_VER!r} - {(os.linesep + ' ').join(['%s: %r' % x for x in FEATURE_VARIABLES.items()])} + {(os.linesep + " ").join(["%s: %r" % x for x in FEATURE_VARIABLES.items()])} All features can be prefixed with "SERVER_" or "CLIENT_" to limit their scope. @@ -738,7 +738,7 @@ def _check_containers_running(*, is_up=True): def _find_dirac_release(): # Start by looking for the GitHub/GitLab environment variables - if "GITHUB_BASE_REF" in os.environ: # this will be "rel-v8r0" + if "GITHUB_BASE_REF" in os.environ: # this will be "rel-v9r0" return os.environ["GITHUB_BASE_REF"] if "CI_COMMIT_REF_NAME" in os.environ: return os.environ["CI_COMMIT_REF_NAME"] diff --git a/tests/CI/install_client.sh b/tests/CI/install_client.sh index 324902c4868..4313f29dcd6 100755 --- a/tests/CI/install_client.sh +++ b/tests/CI/install_client.sh @@ -27,25 +27,25 @@ mkdir -p "$PWD/TestCode" cd "$PWD/TestCode" if [[ -n "${INSTALLATION_BRANCH}" ]]; then - # Use this for (e.g.) running backward-compatibility tests - echo "Using https://github.com/DIRACGrid/DIRAC.git@${INSTALLATION_BRANCH} for the tests" - git clone --single-branch --branch "$INSTALLATION_BRANCH" "https://github.com/DIRACGrid/DIRAC.git" - mkdir -p /home/dirac/ServerInstallDIR/user - cd /home/dirac/ServerInstallDIR/user - ln -s "${HOME}/.globus/usercert.pem" client.pem - ln -s "${HOME}/.globus/userkey.pem" client.key + # Use this for (e.g.) running backward-compatibility tests + echo "Using https://github.com/DIRACGrid/DIRAC.git@${INSTALLATION_BRANCH} for the tests" + git clone --single-branch --branch "$INSTALLATION_BRANCH" "https://github.com/DIRACGrid/DIRAC.git" + mkdir -p /home/dirac/ServerInstallDIR/user + cd /home/dirac/ServerInstallDIR/user + ln -s "${HOME}/.globus/usercert.pem" client.pem + ln -s "${HOME}/.globus/userkey.pem" client.key else - for repo_path in "${TESTREPO[@]}"; do - if [[ -d "${repo_path}" ]]; then - cp -r "${repo_path}" "$(basename "${repo_path}")" - cd "$(basename "${repo_path}")" - echo "Using local test repository in branch $(git branch | grep "\*" | sed -e "s/* //")" - cd - - else - git clone --single-branch --branch "$TESTBRANCH" "https://github.com/$repo_path/DIRAC.git" - echo "Using remote test repository ${repo_path} in branch ${TESTBRANCH}" - fi - done + for repo_path in "${TESTREPO[@]}"; do + if [[ -d "${repo_path}" ]]; then + cp -r "${repo_path}" "$(basename "${repo_path}")" + cd "$(basename "${repo_path}")" + echo "Using local test repository in branch $(git branch | grep "\*" | sed -e "s/* //")" + cd - + else + git clone --single-branch --branch "$TESTBRANCH" "https://github.com/$repo_path/DIRAC.git" + echo "Using remote test repository ${repo_path} in branch ${TESTBRANCH}" + fi + done fi cd .. @@ -54,44 +54,39 @@ echo -e "*** $(date -u) **** Got the DIRAC tests ****\n" source "${DIRAC_CI_SETUP_SCRIPT}" -if [[ -n "${INSTALLATION_BRANCH}" ]]; then - # shellcheck disable=SC2034 - DIRACSETUP=$(< "${INSTALL_CFG_FILE}" grep "Setup = " | cut -f5 -d " ") -fi - echo -e "*** $(date -u) **** Client INSTALLATION START ****\n" installDIRAC if [[ -z "${INSTALLATION_BRANCH}" ]]; then - echo 'Generate a pilot proxy, to be used by the pilot' - dirac-proxy-init -g pilot -C /ca/certs/pilot.pem -K /ca/certs/pilot.key "${DEBUG}" - mv /tmp/x509up_u$UID /ca/certs/pilot_proxy + echo 'Generate a pilot proxy, to be used by the pilot' + dirac-proxy-init -g pilot -C /ca/certs/pilot.pem -K /ca/certs/pilot.key "${DEBUG}" + mv /tmp/x509up_u$UID /ca/certs/pilot_proxy - echo -e "*** $(date -u) Getting a non privileged user\n" |& tee -a clientTestOutputs.txt - dirac-proxy-init "${DEBUG}" |& tee -a clientTestOutputs.txt + echo -e "*** $(date -u) Getting a non privileged user\n" |& tee -a clientTestOutputs.txt + dirac-proxy-init "${DEBUG}" |& tee -a clientTestOutputs.txt - #-------------------------------------------------------------------------------# - echo -e "*** $(date -u) **** Submit a job ****\n" + #-------------------------------------------------------------------------------# + echo -e "*** $(date -u) **** Submit a job ****\n" - echo -e '[\n Arguments = "Hello World";\n Executable = "echo";\n Site = "DIRAC.Jenkins.ch";' > test.jdl - echo " JobName = \"${GITHUB_JOB}_$(date +"%Y-%m-%d_%T" | sed 's/://g')\"" >> test.jdl - echo "]" >> test.jdl - dirac-wms-job-submit test.jdl "${DEBUG}" |& tee -a clientTestOutputs.txt + echo -e '[\n Arguments = "Hello World";\n Executable = "echo";\n Site = "DIRAC.Jenkins.ch";' >test.jdl + echo " JobName = \"${GITHUB_JOB}_$(date +"%Y-%m-%d_%T" | sed 's/://g')\"" >>test.jdl + echo "]" >>test.jdl + dirac-wms-job-submit test.jdl "${DEBUG}" |& tee -a clientTestOutputs.txt - #-------------------------------------------------------------------------------# - echo -e "*** $(date -u) **** add a file ****\n" + #-------------------------------------------------------------------------------# + echo -e "*** $(date -u) **** add a file ****\n" - echo "${CLIENT_UPLOAD_BASE64}" > b64_lfn - base64 b64_lfn --decode > "${CLIENT_UPLOAD_FILE}" - dirac-dms-add-file "${CLIENT_UPLOAD_LFN}" "${CLIENT_UPLOAD_FILE}" S3-DIRECT - echo $? + echo "${CLIENT_UPLOAD_BASE64}" >b64_lfn + base64 b64_lfn --decode >"${CLIENT_UPLOAD_FILE}" + dirac-dms-add-file "${CLIENT_UPLOAD_LFN}" "${CLIENT_UPLOAD_FILE}" S3-DIRECT + echo $? - #-------------------------------------------------------------------------------# - echo -e "*** $(date -u) **** Submit a job with an input ****\n" + #-------------------------------------------------------------------------------# + echo -e "*** $(date -u) **** Submit a job with an input ****\n" - echo -e '[\n Arguments = "Hello World";\n Executable = "echo";\n Site = "DIRAC.Jenkins.ch";\n InputData = "/vo/test_lfn.txt";' > test_dl.jdl - echo " JobName = \"${GITHUB_JOB}_$(date +"%Y-%m-%d_%T" | sed 's/://g')\"" >> test_dl.jdl - echo "]" >> test_dl.jdl - dirac-wms-job-submit test_dl.jdl "${DEBUG}" |& tee -a clientTestOutputs.txt + echo -e '[\n Arguments = "Hello World";\n Executable = "echo";\n Site = "DIRAC.Jenkins.ch";\n InputData = "/vo/test_lfn.txt";' >test_dl.jdl + echo " JobName = \"${GITHUB_JOB}_$(date +"%Y-%m-%d_%T" | sed 's/://g')\"" >>test_dl.jdl + echo "]" >>test_dl.jdl + dirac-wms-job-submit test_dl.jdl "${DEBUG}" |& tee -a clientTestOutputs.txt fi diff --git a/tests/Jenkins/utilities.sh b/tests/Jenkins/utilities.sh index 2a020e578e7..c452cc2de56 100644 --- a/tests/Jenkins/utilities.sh +++ b/tests/Jenkins/utilities.sh @@ -25,7 +25,6 @@ default() { fi } - # Finders... functions devoted to find DBs, Services, versions, etc.. #............................................................................. @@ -43,12 +42,11 @@ findSystems() { echo "ERROR: cannot change to ${TESTCODE}" >&2 exit 1 fi - python -m DIRAC.Core.Utilities.Extensions findSystems > systems + python -m DIRAC.Core.Utilities.Extensions findSystems >systems echo "found $(wc -l systems)" } - #............................................................................. # # findDatabases: @@ -84,15 +82,14 @@ findDatabases() { # and InstalledComponentsDB which is installed at the beginning # if [[ -n "${DBstoExclude}" ]]; then - python -m DIRAC.Core.Utilities.Extensions findDatabases | grep -vE '(FileCatalogDB|FileCatalogWithFkAndPsDB|InstalledComponentsDB)' | grep -v "${DBstoExclude}" > databases + python -m DIRAC.Core.Utilities.Extensions findDatabases | grep -vE '(FileCatalogDB|FileCatalogWithFkAndPsDB|InstalledComponentsDB)' | grep -v "${DBstoExclude}" >databases else - python -m DIRAC.Core.Utilities.Extensions findDatabases | grep -vE '(FileCatalogDB|FileCatalogWithFkAndPsDB|InstalledComponentsDB)' | grep "${DBstoSearch}" > databases + python -m DIRAC.Core.Utilities.Extensions findDatabases | grep -vE '(FileCatalogDB|FileCatalogWithFkAndPsDB|InstalledComponentsDB)' | grep "${DBstoSearch}" >databases fi echo "found $(wc -l databases)" } - #------------------------------------------------------------------------------- # findServices: # @@ -101,10 +98,9 @@ findDatabases() { # #------------------------------------------------------------------------------- -findServices(){ +findServices() { echo '==> [findServices]' - if [[ -n "${1}" ]]; then ServicestoSearch=${1} if [[ "${ServicestoSearch}" = "exclude" ]]; then @@ -121,15 +117,15 @@ findServices(){ exit 1 fi if [[ -n "${ServicestoExclude}" ]]; then - python -m DIRAC.Core.Utilities.Extensions findServices | grep -v "${ServicestoExclude}" > services + python -m DIRAC.Core.Utilities.Extensions findServices | grep -v "${ServicestoExclude}" >services else - python -m DIRAC.Core.Utilities.Extensions findServices | grep "${ServicestoSearch}" > services + python -m DIRAC.Core.Utilities.Extensions findServices | grep "${ServicestoSearch}" >services fi echo "found $(wc -l services)" } -findAgents(){ +findAgents() { echo '==> [findAgents]' if [[ -n "${1}" ]]; then @@ -150,15 +146,14 @@ findAgents(){ # Always remove the JobAgent, which is not a real agent if [[ -n "${AgentstoExclude}" ]]; then - python -m DIRAC.Core.Utilities.Extensions findAgents | grep -v "WorkloadManagementSystem JobAgent" | grep -v "${AgentstoExclude}" > agents + python -m DIRAC.Core.Utilities.Extensions findAgents | grep -v "WorkloadManagementSystem JobAgent" | grep -v "${AgentstoExclude}" >agents else - python -m DIRAC.Core.Utilities.Extensions findAgents | grep -v "WorkloadManagementSystem JobAgent" | grep "${AgentstoSearch}" > agents + python -m DIRAC.Core.Utilities.Extensions findAgents | grep -v "WorkloadManagementSystem JobAgent" | grep "${AgentstoSearch}" >agents fi echo "found $(wc -l agents)" } - #------------------------------------------------------------------------------- # findServices: # @@ -168,7 +163,6 @@ findAgents(){ # #------------------------------------------------------------------------------- - findFutureServices() { echo '==> [findFutureServices]' @@ -191,24 +185,23 @@ findFutureServices() { fi # Build the list of services - python -m DIRAC.Core.Utilities.Extensions findFutureServices \ - | sed -e 's/System / /g' \ - -e 's/Handler//g' \ - -e 's/Client//g' \ - -e 's/ /\//g' \ - | grep -v "JobAgent" > futureServices + python -m DIRAC.Core.Utilities.Extensions findFutureServices | + sed -e 's/System / /g' \ + -e 's/Handler//g' \ + -e 's/Client//g' \ + -e 's/ /\//g' | + grep -v "JobAgent" >futureServices # Apply exclusion if any if [[ -n "$disabledPattern" ]]; then # Use grep -F for fixed strings (space-safe) - grep -Fv -f <(printf "%s\n" $disabledPattern) futureServices > futureServices.tmp + grep -Fv -f <(printf "%s\n" $disabledPattern) futureServices >futureServices.tmp mv futureServices.tmp futureServices fi - echo "found $(wc -l < futureServices)" + echo "found $(wc -l [findExecutors]' - python -m DIRAC.Core.Utilities.Extensions findExecutors > executors + python -m DIRAC.Core.Utilities.Extensions findExecutors >executors echo "found $(wc -l executors)" } - - #------------------------------------------------------------------------------- # finalCleanup: # # remove symlinks, remove cached info #------------------------------------------------------------------------------- -finalCleanup(){ +finalCleanup() { echo '==> [finalCleanup]' rm -Rf etc/grid-security/certificates @@ -243,7 +234,6 @@ finalCleanup(){ rm -Rf /tmp/tmp.* } - getCFGFile() { echo '==> [getCFGFile]' @@ -251,7 +241,6 @@ getCFGFile() { sed -i "s/VAR_Release/${DIRAC_RELEASE}/g" "${SERVERINSTALLDIR}/install.cfg" } - #################################################### # This installs the DIRAC client # @@ -280,13 +269,13 @@ installDIRAC() { else DIRACOS2_URL="https://github.com/DIRACGrid/DIRACOS2/releases/latest/download/DIRACOS-Linux-x86_64.sh" fi - curl -L "${DIRACOS2_URL}" > "installer.sh" + curl -L "${DIRACOS2_URL}" >"installer.sh" fi bash "installer.sh" rm "installer.sh" # TODO: Remove - echo "source \"$PWD/diracos/diracosrc\"" > "$PWD/bashrc" - echo "export X509_CERT_DIR=\"$PWD/diracos/etc/grid-security/certificates\"" >> "$PWD/bashrc" + echo "source \"$PWD/diracos/diracosrc\"" >"$PWD/bashrc" + echo "export X509_CERT_DIR=\"$PWD/diracos/etc/grid-security/certificates\"" >>"$PWD/bashrc" source diracos/diracosrc if [[ -n "${DIRAC_RELEASE+x}" ]]; then @@ -325,12 +314,7 @@ installDIRAC() { configureArgs+=("--LegacyExchangeApiKey=diracx:legacy:InsecureChangeMe") fi - if [[ -n "${INSTALLATION_BRANCH}" ]]; then - # Use this for (e.g.) running backward-compatibility tests - cmd="dirac-configure -S ${DIRACSETUP} -C ${CSURL} --SkipCAChecks "${configureArgs[@]}" ${CONFIGUREOPTIONS} ${DEBUG}" - else - cmd="dirac-configure -C ${CSURL} --SkipCAChecks ${CONFIGUREOPTIONS} ${DEBUG}" - fi + cmd="dirac-configure -C ${CSURL} --SkipCAChecks ${CONFIGUREOPTIONS} ${DEBUG}" if ! bash -c "${cmd}"; then echo 'ERROR: dirac-configure failed' >&2 exit 1 @@ -359,10 +343,10 @@ function installDIRACX() { fi for wheel_name in "$@"; do - wheels=( $(find "${DIRACX_CUSTOM_SOURCE_PREFIXES}" -name "diracx_${wheel_name}-*.whl") ) + wheels=($(find "${DIRACX_CUSTOM_SOURCE_PREFIXES}" -name "diracx_${wheel_name}-*.whl")) if [[ ! ${#wheels[@]} -eq 1 ]]; then - echo "ERROR: Multiple or no wheels found for ${wheel_name} in ${DIRACX_CUSTOM_SOURCE_PREFIXES}" - exit 1 + echo "ERROR: Multiple or no wheels found for ${wheel_name} in ${DIRACX_CUSTOM_SOURCE_PREFIXES}" + exit 1 fi pip install "${wheels[0]}" done @@ -468,7 +452,6 @@ diracUserAndGroup() { fi } - #............................................................................. # # diracSite: @@ -493,10 +476,10 @@ diracAddSite() { # #------------------------------------------------------------------------------- -diracServices(){ +diracServices() { echo '==> [diracServices]' - local services=$(cut -d '.' -f 1 < services | grep -v StorageElementHandler | grep -v ^ConfigurationSystem | grep -v RAWIntegrity | grep -v RunDBInterface | grep -v ComponentMonitoring | sed 's/System / /g' | sed 's/Handler//g' | sed 's/ /\//g') + local services=$(cut -d '.' -f 1 calling dirac-install-component $serv -o /DIRAC/Security/UseServerCertificate=True ${DEBUG}" @@ -507,8 +490,7 @@ diracServices(){ done } - -diracSEs(){ +diracSEs() { echo '==> [diracSEs]' echo "==> Installing SE-1" @@ -529,7 +511,6 @@ diracSEs(){ } - #------------------------------------------------------------------------------- # diracUninstallServices: # @@ -537,13 +518,13 @@ diracSEs(){ # #------------------------------------------------------------------------------- -diracUninstallServices(){ +diracUninstallServices() { echo '==> [diracUninstallServices]' findServices # Ignore tornado services - local services=$(cut -d '.' -f 1 < services | grep -v TokenManager | grep -v ^ConfigurationSystem | grep -v RAWIntegrity | grep -v RunDBInterface | grep -v ComponentMonitoring | grep -v Tornado | sed 's/System / /g' | sed 's/Handler//g' | sed 's/ /\//g') + local services=$(cut -d '.' -f 1 [diracAgents]' - local agents=$(cut -d '.' -f 1 < agents | grep -v CE2CSAgent | grep -v GOCDB2CS | grep -v Bdii2CS | grep -v CacheFeeder | grep -v NetworkAgent | grep -v FrameworkSystem | grep -v DataProcessingProgressAgent | grep -v RAWIntegrityAgent | grep -v GridSiteWMSMonitoringAgent | grep -v HCAgent | grep -v GridCollectorAgent | grep -v HCProxyAgent | grep -v Nagios | grep -v AncestorFiles | grep -v BKInputData | grep -v LHCbPRProxyAgent | sed 's/System / /g' | sed 's/ /\//g') + local agents=$(cut -d '.' -f 1 [diracDBs]' - local dbs=$(cut -d ' ' -f 2 < databases | cut -d '.' -f 1 | grep -v ^RequestDB | grep -v ^FileCatalogDB | grep -v ^InstalledComponentsDB) + local dbs=$(cut -d ' ' -f 2 &2 @@ -611,31 +590,31 @@ diracDBs(){ } # Drop, then Install manually the DFC -diracDFCDB(){ +diracDFCDB() { echo '==> [diracDFCDB]' mysql -u"$DB_ROOTUSER" -p"$DB_ROOTPWD" -h"$DB_HOST" -P"$DB_PORT" -e "DROP DATABASE IF EXISTS FileCatalogDB;" SRC_ROOT="$(python -c 'import os; import DIRAC; print(os.path.dirname(DIRAC.__file__))')" - mysql -u"$DB_ROOTUSER" -p"$DB_ROOTPWD" -h"$DB_HOST" -P"$DB_PORT" < "${SRC_ROOT}/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql" + mysql -u"$DB_ROOTUSER" -p"$DB_ROOTPWD" -h"$DB_HOST" -P"$DB_PORT" <"${SRC_ROOT}/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql" } # Drop, then manually install the DFC with MultiVOFileCatalogDB -diracMVDFCDB(){ +diracMVDFCDB() { echo '==> [diracMVDFCDB]' SRC_ROOT="$(python -c 'import os; import DIRAC; print(os.path.dirname(DIRAC.__file__))')" cp "${SRC_ROOT}/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql" "${SRC_ROOT}/DataManagementSystem/DB/MultiVOFileCatalogWithFkAndPsDB.sql" sed -i 's/FileCatalogDB/MultiVOFileCatalogDB/g' "${SRC_ROOT}/DataManagementSystem/DB/MultiVOFileCatalogWithFkAndPsDB.sql" mysql -u"$DB_ROOTUSER" -p"$DB_ROOTPWD" -h"$DB_HOST" -P"$DB_PORT" -e "DROP DATABASE IF EXISTS MultiVOFileCatalogDB;" - mysql -u"$DB_ROOTUSER" -p"$DB_ROOTPWD" -h"$DB_HOST" -P"$DB_PORT" < "${SRC_ROOT}/DataManagementSystem/DB/MultiVOFileCatalogWithFkAndPsDB.sql" + mysql -u"$DB_ROOTUSER" -p"$DB_ROOTPWD" -h"$DB_HOST" -P"$DB_PORT" <"${SRC_ROOT}/DataManagementSystem/DB/MultiVOFileCatalogWithFkAndPsDB.sql" rm "${SRC_ROOT}/DataManagementSystem/DB/MultiVOFileCatalogWithFkAndPsDB.sql" } -dropDBs(){ +dropDBs() { echo '==> [dropDBs]' # make dbs a real array to avoid future mistake with escaping - mapfile -t dbs < <(cut -d ' ' -f 2 < databases | cut -d '.' -f 1 | grep -v ^RequestDB | grep -v ^FileCatalogDB) + mapfile -t dbs < <(cut -d ' ' -f 2 [diracOptimizers]' local executors=$(cat executors | grep WorkloadManagementSystem | cut -d ' ' -f 2 | grep -v Base) - for executor in $executors - do + for executor in $executors; do echo "==> calling dirac-install-component WorkloadManagement/$executor -o /DIRAC/Security/UseServerCertificate=True" if ! dirac-install-component "WorkloadManagement/$executor" -o /DIRAC/Security/UseServerCertificate=True "${DEBUG}"; then echo 'ERROR: dirac-install-component failed' >&2 @@ -664,7 +642,6 @@ diracOptimizers(){ # Kill, Stop and Start scripts. Used to clean environment. #------------------------------------------------------------------------------- - #............................................................................. # # killRunsv: