Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Carlo FERRIGNO
ci-template-cc
Commits
ac45b2d4
Unverified
Commit
ac45b2d4
authored
Jan 29, 2021
by
Volodymyr SAVCHENKO
Browse files
use test case short name
parent
e486c37d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
make-functions.sh
make-functions.sh
+13
-12
No files found.
make-functions.sh
View file @
ac45b2d4
...
...
@@ -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-
$
SOURC
E_NAME
:
$(
git describe
--always
--tags
)
-
$NB2WORKFLOW_VERSION
"
IMAGE
=
"
$DOCKER_REGISTRY
/cc-
$
TEST_CAS
E_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
$
SOURC
E_NAME
||
true
docker
rm
-f
$
TEST_CAS
E_NAME
||
true
}
...
...
@@ -154,13 +155,13 @@ function run() {
fi
docker
rm
-f
$
SOURC
E_NAME
||
true
docker
rm
-f
$
TEST_CAS
E_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-
$
SOURC
E_NAME
;
\
mkdir
-pv
/tmp/tmpcode-
$
TEST_CAS
E_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
$
SOURC
E_NAME
\
--name
$
TEST_CAS
E_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-
$
SOURC
E_NAME
-
$provided_pars_suffix
cname
=
cc-ci-run-
$
TEST_CAS
E_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/
$
SOURC
E_NAME
mv
-fv
/dev/shm/singularity/
*
/data/singularity/
$
SOURC
E_NAME
/
${
SINGULARITY_IMAGE
}
mkdir
-pv
/data/singularity/
$
TEST_CAS
E_NAME
mv
-fv
/dev/shm/singularity/
*
/data/singularity/
$
TEST_CAS
E_NAME
/
${
SINGULARITY_IMAGE
}
}
#run-cwl:
...
...
@@ -435,9 +436,9 @@ function download-cwl() {
set
-e
echo
-e
"
\0
33[33mwill download"
curl
-L
--header
"PRIVATE-TOKEN:
$(
cat
~/.gitlab-token
)
"
\
"https://gitlab.astro.unige.ch/api/v4/projects/integral%2Fcc-workflows%2Fcc-
${
SOURC
E_NAME
}
/jobs/artifacts/master/download?job=build"
>
artifacts.gz
unzip
-o
artifacts.gz
${
SOURC
E_NAME
}
.cwl
cp
-fv
${
SOURC
E_NAME
}
.cwl job.cwl
"https://gitlab.astro.unige.ch/api/v4/projects/integral%2Fcc-workflows%2Fcc-
${
TEST_CAS
E_NAME
}
/jobs/artifacts/master/download?job=build"
>
artifacts.gz
unzip
-o
artifacts.gz
${
TEST_CAS
E_NAME
}
.cwl
cp
-fv
${
TEST_CAS
E_NAME
}
.cwl job.cwl
echo
-e
"
\0
33[32mfound job.cwl:"
ls
-l
job.cwl
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment