Skip to content

Commit

Permalink
Merge pull request #112 from uc-cdis/feat/add-vlmd-submission-tools-cli
Browse files Browse the repository at this point in the history
Feat/add vlmd submission tools cli
  • Loading branch information
george42-ctds authored Aug 29, 2023
2 parents 046e2bb + 7b73b7a commit b85db34
Show file tree
Hide file tree
Showing 27 changed files with 2,484 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build_vlmd_submission_python_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build Python Image and Push to Quay and ECR

on:
push:
paths:
- vlmd-submission-tools/**
- .github/workflows/build_vlmd_submission_python_image.yml

jobs:
ci:
name: Build Image and Push to Quay
uses: uc-cdis/.github/.github/workflows/image_build_push.yaml@master
with:
DOCKERFILE_LOCATION: "./vlmd-submission-tools/Dockerfile"
DOCKERFILE_BUILD_CONTEXT: "./vlmd-submission-tools"
OVERRIDE_REPO_NAME: "vlmd-submission-tools"
OVERRIDE_TAG_NAME: "vlmd-submission-tools-$(echo ${GITHUB_REF#refs/*/} | tr / _)"
secrets:
ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_ROBOT_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/ci_vlmd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI Workflow

on:
push:
branches:
- master
paths:
- vlmd-submission-tools/
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles(format('{0}{1}', github.workspace, '/poetry.lock')) }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
working-directory: ./vlmd-submission-tools
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: Test with unittest
working-directory: ./vlmd-submission-tools
run: |
poetry run python -m unittest discover -v -s tests/
2 changes: 2 additions & 0 deletions vlmd-submission-tools/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
venv/*
.git/*
131 changes: 131 additions & 0 deletions vlmd-submission-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
vlmd_submission_tools/common/*cred*.json

# 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/
pip-wheel-metadata/
share/python-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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# 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/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
27 changes: 27 additions & 0 deletions vlmd-submission-tools/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
default_stages: [commit, push]

repos:
- repo: [email protected]:Yelp/detect-secrets
rev: v1.2.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, develop, --branch, master, --branch, main, --pattern, release/.*]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
14 changes: 14 additions & 0 deletions vlmd-submission-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM quay.io/cdis/python:python3.9-buster-master

RUN pip install --upgrade pip poetry

WORKDIR /opt
COPY poetry.lock /opt/
COPY pyproject.toml /opt/
COPY vlmd_submission_tools/__main__.py /opt/vlmd_submission_tools/__main__.py
RUN python -m venv /env \
&& . /env/bin/activate \
&& poetry install --only main --no-interaction
COPY . /opt/

ENTRYPOINT ["/env/bin/vlmd-submission-tools"]
Loading

0 comments on commit b85db34

Please sign in to comment.