Commit b2f4f4fe authored by Sebastian Schwarz's avatar Sebastian Schwarz
Browse files

Update tests and Dockerfile.

parent 7bddb5c5
......@@ -16,18 +16,18 @@ prepare:
stage: build
before_script:
- docker version
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- echo "${CI_REGISTRY_PASSWORD}" | docker login --password-stdin --username "${CI_REGISTRY_USER}" "${CI_REGISTRY}"
script:
- mkdir -p /.docker
- docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} /.docker
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/base_image:${DOCKER_TAG}
tags:
- docker
test-prerequisites:
stage: test
image: ${DOCKER_IMAGE}
image: ${DOCKER_IMAGE}/base_image
script:
- python3.6 -m pytest -q /opt/richardsonpy/.
- python3.6 -m pytest -q /opt/pycity_base/.
......@@ -35,9 +35,9 @@ test-prerequisites:
- docker
unittest:
unittest-gurobi:
stage: test
image: ${DOCKER_IMAGE}
image: ${DOCKER_IMAGE}/base_image
script:
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
- ln -s $CI_PROJECT_DIR/README.md $CI_PROJECT_DIR/src/README.md
......@@ -47,9 +47,23 @@ unittest:
- docker
unittest-scip:
stage: test
image: ${DOCKER_IMAGE}/base_image
script:
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
- ln -s $CI_PROJECT_DIR/README.md $CI_PROJECT_DIR/src/README.md
- sed -i '55s/GUROBI_DIRECT_SOLVER/"SCIP_SOLVER"/g' $CI_PROJECT_DIR/src/pycity_scheduling/solvers.py
- sed -i '56s/GUROBI_DIRECT_SOLVER_OPTIONS/"SCIP_SOLVER_OPTIONS"/g' $CI_PROJECT_DIR/src/pycity_scheduling/solvers.py
- python3.6 -m pip install --no-cache-dir $CI_PROJECT_DIR/src/.
- python3.6 -m unittest discover -s $CI_PROJECT_DIR/src/testing/unit_tests -v
tags:
- docker
lint:
stage: test
image: ${DOCKER_IMAGE}
image: ${DOCKER_IMAGE}/base_image
script:
- mkdir -p lint
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
......@@ -72,7 +86,7 @@ doc:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_TAG =~ /^v/'
image: ${DOCKER_IMAGE}
image: ${DOCKER_IMAGE}/base_image
script:
- mkdir -p doc
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
......@@ -94,7 +108,7 @@ pages:
- if: '$CI_COMMIT_TAG =~ /^v/'
when: delayed
start_in: '60 minutes'
image: ${DOCKER_IMAGE}
image: ${DOCKER_IMAGE}/base_image
script:
- mkdir -p public
- mv $CI_PROJECT_DIR/docs/* public
......@@ -111,7 +125,7 @@ pypi-release:
- if: '$CI_COMMIT_TAG =~ /^v/'
when: delayed
start_in: '120 minutes'
image: ${DOCKER_IMAGE}
image: ${DOCKER_IMAGE}/base_image
script:
- mkdir -p release
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
......
......@@ -9,7 +9,7 @@ ENTRYPOINT /bin/bash
# Install the archlinux base packages:
RUN pacman -Syu sudo git patch wget curl php doxygen make cmake clang base-devel gcc gcc-fortran unzip tar bzip2 expat gdbm libffi openssl bluez-libs mpdecimal sqlite tk bison flex pkgconf boost boost-libs zlib gmp blas gsl readline ncurses tbb cliquer ghc ghc-libs haskell-criterion coin-or-asl lapack metis --ignore filesystem --noconfirm
RUN pacman -Syu sudo git patch wget curl php doxygen make cmake clang base-devel gcc gcc-fortran unzip tar bzip2 expat gdbm libffi openssl bluez-libs mpdecimal sqlite tk bison flex pkgconf boost boost-libs zlib gmp blas gsl readline ncurses tbb cliquer ghc ghc-libs haskell-criterion coin-or-asl lapack metis --noconfirm
# Create a builduser (required for some archlinux operations running inside Docker):
......@@ -42,10 +42,6 @@ RUN cd / &&\
cd /
# Intermediate cleanup:
RUN rm -rf /home/builduser/*
# Download the required HiGHS LP solver source code:
RUN mkdir -p /opt/HiGHS
ENV HiGHS_BASE_DIR="/opt/HiGHS"
......@@ -89,9 +85,9 @@ RUN cd $BLISS_BASE_DIR &&\
ENV PATH="${PATH}:$BLISS_BASE_DIR/bliss-0.73p/"
# Download, build and install the SCIP solver (SCIPOptSuite 7.0.1).
# Important note: You are allowed to retrieve a copy of SCIP for research purposes as a member of a noncommercial and academic institution.
# In order to get a copy of SCIP, you need to certify that you are a member of a noncommercial, academic institution and accept the ZIB Academic License.
# Download, build and install the SCIP optimization solver (SCIPOptSuite 7.0.1).
# Important note: You are allowed to retrieve a copy of SCIP for research purposes as a member of a noncommercial and academic institution only.
# To get a copy of SCIP, you need to certify that you are a member of a noncommercial, academic institution and accept the ZIB Academic License.
# Commercial use requires a commercial license.
# For further information visit: https://scipopt.org/#scipoptsuite
RUN mkdir -p /opt/scip
......@@ -127,6 +123,27 @@ RUN cd $SCIPAMPL_BASE_DIR/scipoptsuite-7.0.1/scip/interfaces/ampl &&\
ENV PATH="${PATH}:$SCIPAMPL_BASE_DIR/scipoptsuite-7.0.1/scip/interfaces/ampl/build"
## Download, build and install the Gurobi optimization solver (Gurobi 9.0.1).
# Important note: You are allowed to retrieve a copy of Gurobi for research purposes as a member of a non-commercial and academic institution only.
# To get a copy of Gurobi, you need to request for an academic license at Gurobi Optimization, LLC.
# Commercial use requires a commercial license.
# For further information visit: https://www.gurobi.com/
RUN mkdir -p /opt/gurobi
ENV GUROBI_BASE_DIR="/opt/scip"
RUN cd $GUROBI_BASE_DIR &&\
wget --quiet https://packages.gurobi.com/9.0/gurobi9.0.1_linux64.tar.gz &&\
tar xfz gurobi9.0.1_linux64.tar.gz &&\
chmod +x $GUROBI_BASE_DIR &&\
rm $GUROBI_BASE_DIR/gurobi9.0.1_linux64.tar.gz &&\
cd $GUROBI_BASE_DIR &&\
python3 setup.py install &&\
cd /
ENV PATH="${PATH}:$GUROBI_BASE_DIR/bin"
ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:$GUROBI_BASE_DIR/lib"
# Download and install Python package richardsonpy:
# Unfortunately, the current PyPI version of package richardsonpy seems to be broken.
# As a workaround, richardsonpy is downloaded from github and flag -e is used for pip.
......@@ -147,4 +164,4 @@ RUN cd /opt &&\
# Download and install the other requirements for package pycity_scheduling:
# Moreover, install the third-party Python site-packages that are required by the used tools during the different CI stages.
RUN python3.6 -m pip install --no-cache-dir pylint sphinx numpydoc
RUN python3.6 -m pip install --no-cache-dir importlib pylint sphinx numpydoc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment