Commit 36f4d209 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

First setup of CI runner.

parent f6564702
Pipeline #214 canceled with stages
- git lfs pull
- source /root/anaconda3/bin/activate
- export GDAL_DATA=/root/anaconda3/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- make coverage
- make docs
- htmlcov/
- docs/_build/html/
stage: deploy
- test_py_tools_ds
- mkdir -p public/coverage
- cp -r htmlcov/* public/coverage/
- mkdir -p public/doc
- cp -r docs/_build/html/* public/doc/
- public
expire_in: 30 days
- master
#!/usr/bin/env bash
# get py_tools_ds project # TODO move this to as soon as package is public
rm -rf context/py_tools_ds
git clone ./context/py_tools_ds
echo "#### Build runner docker image"
sudo docker rmi ${tag}
sudo docker build -f ${context_dir}/${dockerfile} -m 20G -t ${tag} ${context_dir}
echo "#### Create gitlab-runner (daemon) container with tag; ${tag}"
sudo docker stop ${gitlab_runner}
sudo docker rm ${gitlab_runner}
sudo docker run -d --name ${gitlab_runner} --restart always \
-v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
echo "#### Register container at gitlab, get token here"
read -p "Please enter gitlab token: " token
echo ""
read -p "Please enter gitlab runner name: " runner_name
echo "New gitlab runner image will named ${gitlab_runner}"
sudo docker exec -it ${gitlab_runner} /bin/bash -c "export RUNNER_EXECUTOR=docker && gitlab-ci-multi-runner register -n \
--url '' \
--registration-token '${token}' \
--run-untagged=true \
--locked=true \
--tag-list py_tools_ds_ci_client \
--description '${runner_name}' \
--docker-image '${tag}' "
FROM centos:7
RUN yum update -y && \
yum install -y wget vim bzip2 gcc gcc-c++ make libgl1-mesa-glx mesa-libGL qt5-qtbase-gui git # TODO
ENV anaconda_dl ''
RUN /bin/bash -i -c "cd /root; wget$anaconda_dl ; \
bash -i /root/$anaconda_dl -b ; \
rm -f /root/$anaconda_dl"
# 'conda install --yes -c conda-forge 'icu=58.*' lxml' fixing a bug for conda-forge gdal build, as of 06/2017
RUN /bin/bash -i -c "source /root/anaconda3/bin/activate ; \
conda install --yes pyqt coverage ; \
conda install --yes -c conda-forge gdal ; \
conda install --yes -c conda-forge 'icu=58.*' lxml ; \
conda install --yes -c conda-forge glymur pygrib rasterio pyproj cachetools ; \
pip install shapely geopandas dicttoxml jsmin cerberus pyprind pint iso8601 tqdm mpld3 sphinx-argparse"
# copy some needed stuff to /root
#COPY *.pkl /root/ # EXAMPLE
#COPY *.h5 /root/ # EXAMPLE
# copy geoarray code to /tmp # TODO move this to as soon as package is public
COPY geoarray /tmp/geoarray
# install git lfs
RUN /bin/bash -i -c "curl -s | bash"
# installing git large file support, see here: , change version number below for future upgrades
ENV git_lfs_v='2.1.1'
RUN /bin/bash -i -c "wget${git_lfs_v}/git-lfs-linux-amd64-${git_lfs_v}.tar.gz; \
tar -zxvf git-lfs-linux-amd64-${git_lfs_v}.tar.gz; \
cd git-lfs-${git_lfs_v}; \
bash ./"
# set matplotlib backend to Agg as default, Qt won't work in headless docker containers
RUN bash -i -c 'source /root/anaconda3/bin/activate; \
sed -i "/backend : tkagg/c\backend : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())"); \
sed -i "/backend : Qt4Agg/c\backend : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())"); \
sed -i "/backend : qt5agg/c\backend : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())")'
RUN bash -i -c "source /root/anaconda3/bin/activate; \ # TODO move this to as soon as package is public
cd /tmp/geoarray/; python install;"
Supports Markdown
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