diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac674b47a19647cfdd77b78afaffe15402e75296..adca4977b0bd309930c2575a0ad888d9784e592e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ # If you want to use DinD for your Docker-build jobs, you can use our privileged shared # GitLab-runners. This allows to directly build the image yourself as per https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-workflow-with-docker-executor -build docker image with dind: +build docker image conda scipy with dind: stage: build tags: - docker-privileged @@ -35,8 +35,46 @@ build docker image with dind: script: - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - docker build --pull -t "$CI_REGISTRY_IMAGE" . + - docker build --pull -t "$CI_REGISTRY_IMAGE" ./ROOT_conda_built_scipy - docker push "$CI_REGISTRY_IMAGE" + + + + + build docker image conda base with dind: + stage: build + tags: + - docker-privileged + # Use specific version of the official docker client image (as well as the docker-in-docker image) as recommended by + # https://about.gitlab.com/2019/07/31/docker-in-docker-with-docker-19-dot-03/ + image: docker:19.03.1 + services: + # To obtain a Docker daemon, request a Docker-in-Docker service + - docker:19.03.1-dind + # Note about internal IPs Clash + # If the internal private network assigned to the dind service clashes with any service/host used on the job, + # you can specify a different IP subnet to avoid the clash. Useful command to inspect the assigned IP range + # is `docker network inspect bridge`. + # To effectively assign a different IP subnet, replace the previous service definition with the following: + # services: + # # To obtain a Docker daemon, request a Docker-in-Docker service + # - name: docker:19.03.1-dind + # # Add to the dockerd command a specific bridge Ip, in this case the range 10.200.0.1/24 (to be adapted) + # command: ["--bip=10.200.0.1/24"] + variables: + # As of GitLab 12.5, privileged runners at CERN mount a /certs/client docker volume that enables use of TLS to + # communicate with the docker daemon. This avoids a warning about the docker service possibly not starting + # successfully. + # See https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled + DOCKER_TLS_CERTDIR: "/certs" + # Note that we do not need to set DOCKER_HOST when using the official docker client image: it automatically + # defaults to tcp://docker:2376 upon seeing the TLS certificate directory. + #DOCKER_HOST: tcp://docker:2376/ + script: + - docker info + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker build --pull -t "$CI_REGISTRY_IMAGE":conda ./ROOT_conda_minimal + - docker push "$CI_REGISTRY_IMAGE":conda # Features # * Allows your job to have access to the host, as it runs in privileged mode @@ -45,3 +83,5 @@ build docker image with dind: # Limitations # * Privileged runners take around 1-2 minutes to spawn a VM for your job and do not cache Docker-images # * These runners will not be available during Openstack Nova API downtime + + diff --git a/Dockerfile b/ROOT_conda_built_scipy/Dockerfile similarity index 100% rename from Dockerfile rename to ROOT_conda_built_scipy/Dockerfile diff --git a/ROOT_conda_minimal/Dockerfile b/ROOT_conda_minimal/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..9007bd1b6af20ea9e5c5b4964178bc1ff648529e --- /dev/null +++ b/ROOT_conda_minimal/Dockerfile @@ -0,0 +1,41 @@ +FROM jupyter/base-notebook:latest +WORKDIR / +ENV DEBIAN_FRONTEND=noninteractive +USER root + +#Upload the new kernel into the jupyter dir +COPY kernel.json /opt/conda/share/jupyter/kernels/python3/kernel.json + +#install the prerequisites (option always yes activated) +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y python3 python3-dev git curl python3-pip \ + && apt-get --yes install \ + dpkg-dev \ + cmake \ + g++ \ + gcc \ + binutils\ + libx11-dev\ + libxpm-dev\ + libxft-dev\ + libxext-dev\ + libssl-dev\ + nano + +# ========================== \ +# Installing ROOT \ +# ========================== +RUN conda install root -c conda-forge +#RUN conda activate root_env + +WORKDIR /home/jovyan/work/ + + +ENV ROOTSYS=/installdir +ENV PATH $ROOTSYS/bin:$PATH +ENV PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH +ENV LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH +ENV CLING_STANDARD_PCH=none + +#CMD [ "conda" "activate" "root_env" ] diff --git a/ROOT_conda_minimal/kernel.json b/ROOT_conda_minimal/kernel.json new file mode 100644 index 0000000000000000000000000000000000000000..a00704d68ffb0003ff9ba8a7a6a2483ff8dff7df --- /dev/null +++ b/ROOT_conda_minimal/kernel.json @@ -0,0 +1,15 @@ +{ + "argv": [ + "/opt/conda/bin/python", + "-m", + "ipykernel_launcher", + "-f", + "{connection_file}" + ], + "display_name": "Python 3", + "language": "python", + "env": { + "PYTHONPATH": "${PYTHONPATH}:/installdir/lib", + "LD_LIBRARY_PATH": "/installdir/lib" + } +} \ No newline at end of file