-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Base Image for Papermill Docker (#437)
* adding docker for papermill --------- Co-authored-by: bshifaw <[email protected]>
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
############### stage 0 | ||
FROM continuumio/miniconda3 AS build | ||
ARG PKM='conda' | ||
ARG CONDA_ENV_NAME='lr-papermill-base' | ||
ARG INSTALL_CMD="${PKM} env create -n ${CONDA_ENV_NAME}" | ||
ARG CLEAN_CMD="${PKM} clean --all --yes" | ||
|
||
# conda-pack is needed to create a standalone conda environment that can be moved between systems. | ||
# It allows you to package all the dependencies of this project into a single tarball. | ||
# This tarball can then be unpacked on any system that has conda installed, | ||
# allowing you to quickly and easily recreate your environment without transfering over | ||
# the large conda cache, which can be several GB in size. This is especially useful for | ||
# saving space on a docker image. | ||
# Install conda-pack: | ||
RUN ${PKM} update -y -n base conda && \ | ||
${PKM} install -y -c conda-forge conda-pack libmamba && \ | ||
${PKM} config --set solver libmamba && \ | ||
${CLEAN_CMD} | ||
|
||
# Copy environment.yml to the container: | ||
COPY environment.yml . | ||
RUN ${INSTALL_CMD} \ | ||
--file environment.yml && \ | ||
${CLEAN_CMD} | ||
|
||
|
||
# Use conda-pack to create a standalone enviornment | ||
# in /venv: | ||
RUN conda-pack \ | ||
-n ${CONDA_ENV_NAME} \ | ||
-o /tmp/env.tar && \ | ||
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \ | ||
rm /tmp/env.tar | ||
# We've put venv in same path it'll be in final image, | ||
# so now fix up paths: | ||
RUN /venv/bin/conda-unpack | ||
|
||
RUN ${CLEAN_CMD} | ||
|
||
############### stage 1 | ||
FROM ubuntu:20.04 AS runtime | ||
# Copy /venv from the previous stage: | ||
COPY --from=build /venv /venv | ||
ENV VIRTUAL_ENV=/venv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
VERSION = 2.5.0 | ||
TAG1 = us.gcr.io/broad-dsp-lrma/lr-papermill-base:$(VERSION) | ||
TAG2 = us.gcr.io/broad-dsp-lrma/lr-papermill-base:latest | ||
|
||
all: build | ||
|
||
build: | ||
docker build -t $(TAG1) -t $(TAG2) . | ||
|
||
push: | ||
docker push $(TAG1) | ||
docker push $(TAG2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: lr-papermill-base-base | ||
|
||
channels: | ||
- bioconda | ||
- defaults | ||
- conda-forge | ||
- r | ||
|
||
dependencies: | ||
- tree=2.1.1 | ||
- python=3.11.6 | ||
- jupyter=1.0.0 | ||
- papermill=2.4.0 | ||
- pandas=2.1.1 | ||
- numpy=1.26.0 | ||
- scipy=1.11.3 | ||
- matplotlib=3.8.0 | ||
- seaborn=0.12.2 | ||
- r-base=4.1.3 | ||
- r-essentials=4.1.0 | ||
- r-ggplot2=3.4.2 | ||
- r-dplyr=1.1.2 | ||
- r-ggbeeswarm=0.7.2 |