Skip to content

Commit

Permalink
Merge pull request #928 from hdoupe/local-dockerfile
Browse files Browse the repository at this point in the history
Merged #928
  • Loading branch information
hdoupe authored Aug 24, 2018
2 parents a09a2b3 + 4a41b19 commit 7bbad09
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ dist-build:
docker build --no-cache --build-arg TAG=$(TAG) -t opensourcepolicycenter/flask:$(TAG) --file Dockerfile.flask ./ && \
docker build --no-cache --build-arg TAG=$(TAG) -t opensourcepolicycenter/celery:$(TAG) --file Dockerfile.celery ./

dist-build-local:
cd distributed && \
docker build -t opensourcepolicycenter/distributed:$(TAG) ./ --build-arg PUF_TOKEN=$(OSPC_ANACONDA_TOKEN) --file Dockerfile.local && \
docker build --no-cache --build-arg TAG=$(TAG) -t opensourcepolicycenter/flask:$(TAG) --file Dockerfile.flask ./ && \
docker build --no-cache --build-arg TAG=$(TAG) -t opensourcepolicycenter/celery:$(TAG) --file Dockerfile.celery ./

dist-push:
cd distributed && \
docker push opensourcepolicycenter/distributed:$(TAG) && \
Expand Down
22 changes: 12 additions & 10 deletions distributed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ USER root
RUN apt-get update && apt install libgl1-mesa-glx --yes

RUN mkdir /home/distributed
RUN mkdir /home/distributed/api
COPY requirements.txt home/distributed

WORKDIR /home/distributed
WORKDIR /home/distributed/api

RUN conda config --add channels ospc
RUN conda config --add channels ospc/label/dev
RUN conda config --append channels conda-forge

RUN conda install numpy>=1.12.1 pandas>=0.23.0 taxcalc=0.20.1 \
btax=0.2.2 ogusa=0.5.11 matplotlib numba six bokeh>=0.12.7 mock xlrd \
sphinx nomkl

RUN pip install -r requirements.txt

RUN mkdir /home/distributed/api
WORKDIR /home/distributed/api

# not safe. don't publish with token
# see conversations like: https://github.com/moby/moby/issues/33343
ARG PUF_TOKEN
Expand All @@ -31,3 +23,13 @@ RUN if [ -z ${PUF_TOKEN+x} ]; \
write-latest-taxpuf; \
gunzip -k puf.csv.gz; \
fi

WORKDIR /home/distributed

RUN conda install numpy>=1.12.1 pandas>=0.23.0 taxcalc=0.20.1 \
btax=0.2.2 ogusa=0.5.11 matplotlib numba six bokeh>=0.12.7 mock xlrd \
sphinx nomkl

RUN pip install -r requirements.txt

WORKDIR /home/distributed/api
37 changes: 37 additions & 0 deletions distributed/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM continuumio/miniconda3
USER root
RUN apt-get update && apt install libgl1-mesa-glx --yes

RUN mkdir /home/distributed
RUN mkdir /home/distributed/api

COPY requirements.txt home/distributed

WORKDIR /home/distributed/api

RUN conda config --append channels conda-forge

# not safe. don't publish with token
# see conversations like: https://github.com/moby/moby/issues/33343
ARG PUF_TOKEN
RUN if [ -z ${PUF_TOKEN+x} ]; \
then echo PUF token not specified; \
else echo getting and writing PUF file && \
conda install taxpuf -c https://conda.anaconda.org/t/$PUF_TOKEN/opensourcepolicycenter && \
write-latest-taxpuf; \
gunzip -k puf.csv.gz; \
fi

WORKDIR /home/distributed

RUN conda install numpy>=1.12.1 pandas>=0.23.0 \
matplotlib numba six bokeh>=0.12.7 mock xlrd \
sphinx nomkl
RUN pip install -r requirements.txt

COPY script.sh /home/distributed
COPY ./Tax-Calculator /home/distributed/Tax-Calculator/
COPY ./B-Tax /home/distributed/B-Tax/
RUN bash script.sh

WORKDIR /home/distributed/api
7 changes: 7 additions & 0 deletions distributed/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd Tax-Calculator
pip install -e .
cd ..

cd B-Tax
pip install -e .
cd ..

0 comments on commit 7bbad09

Please sign in to comment.