Skip to content

Commit f414b94

Browse files
committed
add docker, makefile and conda environment
1 parent 2966d27 commit f414b94

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM continuumio/miniconda3:4.7.12
2+
3+
ADD ./environment.yml ./environment.yml
4+
5+
RUN conda install -n base -c conda-forge mamba && \
6+
mamba env update -n base -f ./environment.yml && \
7+
conda clean -afy
8+

Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
IMAGE := informer
2+
ROOT := $(shell dirname $(realpath $(firstword ${MAKEFILE_LIST})))
3+
PARENT_ROOT := $(shell dirname ${ROOT})
4+
PORT := 8888
5+
6+
DOCKER_PARAMETERS := \
7+
--user $(shell id -u) \
8+
-v ${ROOT}:/app \
9+
-w /app \
10+
-e HOME=/tmp
11+
12+
init:
13+
docker build -t ${IMAGE} .
14+
15+
jupyter:
16+
docker run -d --rm ${DOCKER_PARAMETERS} -e HOME=/tmp -p ${PORT}:8888 ${IMAGE} \
17+
bash -c "jupyter lab --ip=0.0.0.0 --no-browser --NotebookApp.token=''"
18+
19+
run_module: .require-module
20+
docker run -i --rm ${DOCKER_PARAMETERS} \
21+
${IMAGE} ${module}
22+
23+
bash_docker:
24+
docker run -it --rm ${DOCKER_PARAMETERS} ${IMAGE}
25+
26+
.require-module:
27+
ifndef module
28+
$(error module is required)
29+
endif

environment.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: regional_pmm
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.6
7+
- pip
8+
- matplotlib==3.1.1
9+
- numpy==1.19.4
10+
- pandas==0.25.1
11+
- scikit-learn==0.21.3
12+
- pytorch==1.8.0

0 commit comments

Comments
 (0)