Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker image for latest release

on:
release:
types: [published]

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

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/protopipe-ctadirac

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: ./containers/Docker/Development
file: ./containers/Docker/Release/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 35 additions & 0 deletions .github/workflows/docker_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Docker image for development version

on:
push:
branches:
- master

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

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/protopipe-ctadirac-dev

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: ./containers/Docker/Development
file: ./containers/Docker/Development/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 3 additions & 24 deletions containers/Docker/Development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ===============================================================================

# Define base image
FROM centos:8
FROM fedora:latest

# Define labels
LABEL version="0.1" \
Expand Down Expand Up @@ -45,28 +45,7 @@ RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile \
conda install mamba -n base -c conda-forge \
&& mamba update --all

# ===============================================================================
# PROTOPIPE GRID INTERFACE
# ===============================================================================

# Get latest environment file and create environment
# WARNING: in the final Dockerfile the pull must come from either the
# master branch (development version) or from a tagged release (released version)
WORKDIR /home/cta/protopipe-grid-interface
RUN git clone https://github.com/HealthyPear/protopipe-grid-interface.git .\
&& git pull origin pull/50/head \
&& mamba env create -f environment_development.yaml \
&& echo "conda activate protopipe-CTADIRAC-dev" >> ~/.bashrc \
&& echo "alias ls='ls --color'" >> ~/.bashrc

# ===============================================================================
# PROTOPIPE
# ===============================================================================

# Clone protopipe and install dev version
WORKDIR /home/cta/protopipe
RUN git clone https://github.com/cta-observatory/protopipe.git .\
&& pip install -e '.[all]'

WORKDIR /home/cta/
RUN echo "alias ls='ls --color'" >> ~/.bashrc

ENTRYPOINT ["bash"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ===============================================================================

# Define base image
FROM centos:8
FROM fedora:latest

# Define labels
LABEL version="0.1" \
Expand Down Expand Up @@ -54,9 +54,13 @@ RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile \
# master branch (development version) or from a tagged release (released version)
WORKDIR /home/cta/protopipe-grid-interface
RUN git clone https://github.com/HealthyPear/protopipe-grid-interface.git \
&& git pull origin pull/50/head \
&& git fetch --tags \
&& latestTag=$(git describe --tags `git rev-list --tags --max-count=1`) \
&& git checkout $latestTag \
&& mamba env create -f environment_release.yaml \
&& echo "conda activate protopipe-CTADIRAC-dev" >> ~/.bashrc \
&& conda activate protopipe-CTADIRAC \
&& pip install '.[all]' \
&& echo "conda activate protopipe-CTADIRAC" >> ~/.bashrc \
&& echo "alias ls='ls --color'" >> ~/.bashrc

WORKDIR /home/cta/
Expand Down
3 changes: 1 addition & 2 deletions environment_release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: protopipe-CTADIRAC-latest-release
name: protopipe-CTADIRAC
channels:
- conda-forge
dependencies:
Expand All @@ -17,4 +17,3 @@ dependencies:
- pip:
- protopipe
- CTADIRAC
- git+https://github.com/HealthyPear/[email protected]