Skip to content

Commit

Permalink
Updating dockerfile for building the solver.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodoni committed Oct 10, 2024
1 parent 6614305 commit 9d52f39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/docker_solver_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
with:
install: true

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to DockerHub as simvascular
uses: docker/login-action@v2
with:
Expand All @@ -40,12 +32,4 @@ jobs:
context: .
file: ./Docker/solver/dockerfile
push: true
tags: simvascular/solver:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move new cache to old cache
if: always()
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
tags: simvascular/solver:latest
21 changes: 1 addition & 20 deletions Docker/solver/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,7 @@ RUN cmake -DSV_PETSC_DIR:STRING=/petsc .. &&\
# FINAL IMAGE with solver executable
FROM simvascular/libraries:ubuntu22 AS final

#Set arguments:
# BUILD: build type (petsc, trilinos, none)
# TASKS: number of tasks to run in parallel
# INPUT: input file to run the solver

ENV BUILD=none
ENV TASKS=2
ENV INPUT="svFSIplus.xml"

COPY --from=builder /svFSIplus/build-petsc /build-petsc
COPY --from=builder /svFSIplus/build-trilinos /build-trilinos
COPY --from=builder /svFSIplus/build-trilinos /build-none

# Set the working directory to where input files are mounted
WORKDIR /mnt

# Set entrypoint to run the solver when the container starts and checks if BUILD has the correct value
ENTRYPOINT ["sh", "-c", "\
if [ \"${BUILD}\" != \"none\" ] && [ \"${BUILD}\" != \"petsc\" ] && [ \"${BUILD}\" != \"trilinos\" ]; then \
echo \"Invalid BUILD value: ${BUILD}\" >&2; \
exit 1; \
fi; \
mpirun -n ${TASKS} /build-${BUILD}/svFSI-build/bin/svFSI ${INPUT}"]
WORKDIR /

0 comments on commit 9d52f39

Please sign in to comment.