Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from Sage-Bionetworks-Workflows/bgrande/WORKFLO…
Browse files Browse the repository at this point in the history
…WS-439/dockerfile

[WORKFLOWS-447] Create Dockerfile for `sagetasks`
  • Loading branch information
Bruno Grande authored Aug 19, 2022
2 parents 7942017 + fae39b5 commit 4d7d27f
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .dockerignore
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GitHub Actions configuration
# Reference: https://docs.github.com/en/actions

name: tests
name: Test Python package and publish releases

on:
push:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/docker.yml
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 }}
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

name: Deploy Sphinx docs to GitHub Pages

on:
# Runs on pushes targeting the default branch
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
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" ]

0 comments on commit 4d7d27f

Please sign in to comment.