Skip to content

Commit

Permalink
add docker, makefile and conda environment
Browse files Browse the repository at this point in the history
  • Loading branch information
AzulGarza committed Nov 1, 2021
1 parent 2966d27 commit f414b94
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM continuumio/miniconda3:4.7.12

ADD ./environment.yml ./environment.yml

RUN conda install -n base -c conda-forge mamba && \
mamba env update -n base -f ./environment.yml && \
conda clean -afy

29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
IMAGE := informer
ROOT := $(shell dirname $(realpath $(firstword ${MAKEFILE_LIST})))
PARENT_ROOT := $(shell dirname ${ROOT})
PORT := 8888

DOCKER_PARAMETERS := \
--user $(shell id -u) \
-v ${ROOT}:/app \
-w /app \
-e HOME=/tmp

init:
docker build -t ${IMAGE} .

jupyter:
docker run -d --rm ${DOCKER_PARAMETERS} -e HOME=/tmp -p ${PORT}:8888 ${IMAGE} \
bash -c "jupyter lab --ip=0.0.0.0 --no-browser --NotebookApp.token=''"

run_module: .require-module
docker run -i --rm ${DOCKER_PARAMETERS} \
${IMAGE} ${module}

bash_docker:
docker run -it --rm ${DOCKER_PARAMETERS} ${IMAGE}

.require-module:
ifndef module
$(error module is required)
endif
12 changes: 12 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: regional_pmm
channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- pip
- matplotlib==3.1.1
- numpy==1.19.4
- pandas==0.25.1
- scikit-learn==0.21.3
- pytorch==1.8.0

0 comments on commit f414b94

Please sign in to comment.