Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dfulu committed Nov 3, 2023
1 parent b853f9f commit af7fbdc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
34 changes: 14 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
FROM python:3.10-slim
FROM continuumio/miniconda3

ARG TESTING=0

# make sure it doesnt fail if the docker file doesnt know the git commit
ARG GIT_PYTHON_REFRESH=quiet
SHELL ["/bin/bash", "-l", "-c"]

RUN apt-get update
RUN apt-get install git -y
RUN apt-get install g++ gcc libgeos++-dev libproj-dev proj-data proj-bin -y

# copy files
# Copy files
COPY setup.py app/setup.py
COPY README.md app/README.md
COPY requirements.txt app/requirements.txt
RUN pip install git+https://github.com/SheffieldSolar/PV_Live-API#pvlive_api


# install requirements
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
RUN conda install -c conda-forge esmpy xarray numpy shapely cf_xarray sparse numba
RUN pip install -r app/requirements.txt

# copy library files
COPY pvnet_app/ app/pvnet_app/
COPY tests/ app/tests/
COPY scripts/ app/scripts/
COPY data/ app/data/

# change to app folder
# Install requirements
RUN conda install python=3.10
RUN conda install -c conda-forge xesmf esmpy -y
RUN echo "export ESMFMKFILE='/opt/conda/lib/esmf.mk'" >> ~/.bashrc
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
RUN pip install -r app/requirements.txt
RUN pip install git+https://github.com/SheffieldSolar/PV_Live-API#pvlive_api

# Change to app folder
WORKDIR /app

# install library
# Install library
RUN pip install -e .

# download models so app can used cached
RUN python scripts/cache_default_models.py


RUN if [ "$TESTING" = 1 ]; then pip install pytest pytest-cov coverage; fi

CMD ["python", "-u","pvnet_app/app.py"]
CMD ["python", "-u","pvnet_app/app.py"]
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
xesmf
torch[cpu]>=2.0
PVNet-summation>=0.0.8
pvnet>=2.3.0
Expand All @@ -8,7 +7,7 @@ fsspec[s3]
xarray
zarr
numpy
pandas==2.0
pandas
sqlalchemy
torchdata
pytest
Expand Down

0 comments on commit af7fbdc

Please sign in to comment.