Unverified Commit ac45b2d4 authored by Volodymyr SAVCHENKO's avatar Volodymyr SAVCHENKO
Browse files

use test case short name

parent e486c37d
......@@ -78,6 +78,7 @@ if [ "$IN_TEST_CASE" == "yes" ]; then
fi
SOURCE_NAME=$( oda-cc get metadata.source_short_name unnamed )
TEST_CASE_NAME=$( oda-cc get metadata.test_case_short_name unnamed )
CC_BASE_IMAGE=$( oda-cc get cc_base_image integralsw/osa-python:11.1-3-g87cee807-20200410-144247-refcat-43.0-heasoft-6.27.2-python-3.8.2 )
ROOT_NB=$( oda-cc get root_notebook verify.ipynb )
fi
......@@ -93,7 +94,7 @@ DOCKER_REGISTRY=faircrosscalibration
#current_version := $(shell cd $(current_dir); git describe --tags)
IMAGE="$DOCKER_REGISTRY/cc-$SOURCE_NAME:$( git describe --always --tags)-$NB2WORKFLOW_VERSION"
IMAGE="$DOCKER_REGISTRY/cc-$TEST_CASE_NAME:$( git describe --always --tags)-$NB2WORKFLOW_VERSION"
SINGULARITY_IMAGE=${IMAGE//\//}
......@@ -109,7 +110,7 @@ function pull() {
function build() {
touch pip.conf
export DOCKER_BUILDKIT=1
docker pull $IMAGE || ( nb2worker ./ --build --tag-image $IMAGE --job --from ${CC_BASE_IMAGE:?} --docker-run-prefix="mkdir -pv /home/oda; export HOME_OVERRRIDE=/home/oda; source /init.sh; " --docker-command='id; export HOME_OVERRRIDE=/tmp; mkdir -pv $HOME_OVERRRIDE; source /init.sh; source /etc/bashrc; oda-kb-eval /repo/'$SOURCE_NAME'.ipynb $@'; ls -ltr *cwl; )
docker pull $IMAGE || ( nb2worker ./ --build --tag-image $IMAGE --job --from ${CC_BASE_IMAGE:?} --docker-run-prefix="mkdir -pv /home/oda; export HOME_OVERRRIDE=/home/oda; source /init.sh; " --docker-command='id; export HOME_OVERRRIDE=/tmp; mkdir -pv $HOME_OVERRRIDE; source /init.sh; source /etc/bashrc; oda-kb-eval /repo/'$ROOT_NB'.ipynb $@'; ls -ltr *cwl; )
touch job.cwl
}
......@@ -125,7 +126,7 @@ function clean() {
}
function rm() {
docker rm -f $SOURCE_NAME || true
docker rm -f $TEST_CASE_NAME || true
}
......@@ -154,13 +155,13 @@ function run() {
fi
docker rm -f $SOURCE_NAME || true
docker rm -f $TEST_CASE_NAME || true
docker run --entrypoint cat $IMAGE /etc/passwd > passwd
< passwd sed 's/1000/'$(id -u)'/' > passwd.new
[ -s passwd.new ] || exit 1
mkdir -pv /tmp/tmpcode-$SOURCE_NAME; \
mkdir -pv /tmp/tmpcode-$TEST_CASE_NAME; \
docker run --rm -it \
--user $(id -u) \
-e ODA_SPARQL_ROOT \
......@@ -171,7 +172,7 @@ function run() {
-v $PWD:/home/integral \
-e JENA_PASSWORD \
-e MINIO_KEY \
--name $SOURCE_NAME \
--name $TEST_CASE_NAME \
--entrypoint bash $IMAGE \
$extra \
-c "export ODA_SPARQL_ROOT=http://fuseki.internal.odahub.io/dataanalysis
......@@ -210,7 +211,7 @@ function run-one() {
cp -fv oda.yaml *.ipynb $RUN_ONE_INDIR
cd $RUN_ONE_INDIR
cname=cc-ci-run-$SOURCE_NAME-$provided_pars_suffix
cname=cc-ci-run-$TEST_CASE_NAME-$provided_pars_suffix
ensure_minio
if [ ${MOUNT_SSH_FLAG:=no} == "yes" ]; then
......@@ -346,8 +347,8 @@ function build-singularity() {
#docker save $(IMAGE_NAME) | singularity -vvv import $(SINGULARITY_IMAGE)
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /dev/shm/singularity/:/output --privileged -t --rm quay.io/singularity/docker2singularity $IMAGE
mkdir -pv /data/singularity/$SOURCE_NAME
mv -fv /dev/shm/singularity/* /data/singularity/$SOURCE_NAME/${SINGULARITY_IMAGE}
mkdir -pv /data/singularity/$TEST_CASE_NAME
mv -fv /dev/shm/singularity/* /data/singularity/$TEST_CASE_NAME/${SINGULARITY_IMAGE}
}
#run-cwl:
......@@ -435,9 +436,9 @@ function download-cwl() {
set -e
echo -e "\033[33mwill download"
curl -L --header "PRIVATE-TOKEN: $(cat ~/.gitlab-token)" \
"https://gitlab.astro.unige.ch/api/v4/projects/integral%2Fcc-workflows%2Fcc-${SOURCE_NAME}/jobs/artifacts/master/download?job=build" > artifacts.gz
unzip -o artifacts.gz ${SOURCE_NAME}.cwl
cp -fv ${SOURCE_NAME}.cwl job.cwl
"https://gitlab.astro.unige.ch/api/v4/projects/integral%2Fcc-workflows%2Fcc-${TEST_CASE_NAME}/jobs/artifacts/master/download?job=build" > artifacts.gz
unzip -o artifacts.gz ${TEST_CASE_NAME}.cwl
cp -fv ${TEST_CASE_NAME}.cwl job.cwl
echo -e "\033[32mfound job.cwl:"
ls -l job.cwl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment