Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ebrains-spack-builds
Manage
Activity
Members
Labels
Plan
Issues
38
Issue boards
Milestones
Wiki
Code
Merge requests
30
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Platform
EBRAINS Software Distribution
ebrains-spack-builds
Commits
79ff7e58
Commit
79ff7e58
authored
8 months ago
by
Eleni Mathioulaki
Browse files
Options
Downloads
Patches
Plain Diff
feat: move deployment script from image into k8s job
parent
8431e2e0
No related branches found
Branches containing commit
No related tags found
1 merge request
!567
create new experimental release
Pipeline
#53420
waiting for manual action with stage
Stage:
in 31 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
create_job.sh
+52
-19
52 additions, 19 deletions
create_job.sh
with
53 additions
and
20 deletions
.gitlab-ci.yml
+
1
−
1
View file @
79ff7e58
...
...
@@ -18,7 +18,7 @@ variables:
-
oc project $OC_PROJECT
# create job description file
-
chmod a+x create_job.sh
-
./create_job.sh $CI_PIPELINE_ID $BUILD_ENV_DOCKER_IMAGE
update
$INSTALLATION_ROOT $SPACK_VERSION $SPACK_ENV $CI_COMMIT_BRANCH $RELEASE_NAME $LAB_KERNEL_ROOT
-
./create_job.sh $CI_PIPELINE_ID $BUILD_ENV_DOCKER_IMAGE $INSTALLATION_ROOT $SPACK_VERSION $SPACK_ENV $CI_COMMIT_BRANCH $RELEASE_NAME $LAB_KERNEL_ROOT
-
cat simplejob.yml
# start the deploy job
-
oc create -f simplejob.yml
...
...
This diff is collapsed.
Click to expand it.
create_job.sh
+
52
−
19
View file @
79ff7e58
...
...
@@ -2,20 +2,19 @@
# ===========================================================================================================
# title : create_job.sh
# usage : ./create_job.sh $OC_JOB_ID $BUILD_ENV_DOCKER_IMAGE
$OP
$INSTALLATION_ROOT $SPACK_VERSION
# usage : ./create_job.sh $OC_JOB_ID $BUILD_ENV_DOCKER_IMAGE $INSTALLATION_ROOT $SPACK_VERSION
# $SPACK_ENV $BRANCH $RELEASE_NAME $LAB_KERNEL_ROOT
# description : creates OKD job yaml file that builds/updates spack environment and creates Lab kernel
# ===========================================================================================================
OC_JOB_ID
=
$1
BUILD_ENV_DOCKER_IMAGE
=
$2
OP
=
$3
INSTALLATION_ROOT
=
$4
SPACK_VERSION
=
$5
SPACK_ENV
=
$6
BRANCH
=
$7
RELEASE_NAME
=
$8
LAB_KERNEL_ROOT
=
$9
INSTALLATION_ROOT
=
$3
SPACK_VERSION
=
$4
EBRAINS_SPACK_ENV
=
$5
BRANCH
=
$6
RELEASE_NAME
=
$7
LAB_KERNEL_ROOT
=
$8
cat
<<
EOT
>> simplejob.yml
apiVersion: batch/v1
...
...
@@ -37,20 +36,54 @@ spec:
volumeMounts:
- name: sharedbin
mountPath: /srv
command: ["/usr/local/bin/deploy-build-env.sh", "
$OP
", "
$INSTALLATION_ROOT
", "
$SPACK_VERSION
", "
$SPACK_ENV
", "
$BRANCH
", "
$RELEASE_NAME
", "
$LAB_KERNEL_ROOT
"]
command:
- /bin/bash
- -c
- |
# create root dir if it doesn't exist
mkdir -p
\$
INSTALLATION_ROOT
# reset build error log dir (delete previous logs to save space)
rm -rf
\$
BUILD_LOGS_DIR
mkdir -p
\$
BUILD_LOGS_DIR
# reset spack repository dir by cloning the selected version
rm -rf
\$
EBRAINS_REPO_PATH
git clone https://gitlab.ebrains.eu/technical-coordination/project-internal/devops/platform/ebrains-spack-builds.git --branch
\$
BRANCH
\$
EBRAINS_REPO_PATH
# run installation script
.
\$
EBRAINS_REPO_PATH/install_spack_env.sh
\$
INSTALLATION_ROOT
\$
SPACK_VERSION
\$
EBRAINS_REPO_PATH
\$
EBRAINS_SPACK_ENV
if [
\$
? -eq 0 ]
then
# build process succeeded - create or update kernel on the NFS based on the current spack environment
chmod +x
\$
EBRAINS_REPO_PATH/create_JupyterLab_kernel.sh
\$
EBRAINS_REPO_PATH/create_JupyterLab_kernel.sh
\$
INSTALLATION_ROOT
\$
EBRAINS_SPACK_ENV
\$
RELEASE_NAME
\$
LAB_KERNEL_ROOT
exit 0
else
# build process failed - keep spack build logs and fail the pipeline
cp -r /tmp/spack/spack-stage/*
\$
SPACK_BUILD_LOGS
exit
fi
env:
- name: SYSTEMNAME
value: ebrainslab
- name: GITLAB_USER
valueFrom:
secretKeyRef:
name: spack-repo-gitlab-token
key: username
- name: GITLAB_TOKEN
valueFrom:
secretKeyRef:
name: spack-repo-gitlab-token
key: password
- name: INSTALLATION_ROOT
value:
$INSTALLATION_ROOT
- name: SPACK_VERSION
value:
$SPACK_VERSION
- name: EBRAINS_SPACK_ENV
value:
$EBRAINS_SPACK_ENV
- name: BRANCH
value:
$BRANCH
- name: RELEASE_NAME
value:
$RELEASE_NAME
- name: LAB_KERNEL_ROOT
value:
$LAB_KERNEL_ROOT
- name: BUILD_LOGS_DIR
value: /srv/build_logs/
$EBRAINS_SPACK_ENV
- name: EBRAINS_REPO_PATH
value:
$INSTALLATION_ROOT
/ebrains-spack-builds
volumes:
- name: sharedbin
persistentVolumeClaim:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment