Skip to content

Tag:latest, Branch:main #86

Tag:latest, Branch:main

Tag:latest, Branch:main #86

name: Verify jalien-setup
on:
push:
branches:
- main
workflow_dispatch:
inputs:
image_tag:
description: 'Image tag'
required: false
default: 'latest'
source_jalien_repo:
description: 'Source JAliEn Repo'
required: false
default: 'https://gitlab.cern.ch/jalien/jalien'
source_jalien_branch:
description: 'Source JAliEn Repo Branch'
required: false
default: 'master'
# run-name: ${{ github.event_name == 'workflow_dispatch' && format('Test Pipeline- Tag:{0}, Branch:{1}', tojson(inputs.tag), github.ref_name) || '' }}
# run-name: ${{ github.event_name == 'workflow_dispatch' }} && format('Commit- {0} Tag:{1}, Branch:{2}', ${{ github.event.head_commit.message }}, tojson(inputs.image_tag), github.ref_name) || '' }}
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Tag:{0}, Branch:{1}', inputs.image_tag, github.ref_name) || '' }}
jobs:
test-jalien-setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Clone jalien-setup
run: |
cd ${{ github.workspace }}
cd ..
git clone https://gitlab.cern.ch/jalien/jalien-setup
cd ./jalien-setup && git checkout origin/updated-sql8-setup
- name: Clone jalien
run: |
cd ${{ github.workspace }}
cd ..
git clone ${{ github.event.inputs.source_jalien_repo }}
cd ./jalien && git checkout origin/${{ github.event.inputs.source_jalien_branch }}
- name: Clone test-suite
run: |
cd ${{ github.workspace }}
cd ..
git clone https://gitlab.cern.ch/jalien/test-suite
- name: Create .env for test-suite
run: |
cd ${{ github.workspace }}
cd ..
ROOT_PATH=${{ github.workspace }}/..
echo "
export SHARED_VOLUME_PATH=${ROOT_PATH}/SHARED_VOLUME
export JALIEN_SETUP_PATH=${ROOT_PATH}/jalien-setup
export JALIEN_PATH=${ROOT_PATH}/jalien
export CONTAINER_NAME_CE=shared_volume_JCentral-dev-CE_1
export CONTAINER_NAME_CENTRAL=shared_volume_JCentral-dev_1
export CONTAINER_NAME_SCHEDD=shared_volume_schedd_1
export CONTAINER_NAME_SE=shared_volume_JCentral-dev-SE_1
export CONTAINER_NAME_WORKER=shared_volume_worker1_1
export CONTAINER_REGISTRY=gitlab-registry.cern.ch/jalien/jalien-setup
export SCRIPT_DIR=${ROOT_PATH}/test-suite
export ALIENV_PATH=${ROOT_PATH}/test-suite/files/alma-alienv
export SAMPLE_JDL_PATH=${ROOT_PATH}/test-suite/files/sample_test.jdl
export TESTSCRIPT_PATH=${ROOT_PATH}/test-suite/files/testscript_test.sh
" >> ${ROOT_PATH}/test-suite/.env
cat ${ROOT_PATH}/test-suite/.env
- name: Update /etc/hosts
if: ${{ github.event.inputs.image_tag == 'latest' }}
run: |
sudo bash -c "echo '
127.0.0.1 JCentral-dev
127.0.0.1 JCentral-dev-SE
172.18.0.2 alice-jcentral.cern.ch
' >> /etc/hosts"
- name: Install xrootd
if: ${{ github.event.inputs.image_tag == 'latest' }}
run: |
sudo apt install xrootd-client xrootd-server python3-xrootd
- name: Run host specific tests
if: ${{ github.event.inputs.image_tag == 'latest' }}
run: |
cd ${{ github.workspace }}/../test-suite
./index.sh --host-only
- name: Create config.sh for bash
run: |
cd ${{ github.workspace }}
cd ..
ROOT_PATH=${{ github.workspace }}/..
echo "
export BASE_DIR=${ROOT_PATH}
export SCRIPT_DIR=${ROOT_PATH}/jalien-setup/bash
export SHARED_VOLUME=${ROOT_PATH}/SHARED_VOLUME
export JALIEN=${ROOT_PATH}/jalien
export JALIEN_SETUP=${ROOT_PATH}/jalien-setup
export JALIEN_SOURCE=${{ github.event.inputs.source_jalien_repo }}
export JALIEN_SETUP_SOURCE=https://gitlab.cern.ch/jalien/jalien-setup
export CE_NAME=shared_volume_JCentral-dev-CE_1
export JCENTRAL_NAME=shared_volume_JCentral-dev_1
export SCHEDD_NAME=shared_volume_schedd_1
export SE_NAME=shared_volume_JCentral-dev-SE_1
export WORKER_NAME=shared_volume_worker1_1
" >> ${ROOT_PATH}/jalien-setup/bash/config/config.sh
cat ${ROOT_PATH}/jalien-setup/bash/config/config.sh
# For production image setup
- name: Run jalien-setup bash scripts - Grid setup testing
if: ${{ github.event.inputs.image_tag == 'latest' }}
run: |
cd ${{ github.workspace }}/../jalien-setup/bash
./start.sh --shared --latest
# For production image setup
- name: Run test-suite for all tests
if: ${{ github.event.inputs.image_tag == 'latest' }}
run: |
cd ${{ github.workspace }}/../test-suite
./index.sh --latest
# For test image setup
- name: Run jalien-setup bash scripts - Container testing
if: ${{ github.event.inputs.image_tag == 'test' }}
run: |
cd ${{ github.workspace }}/../jalien-setup/bash
./start.sh --shared --test
# For test image setup
- name: Run test-suite for container specific tests
if: ${{ github.event.inputs.image_tag == 'test' }}
run: |
cd ${{ github.workspace }}/../test-suite
./index.sh --container-only --test
- name: Copy log files
if: always()
continue-on-error: true #Copying mysql log will fail which is expected
run: |
cd ${{ github.workspace }}
mkdir final_logs
cp -r ${{ github.workspace }}/../SHARED_VOLUME/logs/* ./final_logs
- name: Upload log files
uses: actions/upload-artifact@v4
if: always()
with:
name: final_logs
path: ${{ github.workspace }}/final_logs