Skip to content

Commit d2f3e85

Browse files
committed
Initial commit
0 parents  commit d2f3e85

61 files changed

Lines changed: 14904 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.git
2+
.gitignore
3+
parameters.json
4+
hyperparameter_search.json
5+
setup.cfg
6+
.pylintrc
7+
.vulture_whitelist.py
8+
.pytype
9+
.ipynb_checkpoints
10+
*/.ipynb_checkpoints
11+
__pycache__
12+
*.egg-info
13+
./docker_images
14+
build_docker.sh
15+
run_docker.sh
16+
.cache

.github/workflows/dockerimage.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Docker
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
schedule:
10+
- cron: '23 8 * * *'
11+
push:
12+
branches: [ main ]
13+
# Publish semver tags as releases.
14+
tags: [ 'v*.*.*' ]
15+
pull_request:
16+
branches: [ main ]
17+
18+
env:
19+
# Use docker.io for Docker Hub if empty
20+
REGISTRY: ghcr.io
21+
# github.repository as <account>/<repo>
22+
IMAGE_NAME: ${{ github.repository }}
23+
24+
25+
jobs:
26+
build:
27+
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
# This is used to complete the identity challenge
33+
# with sigstore/fulcio when running outside of PRs.
34+
id-token: write
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Install the cosign tool except on PR
41+
# https://github.com/sigstore/cosign-installer
42+
- name: Install cosign
43+
if: github.event_name != 'pull_request'
44+
uses: sigstore/cosign-installer@1e95c1de343b5b0c23352d6417ee3e48d5bcd422
45+
with:
46+
cosign-release: 'v1.4.0'
47+
48+
49+
# Workaround: https://github.com/docker/build-push-action/issues/461
50+
- name: Setup Docker buildx
51+
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
52+
53+
# Login against a Docker registry except on PR
54+
# https://github.com/docker/login-action
55+
- name: Log into registry ${{ env.REGISTRY }}
56+
if: github.event_name != 'pull_request'
57+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
58+
with:
59+
registry: ${{ env.REGISTRY }}
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
63+
# Extract metadata (tags, labels) for Docker
64+
# https://github.com/docker/metadata-action
65+
- name: Extract Docker metadata
66+
id: meta
67+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
68+
with:
69+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
70+
71+
# Build and push Docker image with Buildx (don't push on PR)
72+
# https://github.com/docker/build-push-action
73+
- name: Build and push Docker image
74+
id: build-and-push
75+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
76+
with:
77+
context: .
78+
push: ${{ github.event_name != 'pull_request' }}
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
82+
# Sign the resulting Docker image digest except on PRs.
83+
# This will only write to the public Rekor transparency log when the Docker
84+
# repository is public to avoid leaking data. If you would like to publish
85+
# transparency data even for private images, pass --force to cosign below.
86+
# https://github.com/sigstore/cosign
87+
- name: Sign the published Docker image
88+
if: ${{ github.event_name != 'pull_request' }}
89+
env:
90+
COSIGN_EXPERIMENTAL: "true"
91+
# This step uses the identity token to provision an ephemeral certificate
92+
# against the sigstore community Fulcio instance.
93+
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}

.github/workflows/test.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
statictest:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.6]
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
19+
- name: Install poetry
20+
run: curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
21+
22+
- name: Set up cache
23+
uses: actions/cache@v1
24+
with:
25+
path: .venv
26+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
27+
28+
- name: Install dependencies
29+
run: |
30+
export RPY2_CFFI_MODE=ABI
31+
source "$HOME/.poetry/env"
32+
poetry config virtualenvs.in-project true
33+
poetry install --no-root
34+
35+
36+
- name: Run checks
37+
run: |
38+
source "$HOME/.poetry/env"
39+
$HOME/.poetry/bin/poetry run pylint discern ray_hyperpara.py
40+
$HOME/.poetry/bin/poetry run vulture
41+
$HOME/.poetry/bin/poetry run yapf -r --diff discern
42+
$HOME/.poetry/bin/poetry run mypy --ignore-missing-imports discern ray_hyperpara.py
43+
44+
test:
45+
runs-on: ubuntu-18.04
46+
strategy:
47+
matrix:
48+
python-version: [3.6]
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
- name: Set up Python ${{ matrix.python-version }}
53+
uses: actions/setup-python@v1
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
57+
- name: Install poetry
58+
run: curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
59+
60+
- name: Set up cache
61+
uses: actions/cache@v1
62+
with:
63+
path: .venv
64+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
65+
66+
- name: Install dependencies
67+
run: |
68+
source "$HOME/.poetry/env"
69+
poetry config virtualenvs.in-project true
70+
poetry install
71+
72+
73+
- name: Run checks
74+
run: |
75+
source "$HOME/.poetry/env"
76+
poetry run poetry check
77+
poetry run pip check
78+
$HOME/.poetry/bin/poetry run pytest --cov-report=term --cov=discern --junitxml=report.xml
79+

