Skip to content

Commit

Permalink
add docker release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
carueda committed Feb 1, 2024
1 parent 06afdf2 commit 2ccbfb7
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 4 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and publish docker images

on:
push:
tags:
- 'v*'

jobs:
build_and_push_ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v3
with:
images: mbari/pbp
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile-minimal
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build_and_push_macos_14:
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v3
with:
images: mbari/pbp
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile-minimal
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
20 changes: 20 additions & 0 deletions docker/Dockerfile-minimal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM quay.io/jupyter/minimal-notebook:latest

WORKDIR /opt/pbp

# TODO both PyPAM and PBP should be installed from published packages.
# For now, grabbing the latest from their repos.
RUN git clone https://github.com/mbari-org/pypam-based-processing.git \
&& cd pypam-based-processing \
&& pip install -r requirements.txt \
&& pip install git+https://github.com/lifewatch/pypam.git

USER root
RUN apt-get update && apt-get install -y libsox-fmt-all libsox-dev
RUN chown -R jovyan /opt/pbp
USER jovyan

ENV PYTHONPATH /opt/pbp:/opt/pbp/pypam-based-processing
EXPOSE 8899

CMD ["/opt/conda/bin/jupyter", "notebook", "--notebook-dir=/opt/pbp", "--ip='*'","--port=8899","--no-browser", "--allow-root"]
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ plot *args:
##############
# docker:

dockerize-for-notebooks:
docker build -f docker/Dockerfile -t mbari/pbp .
dockerize-for-notebooks dockerfile='docker/Dockerfile-minimal':
docker build -f {{dockerfile}} -t mbari/pbp .

run-docker-for-notebooks:
docker run -it --rm -p 8899:8899 mbari/pbp
run-docker-for-notebooks dir='notebooks':
docker run -it --rm -p 8899:8899 -v {{dir}}:/opt/pbp/notebooks mbari/pbp


##############
Expand Down

0 comments on commit 2ccbfb7

Please sign in to comment.