Skip to content

Commit

Permalink
Add GitHub Actions workflow for Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Nov 23, 2023
1 parent acb9c7b commit f5c7fb0
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
58 changes: 58 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Create and publish Docker images

on:
push: { branches: [ unstable ] }
pull_request: { branches: [ unstable ] }
workflow_call:
workflow_dispatch:

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

strategy:
fail-fast: false
matrix:
include:
- name: github_ci
#- name: jenkins_ci # flatironinstitute/cthyb:master-ubuntu-clang not accessible
#- name: mpich # outdated dependencies (GCC too old, need to install LLVM)
- name: openmpi
#- name: triqs_default # flatironinstitute/triqs:unstable-ubuntu-clang not accessible

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}_${{ matrix.name }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./Docker
file: ./Docker/${{ matrix.name }}_dockerfile
build-args: |
NCORES=2
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 3 additions & 0 deletions Docker/github_ci_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ ENV CPATH=/triqs/include:${CPATH} \
LD_LIBRARY_PATH=/triqs/lib:${LD_LIBRARY_PATH} \
PYTHONPATH=/triqs/lib/python3.10/site-packages:${PYTHONPATH} \
CMAKE_PREFIX_PATH=/triqs/share/cmake:${CMAKE_PREFIX_PATH} \
CMAKE_BUILD_PARALLEL_LEVEL=${NCORES} \
CTEST_OUTPUT_ON_FAILURE=1 \
CTEST_PARALLEL_LEVEL=${NCORES} \
TRIQS_ROOT=/triqs

RUN cd /source && git clone -b unstable --depth 1 https://github.com/TRIQS/triqs \
Expand Down
5 changes: 4 additions & 1 deletion Docker/openmpi_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,15 @@ RUN cd /source && wget --quiet https://gitlab.com/QEF/q-e/-/archive/qe-7.2/q-e-q
#ENV PATH=/vasp/bin:${PATH}

# triqs
ENV CPATH=/triqs/include:${CPATH} \
ENV CPATH=/triqs/include:/usr/include/mkl:${CPATH} \
PATH=/triqs/bin:${PATH} \
LIBRARY_PATH=/triqs/lib:${LIBRARY_PATH} \
LD_LIBRARY_PATH=/triqs/lib:${LD_LIBRARY_PATH} \
PYTHONPATH=/triqs/lib/python3.10/site-packages:${PYTHONPATH} \
CMAKE_PREFIX_PATH=/triqs/share/cmake:${CMAKE_PREFIX_PATH} \
CMAKE_BUILD_PARALLEL_LEVEL=${NCORES} \
CTEST_OUTPUT_ON_FAILURE=1 \
CTEST_PARALLEL_LEVEL=${NCORES} \
TRIQS_ROOT=/triqs

RUN cd /source && git clone -b unstable --depth 1 https://github.com/TRIQS/triqs triqs.src \
Expand Down

0 comments on commit f5c7fb0

Please sign in to comment.