.gitignore

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
2+
# Created by https://www.gitignore.io/api/python,jupyternotebooks
3+
# Edit at https://www.gitignore.io/?templates=python,jupyternotebooks
4+
5+
### JupyterNotebooks ###
6+
# gitignore template for Jupyter Notebooks
7+
# website: http://jupyter.org/
8+
9+
.ipynb_checkpoints
10+
*/.ipynb_checkpoints/*
11+
12+
# IPython
13+
profile_default/
14+
ipython_config.py
15+
16+
# Remove previous ipynb_checkpoints
17+
# git rm -r .ipynb_checkpoints/
18+
19+
### Python ###
20+
# Byte-compiled / optimized / DLL files
21+
__pycache__/
22+
*.py[cod]
23+
*$py.class
24+
25+
# C extensions
26+
*.so
27+
*.c
28+
*.cpp
29+
30+
# Distribution / packaging
31+
.Python
32+
build/
33+
develop-eggs/
34+
dist/
35+
downloads/
36+
eggs/
37+
.eggs/
38+
lib/
39+
lib64/
40+
parts/
41+
sdist/
42+
var/
43+
wheels/
44+
pip-wheel-metadata/
45+
share/python-wheels/
46+
*.egg-info/
47+
.installed.cfg
48+
*.egg
49+
MANIFEST
50+
51+
# PyInstaller
52+
# Usually these files are written by a python script from a template
53+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
54+
*.manifest
55+
*.spec
56+
57+
# Installer logs
58+
pip-log.txt
59+
pip-delete-this-directory.txt
60+
61+
# Unit test / coverage reports
62+
htmlcov/
63+
.tox/
64+
.nox/
65+
.coverage
66+
.coverage.*
67+
.cache
68+
nosetests.xml
69+
coverage.xml
70+
*.cover
71+
.hypothesis/
72+
.pytest_cache/
73+
74+
# Translations
75+
*.mo
76+
*.pot
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
doc/_build/
83+
84+
# PyBuilder
85+
target/
86+
87+
# pyenv
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# celery beat schedule file
98+
celerybeat-schedule
99+
100+
# SageMath parsed files
101+
*.sage.py
102+
103+
# Spyder project settings
104+
.spyderproject
105+
.spyproject
106+
107+
# Rope project settings
108+
.ropeproject
109+
110+
# Mr Developer
111+
.mr.developer.cfg
112+
.project
113+
.pydevproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
.dmypy.json
121+
dmypy.json
122+
123+
# Pyre type checker
124+
.pyre/
125+
126+
# End of https://www.gitignore.io/api/python,jupyternotebooks
127+
128+
/report.xml

.readthedocs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file
2+
3+
# Required
4+
version: 2
5+
6+
# Build documentation in the docs/ directory with Sphinx
7+
sphinx:
8+
configuration: doc/source/conf.py
9+
10+
# Build documentation with MkDocs
11+
#mkdocs:
12+
# configuration: mkdocs.yml
13+
14+
# Optionally build your docs in additional formats such as PDF and ePub
15+
formats: all
16+
17+
# Optionally set the version of Python and requirements required to build your docs
18+
python:
19+
version: "3.6"
20+
install:
21+
- method: pip
22+
path: .

.vulture_whitelist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exc_type # unused variable
2+
exc_value # unused variable
3+
traceback # unused variable

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM tensorflow/tensorflow:2.1.0-gpu-py3 as builder
2+
3+
ENV LC_ALL C.UTF-8
4+
ENV TZ=Europe/Berlin
5+
6+
ENV PYTHONFAULTHANDLER=1 \
7+
PYTHONUNBUFFERED=1 \
8+
PYTHONHASHSEED=random \
9+
PIP_NO_CACHE_DIR=off \
10+
PIP_DISABLE_PIP_VERSION_CHECK=on \
11+
PIP_DEFAULT_TIMEOUT=100 \
12+
NUMBA_CACHE_DIR=/tmp \
13+
POETRY_VIRTUALENVS_CREATE=false \
14+
OMP_NUM_THREADS=4 \
15+
NUMBA_NUM_THREADS=4 \
16+
PATH="$PATH:$HOME/.poetry/bin"
17+
18+
RUN apt update && apt-get install -y git && apt-get clean
19+
20+
RUN mkdir /data
21+
WORKDIR /data
22+
RUN ulimit -c 0
23+
24+
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
25+
26+
COPY ./pyproject.toml ./poetry.lock /data/
27+
RUN $HOME/.poetry/bin/poetry install --no-dev --no-interaction --no-root
28+
29+
FROM builder
30+
COPY ./ /data/
31+
RUN $HOME/.poetry/bin/poetry install --no-dev --no-interaction

0 commit comments

Comments
 (0)