Skip to content
Snippets Groups Projects
Commit 0d563d2a authored by Anton Joubert's avatar Anton Joubert
Browse files

Merge branch 'update-to-pytango-9.3.2' into 'master'

Update to pytango 9.3.2 and gitlab CI

See merge request ska-telescope/lmc-base-classes!22
parents 84c20201 b0226393
Branches
Tags
No related merge requests found
# GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application.
# Docker, when used with GitLab CI, runs each job in a separate and isolated container using the predefined image that is set up in .gitlab-ci.yml.
# In this case we use the latest python docker image to build and test this project.
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2
include:
- project: 'ska-telescope/templates-repository'
......@@ -40,20 +40,20 @@ build wheel for publication: # Executed on a tag
- docker-executor
script:
- python3 setup.py egg_info -b+$CI_COMMIT_SHORT_SHA sdist bdist_wheel
only:
- tags
rules:
- if: '$CI_COMMIT_TAG'
artifacts:
paths:
- ./dist/
build wheel for development: # Executed on a commit
build wheel for development: # Executed on non-tagged commit
stage: build
tags:
- docker-executor
script:
- python3 setup.py egg_info -b+dev.$CI_COMMIT_SHORT_SHA sdist bdist_wheel
except:
- tags
rules:
- if: '$CI_COMMIT_TAG == null || $CI_COMMIT_TAG == ""'
artifacts:
paths:
- ./dist/
......@@ -67,7 +67,7 @@ unit tests:
- docker-executor
script:
- echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
- python3 -m pip install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
- python3 -m pip install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
- make test
- scripts/validate-metadata.sh
artifacts:
......@@ -83,7 +83,7 @@ linting:
- docker-executor
script:
- echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
- python3 -m pip install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
- python3 -m pip install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
- make lint
artifacts:
paths:
......@@ -101,12 +101,9 @@ publish to nexus:
- scripts/validate-metadata.sh
- python3 -m pip install twine
- twine upload --repository-url $PYPI_REPOSITORY_URL dist/*
only:
variables:
# Confirm tag message exists
- $CI_COMMIT_MESSAGE =~ /^.+$/
# Confirm semantic versioning of tag
- $CI_COMMIT_TAG =~ /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/
rules:
# PyPI package release only on tags, and confirm semantic versioning of tag
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/'
release docker image:
stage: release
......@@ -118,11 +115,11 @@ release docker image:
script:
- make build
- make push
rules:
# Images only allow manual run on tags, and confirm semantic versioning of tag
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/'
when: manual
only:
refs:
- master
allow_failure: true
pages:
stage: pages
......
# Use SKA python image as base image
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.1 AS buildenv
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.1 AS runtime
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 AS buildenv
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.2 AS runtime
# create ipython profile to so that itango doesn't fail if ipython hasn't run yet
RUN ipython profile create
......@@ -11,5 +11,5 @@ RUN python3 -m pip install --user pytest-forked
# Note: working dir is `/app` which will have a copy of our repo
# The pip install will be a "user installation" so update path to access console scripts
ENV PATH=/home/tango/.local/bin:$PATH
RUN python3 -m pip install -e . --user --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
RUN python3 -m pip install -e . --user
CMD ["SKABaseDevice"]
......@@ -150,9 +150,6 @@ ifneq ($(NETWORK_MODE),host)
endif
$(DOCKER_COMPOSE_ARGS) docker-compose up -d
piplock: build ## overwrite Pipfile.lock with the image version
docker run $(IMAGE_TO_TEST) cat /app/Pipfile.lock > $(CURDIR)/Pipfile.lock
interactive: up
interactive: ## start an interactive session using the project image (caution: R/W mounts source directory to /app)
docker run --rm -it -p 3000:3000 --name=$(CONTAINER_NAME_PREFIX)dev -e TANGO_HOST=$(TANGO_HOST) --network=$(NETWORK_MODE) \
......
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[[source]]
url = "https://nexus.engageska-portugal.pt/repository/pypi/simple"
verify_ssl = true
name = "nexus-hosted"
[packages]
# numpy and pytango versions must match those in the ska-python-builder image,
# otherwise pytango will be recompiled.
numpy = "==1.17.2"
pytango = "==9.3.1"
# itango is added to make it easier to exercise the device in a CLI session,
# but it's not mandatory. If you remove itango, you should also remove the
# 'RUN ipython profile create' line from Dockerfile.
itango = "*"
future = "*"
ska_logging = ">=0.3.0"
[dev-packages]
docutils = "*"
MarkupSafe = "*"
Pygments = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"
pytest-pylint = "*"
pytest-json-report = "*"
python-dotenv = ">=0.5.1"
Sphinx = "*"
sphinx_rtd_theme = "*"
sphinx-autobuild = "*"
sphinxcontrib-websupport = "*"
coverage = "*"
pytest-xdist = "*"
pylint2junit = "*"
[requires]
python_version = "3"
This diff is collapsed.
......@@ -34,6 +34,7 @@ test:
# FIXME: Add pylint2junit to the tango-builder:latest image so that we don't need to install it here.
# FIXME: Missing functionality in pylint2junit prevents converting from parseable to xml. Once it's implemented there is no need to run linting twice.
lint:
python3 -m pip install -U pylint==2.4.4; \
python3 -m pip install pylint2junit; \
mkdir -p /build/reports; \
cd /app && pylint --output-format=parseable src/ska | tee /build/code_analysis.stdout; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment