Skip to content
Snippets Groups Projects
Commit dc9d8190 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-822: Build docker image with dependencies suitable for general CI jobs

parent ef9987eb
No related branches found
No related tags found
1 merge request!4Added custom LofarDeviceProxy to enhance support for high-dimensional arrays in attribtues
Pipeline #36578 passed
default: default:
image: python:3.7-buster # minimum supported version image: $CI_REGISTRY/lofar2.0/lofar-station-client/ci_python37:$CI_COMMIT_SHORT_SHA # minimum supported version
# Make sure each step is executed in a virtual environment with some basic dependencies present # Make sure each step is executed in a virtual environment with some basic dependencies present
before_script: before_script:
- apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y libboost-python-dev libtango-dev # Needed to install pytango
- python --version # For debugging - python --version # For debugging
- python -m pip install --upgrade pip
- pip install --upgrade tox
cache: cache:
paths: paths:
- .cache/pip - .cache/pip
stages: stages:
- image
- lint - lint
- test - test
- package - package
...@@ -21,6 +19,19 @@ stages: ...@@ -21,6 +19,19 @@ stages:
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
build_test_image_python37:
stage: image
image: docker
services:
- name: docker:dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY/lofar2.0/lofar-station-client/ci_python37:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile.ci_python37 docker
- docker push $CI_REGISTRY/lofar2.0/lofar-station-client/ci_python37:$CI_COMMIT_SHORT_SHA
run_black: run_black:
stage: lint stage: lint
script: script:
...@@ -47,23 +58,33 @@ run_unit_tests_py37: ...@@ -47,23 +58,33 @@ run_unit_tests_py37:
- echo "run python3.7 unit tests /w coverage" - echo "run python3.7 unit tests /w coverage"
- tox -e py37 - tox -e py37
.run_unit_tests_pyXX:
# installs the prerequisites explicitly, instead of piggy backing
# on the ci_python37 image. This allows us to use different base
# images with different python versions.
stage: test
before_script:
- apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y libboost-python-dev libtango-dev # Needed to install pytango
- python -m pip install --upgrade pip
- pip install --upgrade tox
run_unit_tests_py38: run_unit_tests_py38:
extends: .run_unit_tests_pyXX
image: python:3.8-buster image: python:3.8-buster
stage: test
script: script:
- echo "run python3.8 unit tests /w coverage" - echo "run python3.8 unit tests /w coverage"
- tox -e py38 - tox -e py38
run_unit_tests_py39: run_unit_tests_py39:
extends: .run_unit_tests_pyXX
image: python:3.9-bullseye image: python:3.9-bullseye
stage: test
script: script:
- echo "run python3.9 unit tests /w coverage" - echo "run python3.9 unit tests /w coverage"
- tox -e py39 - tox -e py39
run_unit_tests_py310: run_unit_tests_py310:
extends: .run_unit_tests_pyXX
image: python:3.10-bullseye image: python:3.10-bullseye
stage: test
script: script:
# Debian Bullseye ships with libboost-python linked to Python 3.9. Use the one from Debian Sid instead. # Debian Bullseye ships with libboost-python linked to Python 3.9. Use the one from Debian Sid instead.
- echo 'deb http://deb.debian.org/debian sid main' >> /etc/apt/sources.list - echo 'deb http://deb.debian.org/debian sid main' >> /etc/apt/sources.list
......
FROM python:3.7-buster
# Install PyTango dependencies
RUN apt-get update -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libboost-python-dev libtango-dev
# Make sure we have the latest tooling for our tests
RUN python -m pip install --upgrade pip
RUN pip install --upgrade tox
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment