Skip to content

Commit 09becd9

Browse files
authored
Merge pull request ITHACA-FV#610 from giovastabile/update_submodules
ENH: adding new workflow for OF2412 with dockerfile
2 parents 04cad0d + 0294987 commit 09becd9

4 files changed

Lines changed: 78 additions & 0 deletions

File tree

.compileOF2412.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
docker pull ithacafv/openfoam2412-muq2-pytorch
3+
docker run -ti -d --name foam2412 -v "${PWD}":/home/ofuser/app:rw ithacafv/openfoam2412-muq2-pytorch /bin/bash
4+
docker exec foam2412 /bin/bash -c "source /usr/lib/openfoam/openfoam2412/etc/bashrc; cd /home/ofuser/app; source etc/bashrc; git submodule update --init; ./Allwmake -taumq"

.github/workflows/of2412.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: OF2412
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
include:
17+
- name: "OpenFOAM 2412"
18+
install: "cd ."
19+
compile: ./.compileOF2412.sh
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v1
24+
- name: install OF
25+
run: ${{ matrix.install}}
26+
- name: make
27+
run: ${{ matrix.compile}}

dockerfiles/OF2412/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Start from the ubuntu Openfoam 2106 image
2+
FROM opencfd/openfoam-dev:2412
3+
USER root
4+
ARG PYTHON_VERSION=3.7
5+
ENV PATH="/root/miniconda3/bin:${PATH}"
6+
7+
RUN rm /etc/apt/sources.list.d/openfoam.list && \
8+
cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
9+
grep -v -e "openfoam" /etc/apt/sources.list.backup > /etc/apt/sources.list && \
10+
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
11+
apt-get update && \
12+
apt-get install -yy -q pwgen npm nodejs cmake git wget bzip2 unzip && \
13+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
14+
15+
# Anaconda installing
16+
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
17+
bash Miniconda3-latest-Linux-x86_64.sh -b && \
18+
rm Miniconda3-latest-Linux-x86_64.sh && \
19+
. /root/miniconda3/etc/profile.d/conda.sh && \
20+
export PATH=/root/miniconda3/bin:$PATH && \
21+
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.7.1%2Bcpu.zip && \
22+
unzip libtorch-cxx11-abi-shared-with-deps-2.7.1+cpu.zip && \
23+
rm libtorch-cxx11-abi-shared-with-deps-2.7.1+cpu.zip && \
24+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
25+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \
26+
conda install -y -c conda-forge muq cmake && \
27+
conda clean -y --all
28+
ENV TORCH_LIBRARIES=/libtorch
29+
ENV MUQ_LIBRARIES=/root/miniconda3
30+
RUN echo 'source /usr/lib/openfoam/openfoam2412/etc/bashrc' >> ~/.bashrc
31+

dockerfiles/OF2412/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ME=$(shell whoami)
2+
clean:
3+
rm -f hello
4+
5+
build:
6+
docker build --build-arg myuser=$(shell whoami) --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t ithacafv/openfoam2412 -f ./Dockerfile .
7+
8+
run: build
9+
xhost +"local:docker" && \
10+
docker run -ti --rm \
11+
-v "${HOME}:/home/${ME}" \
12+
-e DISPLAY=${DISPLAY} \
13+
--security-opt seccomp=unconfined \
14+
ubuntu-apc
15+
16+

0 commit comments

Comments
 (0)