Skip to content

Commit

Permalink
added gh workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonjacobs1 committed Mar 21, 2024
1 parent c9f2b40 commit cd81a56
Show file tree
Hide file tree
Showing 9 changed files with 604 additions and 490 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
push:
branches: [ "master" ]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: histotools/HistoQC

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Dockerfile for HistoQC.
#
# This Dockerfile uses two stages. In the first, the project's python dependencies are
# installed. This requires a C compiler. In the second stage, the HistoQC directory and
# the python environment are copied over. We do not require a C compiler in the second
Expand All @@ -19,16 +18,23 @@ RUN python -m venv venv \
# We force this so there is no error even if the dll does not exist.
&& rm -f libopenslide-0.dll

FROM python:3.8-slim
FROM rayproject/ray-ml:latest-gpu
ARG DEBIAN_FRONTEND=noninteractive
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libopenslide0 \
libtk8.6 \
procps \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/HistoQC
COPY --from=builder /opt/HistoQC/ .
ENV PATH="/opt/HistoQC/venv/bin:$PATH"

RUN pip install .

USER ray
WORKDIR /data

# CMD ["bash"]
CMD [ "python", "-m", "histoqc", "--help" ]
Loading

0 comments on commit cd81a56

Please sign in to comment.