Skip to content
Snippets Groups Projects
Commit d5933706 authored by Quang tru HUYNH's avatar Quang tru HUYNH
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #69384 failed
stages:
- step1
- step2
docker-build-push:
stage: step1
image:
name: registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:latest
services:
- registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:dind
script:
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" registry-gitlab.pasteur.fr
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME"
- docker tag "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
- export MY_TIME=`date +"%F-%H%M"`
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:$MY_TIME"
- docker push "$CI_REGISTRY_IMAGE:$MY_TIME"
singularity-build-push:
stage: step2
needs: ["docker-build-push"]
image:
name: quay.io/singularity/singularity:v3.8.4
entrypoint: [""]
script:
- singularity build singularity.sif Singularity
- singularity push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" singularity.sif oras://"$CI_REGISTRY_IMAGE":"latest"
FROM continuumio/miniconda3:master
RUN apt-get update && \
apt-get install -y && \
apt-get install -y wget bzip2 && \
apt-get install -y libglu1-mesa libgl1-mesa-dri
# https://github.com/MouseLand/cellpose/blob/master/.github/workflows/test_and_deploy.yml
RUN apt-get update && apt-get install -y \
libfontconfig1 libfreetype6 libxcb-xinerama0 \
libxcb-shape0 libxcb-util1 \
libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \
libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 pkg-config libhdf5-103 libhdf5-dev && \
rm -rf /var/lib/apt/lists/*
RUN conda update --yes conda && \
conda update -n base -c defaults conda -y && \
conda update --all -y
RUN eval "$(/opt/conda/bin/conda shell.bash hook)" && \
conda create --name cellpose python=3.8 && \
conda activate cellpose && \
conda install pytorch cudatoolkit=11.3 -c pytorch && \
python -m pip install cellpose[all]
Copyright © 2020 Howard Hughes Medical Institute
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of HHMI nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# building an cellpose docker/singularity container
Tru <tru@pasteur.fr>
(toy) docker/singularity containers
Docker:
```
docker run -ti registry-gitlab.pasteur.fr/tru/singularity-docker-cellpose:main
```
Singularity:
```
singularity run oras://registry-gitlab.pasteur.fr/tru/singularity-docker-cellpose:latest
```
Dockefile is used to build the initial container, then singularity is used
to convert it to a OCI image, ready to be used.
## why ?
- working with gitlab CI as for github CI https://github.com/truatpasteurdotfr/cellpose
- just keep the required files for CI
BootStrap: docker
#From: ghcr.io/truatpasteurdotfr/cellpose:master
From: registry-gitlab.pasteur.fr/tru/cellpose:main
%runscript
cat <<EOF
eval "$(/opt/conda/bin/conda shell.bash hook)"
conda activate cellpose
python -m cellpose
EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment