Skip to content

Commit 34ed776

Browse files
Adding Docker Support
1 parent 1c45a30 commit 34ed776

File tree

5 files changed

+47
-134
lines changed

5 files changed

+47
-134
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,6 @@ name: CD
22

33
on: [push, workflow_dispatch]
44

5-
env:
6-
REGISTRY: ghcr.io
7-
IMAGE_NAME: ${{ github.repository }}
8-
9-
#jobs:
10-
# build-and-push-image:
11-
# runs-on: ubuntu-latest
12-
# permissions:
13-
# contents: read
14-
# packages: write
15-
#
16-
# steps:
17-
# - name: Checkout repository
18-
# uses: actions/checkout@v4
19-
#
20-
# - name: Log in to the Container registry
21-
# uses: docker/login-action@v3
22-
# with:
23-
# registry: ${{ env.REGISTRY }}
24-
# username: ${{ github.actor }}
25-
# password: ${{ secrets.GITHUB_TOKEN }}
26-
#
27-
# - name: Extract metadata (tags, labels) for Docker
28-
# id: meta
29-
# uses: docker/metadata-action@v5
30-
# with:
31-
# images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
32-
#
33-
# - name: Build and push Docker image
34-
# uses: docker/build-push-action@v5
35-
# with:
36-
# context: .
37-
# push: true
38-
# tags: ${{ steps.meta.outputs.tags }}
39-
# labels: ${{ steps.meta.outputs.labels }}
40-
415
jobs:
426
native-build:
437
name:
@@ -147,7 +111,7 @@ jobs:
147111
run: |
148112
cd build
149113
./conanbuild.ps1
150-
cmake -B . -S .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Debug -DOPTION_EXTRA_CONFIG_INFO=ON
114+
cmake -B . -S .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Debug
151115
cmake --build . --config Release
152116
153117
- name: Build Unix
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: docker-deploy
2+
3+
on: [push, release]
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
8+
9+
jobs:
10+
build-and-push-image:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Log in to the Container registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ${{ env.REGISTRY }}
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Extract metadata (tags, labels) for Docker
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
with:
31+
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
32+
33+
- name: Build and push Docker image
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,14 @@
1-
FROM python:3.10.15-slim AS build
1+
FROM bookworm-slim AS build
22

33
RUN apt-get -y update && apt-get install -y apt-utils && \
4-
apt-get install -y -qq -o=Dpkg::Use-Pty=0 build-essential gfortran zlib1g-dev \
5-
libhdf5-dev libcurl4-openssl-dev libboost-dev cmake wget python3 python3-pip
4+
apt-get install -y -qq -o=Dpkg::Use-Pty=0 clang mold ninja cmake libc++-dev libc++abi-dev libcurl4-openssl-dev wget python3 python3-pip
65

76
COPY . /vcellroot
87

98
RUN mkdir -p /vcellroot/build/bin
109
WORKDIR /vcellroot/build
1110

12-
RUN /usr/bin/cmake \
13-
-DOPTION_TARGET_MESSAGING=ON \
14-
-DOPTION_TARGET_PARALLEL=OFF \
15-
-DOPTION_TARGET_PETSC=OFF \
16-
-DOPTION_TARGET_CHOMBO2D_SOLVER=OFF \
17-
-DOPTION_TARGET_CHOMBO3D_SOLVER=OFF \
18-
-DOPTION_TARGET_SMOLDYN_SOLVER=ON \
19-
-DOPTION_TARGET_FV_SOLVER=ON \
20-
-DOPTION_TARGET_STOCHASTIC_SOLVER=ON \
21-
-DOPTION_TARGET_NFSIM_SOLVER=ON \
22-
-DOPTION_TARGET_MOVINGBOUNDARY_SOLVER=ON \
23-
-DOPTION_TARGET_SUNDIALS_SOLVER=ON \
24-
-DOPTION_TARGET_HY3S_SOLVERS=OFF \
25-
.. && \
26-
make && \
27-
ctest -VV
11+
RUN /usr/bin/cmake .. -G Ninja -DOPTION_TARGET_MESSAGING=ON -DOPTION_TARGET_DOCS=OFF && ninja && ctest -VV
2812

29-
FROM eclipse-temurin:17 AS jre-build
30-
31-
# Create a custom Java runtime
32-
RUN $JAVA_HOME/bin/jlink \
33-
--add-modules ALL-MODULE-PATH \
34-
--strip-debug \
35-
--no-man-pages \
36-
--no-header-files \
37-
--compress=2 \
38-
--output /javaruntime
39-
40-
# Define base image and copy in jlink created minimal Java 17 environment
41-
FROM python:3.10.15-slim
42-
ENV JAVA_HOME=/opt/java/openjdk
43-
ENV PATH="${JAVA_HOME}/bin:${PATH}"
44-
COPY --from=jre-build /javaruntime $JAVA_HOME
45-
46-
# now we have Java 17 and Python 3.10.15 installed
47-
ENV DEBIAN_FRONTEND=noninteractive
48-
ENV LANG=en_US.UTF-8
49-
50-
RUN apt-get -y update && \
51-
apt-get install -y apt-utils && \
52-
apt-get install -q -y --no-install-recommends curl dnsutils
53-
54-
RUN apt-get install -y -qq -o=Dpkg::Use-Pty=0 gcc gfortran zlib1g \
55-
libhdf5-103 libhdf5-cpp-103 libcurl4-openssl-dev zip
56-
57-
COPY --from=build /vcellroot/build/bin /vcellbin
58-
59-
WORKDIR /vcellbin
60-
ENV PATH=/vcellbin:$PATH
13+
WORKDIR /vcellroot/build/bin
14+
ENV PATH="/vcellroot/build/bin:${PATH}"

Dockerfile-PETSc

Lines changed: 0 additions & 44 deletions
This file was deleted.

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def requirements(self):
3636
def build_requirements(self):
3737
self.tool_requires("cmake/[>=3.13]")
3838
self.tool_requires("ninja/[>=1.12.1]")
39-
if self.settings.os == "Linux":
40-
self.tool_requires("llvm-core/19.1.7")
39+
# if self.settings.os == "Linux":
40+
# self.tool_requires("llvm-core/19.1.7")
4141

4242
def config_options(self):
4343
# if self.settings.os == "Linux":

0 commit comments

Comments
 (0)