Skip to content

Revised Dockerfile and CI, especially added multi-platform support #715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 15 additions & 7 deletions .github/workflows/Dockerfile.archlinux
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# Base Dockerfile for using Storm on Archlinux
##############################################
# Dockerfile for Storm on Archlinux
###################################
# The Docker image can be built by executing:
# docker build -t yourusername/storm .
# A different base image can be set from the commandline with:
# --build-arg BASE_IMAGE=<new_base_image>

FROM archlinux:latest
MAINTAINER Matthias Volk <[email protected]>
# Set base image
ARG BASE_IMAGE=archlinux:latest
FROM $BASE_IMAGE
LABEL org.opencontainers.image.authors="[email protected]"


# Configuration arguments
#########################
# The arguments can be set from the commandline with:
# --build-arg <arg_name>=<value>

# Specify configurations
# These configurations can be set from the commandline with:
# --build-arg <config_name>=<value>
# CMake build type
ARG build_type=Release
# Specify number of threads to use for parallel compilation
Expand All @@ -29,6 +36,7 @@ ARG cmake_args=""
# Additional Archlinux packages
ARG packages=""


# Install dependencies
######################
RUN pacman -Syu --noconfirm # Updates needed as Archlinux is rolling release
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/Dockerfile.doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
##############################################
# The Docker image can be built by executing:
# docker build -t yourusername/storm .
# A different base image can be set from the commandline with:
# --build-arg BASE_IMAGE=<new_base_image>

# Set base image
FROM movesrwth/storm-dependencies:latest
MAINTAINER Matthias Volk <[email protected]>
ARG BASE_IMAGE=movesrwth/storm-dependencies:latest
FROM $BASE_IMAGE
LABEL org.opencontainers.image.authors="[email protected]"


# Configuration arguments
#########################
# The arguments can be set from the commandline with:
# --build-arg <arg_name>=<value>

# Specify configurations
# These configurations can be set from the commandline with:
# --build-arg <config_name>=<value>
# Specify number of threads to use for parallel compilation
ARG no_threads=1

Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Build Test

on:
schedule:
# run daily
- cron: '0 6 * * *'
# run daily
- cron: '0 6 * * *'
# needed to trigger the workflow manually
workflow_dispatch:
pull_request:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:ci . \
--build-arg BASE_IMG=movesrwth/${{ matrix.config.baseImg }} \
--build-arg BASE_IMAGE=movesrwth/${{ matrix.config.baseImg }} \
--build-arg build_type="${{ matrix.config.buildType }}" \
--build-arg gurobi_support="${{ matrix.config.Gurobi }}" \
--build-arg soplex_support="${{ matrix.config.Soplex }}" \
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:ci . \
--build-arg BASE_IMG=movesrwth/storm-basesystem:${{ matrix.distro }} \
--build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ matrix.distro }} \
--build-arg build_type="${{ matrix.buildType }}" \
--build-arg gurobi_support="OFF" \
--build-arg soplex_support="OFF" \
Expand All @@ -220,26 +220,25 @@ jobs:
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure"

