Skip to content
Snippets Groups Projects
Commit cce60422 authored by Malte Nyhuis's avatar Malte Nyhuis
Browse files

singularity remote build in ci/cd

parent cee394cb
No related branches found
No related tags found
1 merge request!15singularity remote build in ci/cd
...@@ -5,6 +5,9 @@ image: python:3.10 ...@@ -5,6 +5,9 @@ image: python:3.10
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
LIBGL_ALWAYS_INDIRECT : 0 LIBGL_ALWAYS_INDIRECT : 0
SREGISTRY_TOKEN : "singularitybuild/sylabstoken"
SREGISTRY_URL : "https://cloud.sylabs.io/"
SREGISTRY_USERNAME : nyhuma
# Pip's cache doesn't store the python packages # Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/topics/caching/ # https://pip.pypa.io/en/stable/topics/caching/
...@@ -16,7 +19,8 @@ cache: ...@@ -16,7 +19,8 @@ cache:
- .cache/pip - .cache/pip
- venv/ - venv/
before_script: .before_script_template: &build_test
before_script:
- apt-get update -y && apt-get install libgl1-mesa-glx xvfb -y - apt-get update -y && apt-get install libgl1-mesa-glx xvfb -y
- python -m pip install --upgrade pip - python -m pip install --upgrade pip
- python --version # For debugging - python --version # For debugging
...@@ -25,26 +29,37 @@ before_script: ...@@ -25,26 +29,37 @@ before_script:
- source venv/bin/activate - source venv/bin/activate
stages: # List of stages for jobs, and their order of execution stages: # List of stages for jobs, and their order of execution
- build
- test - test
# - deploy - quality
- deploy
build:
stage: build
<<: *build_test
script:
- pip install .
test: # This job runs in the build stage, which runs first. test: # This job runs in the build stage, which runs first.
stage: test stage: test
<<: *build_test
script: script:
- pip install . - pip install .
- pip install -r requirements_dev.txt - pip install -r requirements_dev.txt
- pytest tests/. - pytest tests/.
lint-test-job: # This job also runs in the test stage. lint-test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel). stage: quality
<<: *build_test # It can run at the same time as unit-test-job (in parallel).
script: script:
- pip install flake8 - pip install flake8
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude='venv/' - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude='venv/'
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude='venv/' - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude='venv/'
coverage: coverage:
stage: test stage: quality
<<: *build_test
script: script:
- pip install . - pip install .
- pip install -r requirements_dev.txt - pip install -r requirements_dev.txt
...@@ -57,9 +72,17 @@ coverage: ...@@ -57,9 +72,17 @@ coverage:
when: always when: always
#deploy-job: # This job runs in the deploy stage. build-singularity:
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully. image:
# script: name: quay.io/singularity/singularity:v3.7.0
# - echo "Deploying application..." entrypoint: [""]
# - echo "Application successfully deployed." stage: deploy
only:
- tags
- master
script:
- singularity remote login --username $SREGISTRY_USERNAME --tokenfile $SREGISTRY_TOKEN
- singularity build --remote library://nyhuma/ntrflows/ntr.sif:latest singularitybuild/ntrfc_container.def
interruptible: true
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGguc3lsYWJzLmlvL3Rva2VuIiwic3ViIjoiNjI2YjBmMGM0MjhiN2E2MTg5YjEyYWI2IiwiZXhwIjoxNjcyNTgzMjQzLCJpYXQiOjE2Njk5OTEyNDMsImp0aSI6IjYzOGEwYjRiZWE2ZWE2MDM4YTQ0NjFmNSJ9.LHrRUPUbNanrhxEsM0Cb46l5K4y_p4cA3iWiN9vIi89h5ukNUOCppkeZnV83xyPNxBmEzPPC4lFnCugXe2XCIrMaqrG38RFGBDQOrB_aQnbFVfdBozzNoczwxZH5_JUK_JPsebqd2-Xv-in3T3pxJnW9MgbU5t5TONeJezARtXMzsTt3JeYrrUdWBhovdX_JiP4ZOUP_7ujeioBqgAuCeyH79c7sLJHzS-xS41DEzmWt75ZyagLuY0AqrBI4BjLJCz29wOLqvpIuSPmRZEQ63UasUZBq23FgzTZujQoSBgFtYN3w7yB7Em5WkJzLAtdr1EQ-t8LmT_m7m_RSQOBbWw
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment