From 3f24ff18c31830267c7541f29065220dafbe0d32 Mon Sep 17 00:00:00 2001 From: Chris Schnaufer Date: Tue, 14 Jul 2020 13:50:32 -0700 Subject: [PATCH] Cleaning up repo --- .gitignore | 113 +++++++++++++++++++++++++++++++++++++++++++-- environment.yml | 93 ------------------------------------- generate_docker.py | 68 --------------------------- 3 files changed, 110 insertions(+), 164 deletions(-) delete mode 100644 environment.yml delete mode 100755 generate_docker.py diff --git a/.gitignore b/.gitignore index 2030de3..60ab957 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,111 @@ -.idea/* -*.pyc +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# pycharm +.idea + +# Testing folder test -.venv \ No newline at end of file + diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 11c9b79..0000000 --- a/environment.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: null -channels: - - conda-forge - - defaults -dependencies: - - _libgcc_mutex=0.1=conda_forge - - _openmp_mutex=4.5=1_llvm - - bzip2=1.0.8=h516909a_2 - - ca-certificates=2020.4.5.1=hecc5488_0 - - cairo=1.16.0=hcf35c78_1003 - - certifi=2020.4.5.1=py38h32f6830_0 - - dbus=1.13.6=he372182_0 - - expat=2.2.9=he1b5a44_2 - - ffmpeg=4.2=h167e202_0 - - fontconfig=2.13.1=h86ecdb6_1001 - - freetype=2.10.1=he06d7ca_0 - - gettext=0.19.8.1=hc5be6a0_1002 - - giflib=5.2.1=h516909a_2 - - glib=2.64.2=h6f030ca_0 - - gmp=6.2.0=he1b5a44_2 - - gnutls=3.6.5=hd3a4fd2_1002 - - graphite2=1.3.13=he1b5a44_1001 - - gst-plugins-base=1.14.5=h0935bb2_2 - - gstreamer=1.14.5=h36ae1b5_2 - - harfbuzz=2.4.0=h9f30f68_3 - - hdf5=1.10.6=nompi_h3c11f04_100 - - icu=64.2=he1b5a44_1 - - jasper=1.900.1=h07fcdf6_1006 - - jpeg=9c=h14c3975_1001 - - lame=3.100=h14c3975_1001 - - ld_impl_linux-64=2.34=h53a641e_0 - - libblas=3.8.0=16_openblas - - libcblas=3.8.0=16_openblas - - libclang=9.0.1=default_hde54327_0 - - libffi=3.2.1=he1b5a44_1007 - - libgcc-ng=9.2.0=h24d8f2e_2 - - libgfortran-ng=7.3.0=hdf63c60_5 - - libiconv=1.15=h516909a_1006 - - liblapack=3.8.0=16_openblas - - liblapacke=3.8.0=16_openblas - - libllvm9=9.0.1=he513fc3_1 - - libopenblas=0.3.9=h5ec1e0e_0 - - libopencv=4.2.0=py38_6 - - libpng=1.6.37=hed695b0_1 - - libstdcxx-ng=9.2.0=hdf63c60_2 - - libtiff=4.1.0=hc3755c2_3 - - libuuid=2.32.1=h14c3975_1000 - - libwebp=1.0.2=h56121f0_5 - - libxcb=1.13=h14c3975_1002 - - libxkbcommon=0.10.0=he1b5a44_0 - - libxml2=2.9.10=hee79883_0 - - llvm-openmp=10.0.0=hc9558a2_0 - - lz4-c=1.9.2=he1b5a44_1 - - ncurses=6.1=hf484d3e_1002 - - nettle=3.4.1=h1bed415_1002 - - nspr=4.25=he1b5a44_0 - - nss=3.47=he751ad9_0 - - numpy=1.18.4=py38h8854b6b_0 - - opencv=4.2.0=py38_6 - - openh264=1.8.0=hdbcaa40_1000 - - openssl=1.1.1g=h516909a_0 - - pcre=8.44=he1b5a44_0 - - pip=20.1=pyh9f0ad1d_0 - - pixman=0.38.0=h516909a_1003 - - pthread-stubs=0.4=h14c3975_1001 - - py-opencv=4.2.0=py38h23f93f0_6 - - python=3.8.2=he5300dc_7_cpython - - python_abi=3.8=1_cp38 - - qt=5.12.5=hd8c4c69_1 - - readline=8.0=hf8c457e_0 - - setuptools=46.1.3=py38h32f6830_0 - - sqlite=3.30.1=hcee41ef_0 - - tk=8.6.10=hed695b0_0 - - wheel=0.34.2=py_1 - - x264=1!152.20180806=h14c3975_0 - - xorg-kbproto=1.0.7=h14c3975_1002 - - xorg-libice=1.0.10=h516909a_0 - - xorg-libsm=1.2.3=h84519dc_1000 - - xorg-libx11=1.6.9=h516909a_0 - - xorg-libxau=1.0.9=h14c3975_0 - - xorg-libxdmcp=1.1.3=h516909a_0 - - xorg-libxext=1.3.4=h516909a_0 - - xorg-libxrender=0.9.10=h516909a_1002 - - xorg-renderproto=0.11.1=h14c3975_1002 - - xorg-xextproto=7.3.0=h14c3975_1002 - - xorg-xproto=7.0.31=h14c3975_1007 - - xz=5.2.5=h516909a_0 - - zlib=1.2.11=h516909a_1006 - - zstd=1.4.4=h6597ccf_3 - - pip: - - gdal==2.2.2 - - setuptools==46.2.0 -prefix: /scif/apps/soilmask/conda \ No newline at end of file diff --git a/generate_docker.py b/generate_docker.py deleted file mode 100755 index b836d6d..0000000 --- a/generate_docker.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python3 - -"""Generated Dockerfile from a template -""" - -import argparse -from configuration import ConfigurationSoilmask - -# The template file name for Dockerfile -DOCKERFILE_TEMPLATE_FILE_NAMES = ["Dockerfile.template"] - -# The default docker image to use -DEFAULT_DOCKER_IMAGE = 'agpipeline/gantry-base-image:latest' - - -def determine_base_image() -> str: - """Determines the base image to use in the dockerfile - Return: - The name of the base image to use - """ - parser = argparse.ArgumentParser() - - parser.add_argument('base_image', nargs='?', default=DEFAULT_DOCKER_IMAGE, - help='the docker image to use as the base for this transformer') - - args = parser.parse_args() - - return args.base_image - - -def generate_dockerfile(base_image_name: str) -> None: - """Generates a Dockerfile file using the configured information - """ - # pylint: disable=global-statement - global DOCKERFILE_TEMPLATE_FILE_NAMES - - missing = [] - if not hasattr(ConfigurationSoilmask, 'transformer_name') or not ConfigurationSoilmask.transformer_name: - missing.append("Transformer name") - if not hasattr(ConfigurationSoilmask, 'author_name') or not ConfigurationSoilmask.author_name: - missing.append("Author name") - if not hasattr(ConfigurationSoilmask, 'author_email') or not ConfigurationSoilmask.author_email: - missing.append("Author email") - if missing: - raise RuntimeError("One or more configuration fields aren't defined in configuration.py: " \ - + ", ".join(missing)) - - for template_name in DOCKERFILE_TEMPLATE_FILE_NAMES: - template = [line.rstrip('\n') for line in open(template_name, "r")] - template_len = len('.template') - dockerfile_name = template_name[:(template_len * -1)] - with open(dockerfile_name, 'w') as out_file: - for line in template: - if line.startswith('LABEL maintainer='): - out_file.write("LABEL maintainer=\"{0} <{1}>\"\n".format(ConfigurationSoilmask.author_name, \ - ConfigurationSoilmask.author_email)) - elif line.startswith('FROM base-image'): - out_file.write("FROM {0}\n".format(base_image_name)) - else: - out_file.write("{0}\n".format(line)) - - -# Make the call to generate the file -if __name__ == "__main__": - print('Configuring Dockerfile') - BASE = determine_base_image() - print('Using base image "%s"' % BASE) - generate_dockerfile(BASE)