This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Sage-Bionetworks-Workflows/bgrande/WORKFLO…
…WS-439/dockerfile [WORKFLOWS-447] Create Dockerfile for `sagetasks`
- Loading branch information
Showing
5 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Temporary and binary files | ||
*~ | ||
*.py[cod] | ||
*.so | ||
*.cfg | ||
!.isort.cfg | ||
!setup.cfg | ||
*.orig | ||
*.log | ||
*.pot | ||
__pycache__/* | ||
.cache/* | ||
.*.swp | ||
*/.ipynb_checkpoints/* | ||
.DS_Store | ||
|
||
# Project files | ||
.ropeproject | ||
.project | ||
.pydevproject | ||
.settings | ||
.idea | ||
.vscode | ||
tags | ||
.env | ||
|
||
# Package files | ||
*.egg | ||
*.eggs/ | ||
.installed.cfg | ||
*.egg-info | ||
|
||
# Unittest and coverage | ||
htmlcov/* | ||
.coverage | ||
.coverage.* | ||
.tox | ||
junit*.xml | ||
coverage.xml | ||
.pytest_cache/ | ||
|
||
# Build and docs folder/files | ||
build/* | ||
dist/* | ||
sdist/* | ||
docs/api/* | ||
docs/_rst/* | ||
docs/_build/* | ||
cover/* | ||
MANIFEST | ||
|
||
# Per-project virtualenvs | ||
.venv*/ | ||
.conda*/ | ||
.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow builds and pushes the docker image using docker's v2 action | ||
# which requires explicitly setting up buildx and logging in | ||
|
||
name: Build and publish container to Docker Hub | ||
|
||
on: | ||
push: | ||
tags: ['v[0-9]*', '[0-9]+.[0-9]+*'] # Match tags that resemble a version | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_ORG: sagebionetworks | ||
DOCKER_REPO: sagetasks | ||
DOCKER_TAG: ${{ github.ref_name }} | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
${{ env.DOCKER_ORG }}/{{ env.DOCKER_REPO }}:latest | ||
${{ env.DOCKER_ORG }}/{{ env.DOCKER_REPO }}:{{ env.DOCKER_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.10.6 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ARG PSEUDO_VERSION=1 | ||
|
||
RUN pip install --no-cache-dir pipenv | ||
|
||
COPY setup.* Pipfile* ./ | ||
COPY src ./src/ | ||
|
||
RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SAGETASKS=${PSEUDO_VERSION} \ | ||
pipenv install --system | ||
|
||
RUN --mount=source=.git,target=.git,type=bind \ | ||
pipenv install --system | ||
|
||
CMD [ "python", "-c", "import sagetasks" ] |