Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmmnbuild-dep-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scripting-tools
cmmnbuild-dep-manager
Commits
f40e1345
Commit
f40e1345
authored
3 years ago
by
Philip Elson
Browse files
Options
Downloads
Plain Diff
Merge branch 'feat/pipeline-our-images' into 'master'
Use acc-py images for CI tests See merge request
!82
parents
027e58c3
c7191f57
No related branches found
No related tags found
1 merge request
!82
Use acc-py images for CI tests
Pipeline
#5062535
passed
2 years ago
Stage: build
Stage: test
Changes
1
Pipelines
281
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+21
-36
21 additions, 36 deletions
.gitlab-ci.yml
with
21 additions
and
36 deletions
.gitlab-ci.yml
+
21
−
36
View file @
f40e1345
...
...
@@ -4,54 +4,39 @@ include:
variables
:
project_name
:
cmmnbuild_dep_manager
PY_VERSION
:
"
3.7"
PY_VERSION
:
"
3.7"
# Explicit, keep in sync with ACC_PY_IMAGE_TAG
ACC_PY_IMAGE_TAG
:
"
2020.11"
.cc7_non_root
:
image
:
# We pin to an old image, since that contains the useradd functionality. See
# https://mattermost.web.cern.ch/be-dep/pl/annbur3q7jnfpg1atks6o4t95e for
# context.
name
:
gitlab-registry.cern.ch/acc-co/docker/acc-base-images/acc_cc7@sha256:bde86612d325a8090c0a7d270efb56702983fc6d41d1b57a4f26ed0342cc1c64
# Default to a non-root user ('runner-user') who is in the special "wheel" group, so can run root commands with su -c "{command}".
entrypoint
:
[
'
/bin/bash'
,
'
-c'
,
'
/sbin/useradd
-G
wheel
runner-user
&&
sed
-i
-E
"s/\#(auth\s.*)/\1/"
/etc/pam.d/su
&&
exec
/bin/su
runner-user
-c
/bin/bash'
]
.non_root_with_sudo
:
variables
:
ACC_PY_IMAGE_NAME
:
acc-py_cc7_openjdk11
# https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR
:
0
image
:
name
:
registry.cern.ch/acc/${ACC_PY_IMAGE_NAME}:${ACC_PY_IMAGE_TAG}
# Default to a non-root user ('runner-user'), add them to sudoers so it can `sudo`
entrypoint
:
[
'
/bin/bash'
,
'
-c'
,
'
yum
install
-y
shadow-utils
util-linux
sudo
&&
/sbin/useradd
runner-user
&&
echo
"runner-user
ALL=(ALL)
NOPASSWD:
ALL"
>
/etc/sudoers
&&
exec
/bin/su
runner-user
-c
"/opt/container/.entrypoint
/bin/bash"'
]
.dev_test_base
:
extends
:
-
.acc_py_dev_test
-
.
cc7_
non_root
-
.non_root
_with_sudo
before_script
:
-
su -c "rpm -i http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/bzip2-1.0.6-13.el7.x86_64.rpm"
-
su -c "mkdir /opt/runner-user"; su -c "chown -R runner-user /opt/runner-user"
-
curl -L https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
-
eval "$(./bin/micromamba shell hook -s bash)"
-
mkdir -p $HOME/micromamba
-
micromamba create -p /opt/runner-user/env --yes --quiet -c conda-forge python=${PY_VERSION} pip Jpype1${JPYPE_VN} openjdk${JDK_VN} git
-
micromamba activate /opt/runner-user/env
-
sudo yum install -y git
-
git config --global --add safe.directory '*'
-
pip install pytest-cov -e .[test${OTHER_EXTRAS}]
-
sudo pip install pytest-cov Jpype1${JPYPE_VN} -e .[test${OTHER_EXTRAS}]
-
sudo python -c "import cbng_web_service as c; a = c.create_app(c.Settings());"
.wheel_test_base
:
extends
:
-
.acc_py_wheel_test
-
.
cc7_
non_root
-
.non_root
_with_sudo
before_script
:
-
su -c "rpm -i http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/bzip2-1.0.6-13.el7.x86_64.rpm"
-
su -c "mkdir /opt/runner-user"; su -c "chown -R runner-user /opt/runner-user"
-
curl -L https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
-
eval "$(./bin/micromamba shell hook -s bash)"
-
micromamba create -p /opt/runner-user/env --yes --quiet -c conda-forge python=${PY_VERSION} pip Jpype1${JPYPE_VN} openjdk${JDK_VN}
-
micromamba activate /opt/runner-user/env
-
pip install pytest-cov $(ls -A ${project_root}/wheelhouse/*.whl)[test]
-
sudo pip install Jpype1${JPYPE_VN} pytest-cov $(ls -A ${project_root}/wheelhouse/*.whl)[test]
-
sudo python -c "import cbng_web_service as c; a = c.create_app(c.Settings());"
wheel_tests_jpype
:
...
...
@@ -59,25 +44,26 @@ wheel_tests_jpype:
-
.wheel_test_base
dev_tests_java8
:
dev_tests_java
:
parallel
:
matrix
:
-
ACC_PY_IMAGE_NAME
:
[
acc-py_cc7_jdk8
,
acc-py_cc7_openjdk11
]
extends
:
-
.dev_test_base
variables
:
JDK_VN
:
"
=8"
dev_tests_jpype_1p1
:
extends
:
-
.dev_test_base
variables
:
JPYPE_VN
:
"
=1.1"
JPYPE_VN
:
"
=
=
1.1
.*
"
dev_tests_jpype_1p2
:
extends
:
-
.dev_test_base
variables
:
JPYPE_VN
:
"
=1.2"
JPYPE_VN
:
"
=
=
1.2
.*
"
OTHER_EXTRAS
:
"
,stubgen"
...
...
@@ -103,4 +89,3 @@ build_docs:
# A release build of the documentation, made available through cern.ch/acc-py.
build_docs_on_tag
:
extends
:
.acc_py_build_docs_on_tag
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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