Skip to content

Commit

Permalink
conda env test added
Browse files Browse the repository at this point in the history
  • Loading branch information
tcnichol committed Mar 27, 2021
1 parent c9ee9f9 commit 94e9e05
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 2 deletions.
32 changes: 32 additions & 0 deletions conda-env-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:18.04
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"
RUN apt-get update

RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/*

RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda --version

RUN conda clean -a

RUN echo $CONDA_PREFIX

COPY environment.yml .

COPY run.py .

RUN ls

RUN conda env create -f environment.yml

SHELL ["conda", "run", "-n", "test2", "/bin/bash", "-c"]

RUN python -m pip install --ignore-installed pyclowder


CMD ["conda", "run", "--no-capture-output", "-n", "test2", "python","-u", "run.py"]
16 changes: 16 additions & 0 deletions conda-env-test/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: test2
channels:
- defaults
- conda-forge
dependencies:
- python==3.6.12
- tensorflow=1.14.0
- keras
- gdal
- h5py
- nomkl
- pyshp
- Shapely
- scipy
- scikit-learn
- scikit-image==0.16.2
14 changes: 14 additions & 0 deletions conda-env-test/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pyclowder
from osgeo import gdal
import sys
import time


def main():
print(sys.version)
print('done')
time.sleep(60*60)


if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions zip_files_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def main():
# path to folder which needs to be zipped

# writing files to a zipfile
file_paths = ['test.txt', 'test2.txt']
with ZipFile('test.zip', 'w') as zip:
file_paths = ['test_image.dbf', 'test_image.prj','test_image.shp','test_image.shx']
with ZipFile('test_image.zip', 'w') as zip:
# writing each file one by one
for file in file_paths:
zip.write(file)
Expand Down

0 comments on commit 94e9e05

Please sign in to comment.