Skip to content

Commit

Permalink
Merge pull request #55 from NCI-GDC/feat/binf-726-template
Browse files Browse the repository at this point in the history
[BINF-726] Apply cookiecutter template
  • Loading branch information
czyszCTDS authored Oct 3, 2022
2 parents a47f0ae + 50bbafb commit 3142190
Show file tree
Hide file tree
Showing 12 changed files with 350 additions and 110 deletions.
20 changes: 20 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"template": "[email protected]:NCI-GDC/bio-python-template.git",
"commit": "2538d116b1c2f3cf68b734c5a5179a4fc70acc9f",
"context": {
"cookiecutter": {
"full_name": "Charles Czysz",
"email": "[email protected]",
"github_username": "czyszCTDS",
"project_name": "maf-lib",
"package_name": "maflib",
"project_short_description": "Python package for processing and creating MAF files for the GDC",
"min_python_version": "3.8",
"github_repo": "https://github.com/NCI-GDC/maf-lib",
"commit": "2538d116b1c2f3cf68b734c5a5179a4fc70acc9f",
"_template": "[email protected]:NCI-GDC/bio-python-template.git"
}
},
"directory": null,
"checkout": null
}
110 changes: 110 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
_version.py

# 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/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# 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

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# direnv
.envrc
.direnv/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# VSCode
.vscode/
test-reports/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ ENV/
.vscode/
test-reports/

# Gitlab
# Gitlab CI
vars.env
22 changes: 11 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
Expand Down Expand Up @@ -26,27 +27,26 @@ release:
.python_versions:
parallel:
matrix:
- REPO_PY_VERSION: [python3.8, python3.10]
- REPO_PY_VERSION: [python3.8]

docker_build:
rules:
- when: always
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
variables:
RELEASE_REGISTRY: containers.osdc.io/ncigdc # Override globally-defined RELEASE_REGISTRY
DOCKER_RELEASE_REGISTRY: "quay.io"
- if: $CI_COMMIT_REF_NAME =~ /main/
variables:
RELEASE_REGISTRY: containers.osdc.io/ncigdc
DOCKER_RELEASE_REGISTRY: "quay.io"
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
DOCKER_RELEASE_REGISTRY: "quay.io"
- when: always
script:
- echo "docker build ${DOCKER_BUILD_OPTS} -t ${RELEASE_REGISTRY}/$CI_PROJECT_NAME:$VERSION ."
- echo "docker push ${DOCKER_PUSH_OPTS} ${RELEASE_REGISTRY}/$CI_PROJECT_NAME:$VERSION"
- docker build .
--file ./Dockerfile
${DOCKER_BUILD_OPTS}
--build-arg http_proxy
--build-arg https_proxy
--build-arg BASE_CONTAINER_VERSION
-t ${RELEASE_REGISTRY}/${CI_PROJECT_NAME}:${VERSION}
- docker push ${DOCKER_PUSH_OPTS} ${RELEASE_REGISTRY}/${CI_PROJECT_NAME}:${VERSION}
-t ${DOCKER_RELEASE_REGISTRY}/${CI_PROJECT_NAME}:${VERSION}
- docker push ${DOCKER_PUSH_OPTS} ${DOCKER_RELEASE_REGISTRY}/${CI_PROJECT_NAME}:${VERSION}
100 changes: 82 additions & 18 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{
"exclude": {
"files": null,
"lines": null
},
"generated_at": "2020-07-23T15:23:24Z",
"version": "1.2.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "ArtifactoryDetector"
"name": "AzureStorageKeyDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
Expand All @@ -22,8 +21,11 @@
"name": "CloudantDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3
},
{
"name": "IbmCloudIamDetector"
Expand All @@ -35,32 +37,94 @@
"name": "JwtTokenDetector"
},
{
"keyword_exclude": null,
"name": "KeywordDetector"
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"results": {},
"version": "0.13.1",
"word_list": {
"file": null,
"hash": null
}
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
},
{
"path": "detect_secrets.filters.regex.should_exclude_file",
"pattern": [
"^.secrets.baseline$"
]
}
],
"results": {
".cruft.json": [
{
"type": "Hex High Entropy String",
"filename": ".cruft.json",
"hashed_secret": "7379565c0e0821137830796e10f09f31692c2ad2",
"is_verified": false,
"line_number": 3,
"is_secret": false
}
]
},
"generated_at": "2022-10-03T14:39:09Z"
}
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG REGISTRY=quay.io
ARG REGISTRY=docker.osdc.io
ARG BASE_CONTAINER_VERSION=2.0.1

FROM ${REGISTRY}/ncigdc/python3.8-builder:${BASE_CONTAINER_VERSION} as builder
Expand All @@ -11,14 +11,14 @@ RUN pip install tox && tox -e build

FROM ${REGISTRY}/ncigdc/python3.8:${BASE_CONTAINER_VERSION}

COPY --from=builder /opt/dist/*.tar.gz /opt
COPY requirements.txt /opt
COPY --from=builder /opt/dist/*.whl /opt/
COPY requirements.txt /opt/

WORKDIR /opt

RUN pip install --no-deps -r requirements.txt \
&& pip install --no-deps *.tar.gz \
&& rm -f *.tar.gz requirements.txt
&& pip install --no-deps *.whl \
&& rm -f *.whl requirements.txt

ENTRYPOINT ["maflib"]

Expand Down
Loading

0 comments on commit 3142190

Please sign in to comment.