Skip to content
Snippets Groups Projects
Commit ad619552 authored by Patrick Godwin's avatar Patrick Godwin
Browse files

add initial CI based off of gstlal repo

parent 5cc35d26
No related branches found
No related tags found
No related merge requests found
image: docker:latest
variables:
DOCKER_DRIVER: overlay
DOCKER_BRANCH: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_LATEST: $CI_REGISTRY_IMAGE:latest
BRANCH: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
COMMIT: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
NIGHTLY: $CI_REGISTRY_IMAGE:nightly
TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
# Location of *.spec.in patch script and arguments:
PATCHSCRIPT: patch_optimized_spec_file
COMP: gcc
PATCHFLAGS: -c $COMP -k --nocheck -f
# don't need git history
GIT_DEPTH: 1
before_script:
# Enable gcc-devtoolset-7
#- source /opt/rh/devtoolset-7/enable
# Set up Intel Dev Environment:
- source /opt/intel/bin/compilervars.sh intel64
- yum clean all
- yum makecache
cache:
key: $CI_JOB_NAME
paths:
- ccache
stages:
- build
- test
- docker
- docker-latest
# Build rpms
build:
stage: build
interruptible: true
image: containers.ligo.org/lscsoft/gstlal:master
variables:
GIT_STRATEGY: fetch
RPM_BUILD_CPUS: 4
script:
- if [ -d rpmbuild ]; then yum -y install rpmbuild/RPMS/x86_64/*.rpm; fi
- ./00init.sh
- $PATCHSCRIPT $PATCHFLAGS ./*.spec.in
- ./configure --enable-gtk-doc $EXTRA_CONFIG_FLAGS
- make
- make dist
# Install dependencies
- yum-builddep -y gstlal-calibration.spec
- rpmbuild -tb --define "_topdir $CI_PROJECT_DIR/rpmbuild" gstlal-calibration-*.tar.gz
artifacts:
expire_in: 18h
paths:
- rpmbuild/RPMS/x86_64/gstlal-calibration-*.rpm
- rpmbuild/RPMS/x86_64/python*-gstlal-calibration-*.rpm
only:
- schedules
- tags
- pushes
- web
# Tests
test:
interruptible: true
image: containers.ligo.org/alexander.pace/gstlal-dev/gstlal-dev:el7
stage: test
needs:
- build
script:
# Install RPMs and set up the test environment:
- if [ -d rpmbuild ]; then yum -y install rpmbuild/RPMS/x86_64/*.rpm; fi
- gst-inspect-1.0
- python3 -m pytest -c pytest.ini
only:
- schedules
- pushes
allow_failure: true
# Docker Images
docker:el7:
interruptible: true
stage: docker
before_script: [ ]
script:
# add RPMs to directory to pass to docker
- mkdir rpms
# Copy rpms to new container.
- mv rpmbuild/RPMS/x86_64/*.rpm rpms
# Clear out the old rpmbuild directory
- rm -rf rpmbuild*
# Build the container:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --pull -t $DOCKER_BRANCH --file .gitlab/ci/Dockerfile.dev .
- docker push $DOCKER_BRANCH
needs:
- build
- test
only:
- schedules
- pushes
except:
- /gstlal-([a-z]+-|)[0-9]+\.[0-9]+\.[0-9]+-v[0-9]+/
docker-release:el7:
interruptible: true
stage: docker
before_script: [ ]
script:
# add RPMs to directory to pass to docker
- mkdir rpms
# Copy rpms to new container.
- mv rpmbuild/RPMS/x86_64/*.rpm rpms
# Clear out the old rpmbuild directory
- rm -rf rpmbuild*
# Build the container:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --pull -t $DOCKER_BRANCH --file .gitlab/ci/Dockerfile .
- docker push $DOCKER_BRANCH
needs:
- build
- test
only:
- /gstlal-calibration-[0-9]+\.[0-9]+\.[0-9]+-v[0-9]+/
latest_image:
interruptible: true
stage: docker-latest
before_script: [ ]
needs:
- docker-release:el7
only:
- /gstlal-calibration-[0-9]+\.[0-9]+\.[0-9]+-v[0-9]+/
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker tag $DOCKER_BRANCH $DOCKER_LATEST
- docker push $DOCKER_LATEST
retry:
max: 2
FROM containers.ligo.org/lscsoft/gstlal:latest
USER root
## Copy Optimized RPMs to container
COPY rpms /rpms
# Install Optimized RPMs, delete old RPMs
RUN yum makecache && \
yum -y localinstall /rpms/*.rpm && \
yum clean all
# Update gstreamer registry cache:
ENV GST_REGISTRY_1_0=/usr/share/gstreamer-1.0/.registry.bin
RUN gst-inspect-1.0
# Export MKL environment variables:
ENV MKL_INTERFACE_LAYER LP64
ENV MKL_THREADING_LAYER SEQUENTIAL
ENV TMPDIR /tmp
ENTRYPOINT bash
FROM containers.ligo.org/lscsoft/gstlal:master
USER root
## Copy Optimized RPMs to container
COPY rpms /rpms
# Install Optimized RPMs, delete old RPMs
RUN yum makecache && \
yum -y localinstall /rpms/*.rpm && \
yum clean all
# Update gstreamer registry cache:
ENV GST_REGISTRY_1_0=/usr/share/gstreamer-1.0/.registry.bin
RUN gst-inspect-1.0
# Export MKL environment variables:
ENV MKL_INTERFACE_LAYER LP64
ENV MKL_THREADING_LAYER SEQUENTIAL
ENV TMPDIR /tmp
ENTRYPOINT bash
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