macTests:
name: macOS Tests (${{ matrix.config.name }})
name: macOS Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }})
strategy:
matrix:
config:
- {name: "XCode 14.3, Intel, Release",
- {name: "XCode 14.3, Intel",
distro: "macos-13",
xcode: "14.3",
buildType: "Release"
buildType: "Debug"
}
- {name: "XCode 15.4, ARM, Release",
- {name: "XCode 15.4, ARM",
distro: "macos-14",
xcode: "15.4",
buildType: "Release"
buildType: "Debug"
}
- {name: "XCode 16.3, ARM, Release",
- {name: "XCode 16.3, ARM",
distro: "macos-15",
xcode: "16.3",
buildType: "Release"
buildType: "Debug"
}
buildType: ["Release"]
runs-on: ${{ matrix.config.distro }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
Expand Down Expand Up @@ -281,6 +280,7 @@ jobs:
working-directory: ./build
run: ctest test--output-on-failure


deploy:
name: Test and Deploy (${{ matrix.buildType.name }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -308,7 +308,7 @@ jobs:
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:${{ matrix.buildType.dockerTag }} . \
--build-arg BASE_IMG=movesrwth/${{ matrix.buildType.baseImg }} \
--build-arg BASE_IMAGE=movesrwth/${{ matrix.buildType.baseImg }} \
--build-arg build_type="${{ matrix.buildType.name }}" \
--build-arg developer="${{ matrix.buildType.Developer }}" \
--build-arg cmake_args="${{ matrix.buildType.cmakeArgs }}" \
Expand Down Expand Up @@ -336,7 +336,10 @@ jobs:
- name: Login into docker
# Only login if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master'
run: echo "${{ secrets.STORM_CI_DOCKER_PASSWORD }}" | docker login -u "${{ secrets.STORM_CI_DOCKER_USERNAME }}" --password-stdin
uses: docker/login-action@v3
with:
username: ${{ secrets.STORM_CI_DOCKER_USERNAME }}
password: ${{ secrets.STORM_CI_DOCKER_TOKEN }}
- name: Deploy storm
# Only deploy if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/formatapply.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: apply-code-format
name: Apply code format

on: [ workflow_dispatch ]
on:
workflow_dispatch:

jobs:
build:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/formatcheck.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: check-code-format
name: Check code format

on: [push, pull_request, workflow_dispatch]
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
Expand Down
127 changes: 104 additions & 23 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Release Docker
# Builds and deploys images to Dockerhub
# Builds Storm and deploys images to Dockerhub
# Build is distributed across multiple runners based on:
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners

on:
on:
# needed to trigger the workflow manually
workflow_dispatch:
inputs:
tag:
Expand All @@ -10,45 +13,123 @@ on:
default: 'x.y.z'

env:
IMAGE: movesrwth/storm
# GitHub runners currently have 4 cores
NR_JOBS: "4"

jobs:
deploy:
name: Deploy (${{ matrix.buildType.name }})
runs-on: ubuntu-latest
build:
name: Build ${{ matrix.image.tag }} on ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
buildType:
- {name: "Debug",
suffix: "-debug",
Developer: "ON"
image:
- {tag: "${{ github.event.inputs.tag }}-debug",
baseImg: "movesrwth/storm-dependencies:latest-debug",
file: "Dockerfile",
buildType: "Debug",
developer: "ON"
}
- {name: "Release",
suffix: "",
Developer: "OFF"
- {tag: "${{ github.event.inputs.tag }}",
baseImg: "movesrwth/storm-dependencies:latest",
file: "Dockerfile",
buildType: "Release",
developer: "OFF"
}
platform:
- {name: linux/amd64, runner: "ubuntu-latest"}
- {name: linux/arm64, runner: "ubuntu-24.04-arm"}
steps:
- name: Git clone
uses: actions/checkout@v4
- name: Build storm from Dockerfile
- name: Prepare
# Sanitize platform name
run: |
docker build -t movesrwth/storm:${{ github.event.inputs.tag }}${{ matrix.buildType.suffix }} . \
--build-arg BASE_IMG=movesrwth/storm-dependencies:latest${{ matrix.buildType.suffix }} \
--build-arg build_type="${{ matrix.buildType.name }}" \
--build-arg developer="${{ matrix.buildType.Developer }}" \
--build-arg cmake_args="${{ matrix.buildType.cmakeArgs }}" \
--build-arg no_threads=${NR_JOBS}
# Omitting arguments gurobi_support, soplex_support, spot_support, cln_exact, cln_ratfunc, all_sanitizers
platform=${{ matrix.platform.name }}
echo "PLATFORM=${platform//\//-}" >> $GITHUB_ENV
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=raw,${{ matrix.image.tag }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
# Only login if using original repo
if: github.repository_owner == 'moves-rwth'
uses: docker/login-action@v3
with:
username: ${{ secrets.STORM_CI_DOCKER_USERNAME }}
password: ${{ secrets.STORM_CI_DOCKER_TOKEN }}
- name: Deploy storm
# Only deploy if using original repo
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
file: ${{ matrix.image.file }}
# Set build arguments
build-args: |
BASE_IMAGE=${{ matrix.image.baseImg }}
build_type=${{ matrix.image.buildType }}
developer=${{ matrix.image.developer }}
no_threads=${{ env.NR_JOBS }}
# Omitting arguments cmake_args, gurobi_support, soplex_support, spot_support, cln_exact, cln_ratfunc, all_sanitizers
platforms: ${{ matrix.platform.name }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests/${{ matrix.image.tag }}
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${{ matrix.image.tag }}/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.image.tag }}-digests-${{ env.PLATFORM }}
path: ${{ runner.temp }}/digests/${{ matrix.image.tag }}/*
if-no-files-found: error
retention-days: 1

merge:
name: Merge manifests for ${{ matrix.image.tag }}
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
image:
# Must be the same as above
- {tag: "${{ github.event.inputs.tag }}-debug"}
- {tag: "${{ github.event.inputs.tag }}"}
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests/${{ matrix.image.tag }}
pattern: ${{ matrix.image.tag }}-digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=raw,${{ matrix.image.tag }}
- name: Login to Docker Hub
# Only login if using original repo
if: github.repository_owner == 'moves-rwth'
uses: docker/login-action@v3
with:
username: ${{ secrets.STORM_CI_DOCKER_USERNAME }}
password: ${{ secrets.STORM_CI_DOCKER_TOKEN }}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests/${{ matrix.image.tag }}
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< '${{ steps.meta.outputs.json}}') \
$(printf '${{ env.IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker push movesrwth/storm:${{ github.event.inputs.tag }}${{ matrix.buildType.suffix }}
docker buildx imagetools inspect ${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
22 changes: 12 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Base Dockerfile for using Storm
#################################
# Dockerfile for Storm
######################
# The Docker image can be built by executing:
# docker build -t yourusername/storm .
# A different base image can be set from the commandline with:
# --build-arg BASE_IMG=<new_base_image>
# --build-arg BASE_IMAGE=<new_base_image>

# Set base image
ARG BASE_IMG=movesrwth/storm-dependencies:latest
ARG BASE_PLATFORM=linux/amd64
FROM --platform=$BASE_PLATFORM $BASE_IMG
MAINTAINER Matthias Volk <[email protected]>
ARG BASE_IMAGE=movesrwth/storm-dependencies:latest
FROM $BASE_IMAGE
LABEL org.opencontainers.image.authors="[email protected]"


# Configuration arguments
#########################
# The arguments can be set from the commandline with:
# --build-arg <arg_name>=<value>

# Specify configurations
# These configurations can be set from the commandline with:
# --build-arg <config_name>=<value>
# CMake build type
ARG build_type=Release
# Specify number of threads to use for parallel compilation
Expand Down
Loading
Loading