Skip to content
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

Merging main into runaway electrons #51

Merged
merged 43 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2a6f065
fixed slider int() error
plasmapotential Jan 4, 2024
c6b7101
temporary plasma3Dmask patch
plasmapotential Jan 16, 2024
f42818e
bug fixes for EQ loading and traces
plasmapotential Jan 19, 2024
7a772fc
3D FEM meshing algorithms
plasmapotential Jan 22, 2024
3afb34f
FEM meshes
plasmapotential Jan 24, 2024
17e8c15
jan2024 update
plasmapotential Feb 6, 2024
904d6fd
fix error in use indexing for facingOut
plasmapotential Feb 8, 2024
b9fdce4
elmer FEM integration
plasmapotential Feb 16, 2024
38cccf4
mesh sliver filter
plasmapotential Feb 27, 2024
e6c035f
ability to run Elmer only
plasmapotential Feb 29, 2024
3a60ea2
elmer clobberFlag
plasmapotential Feb 29, 2024
ab62974
change tutorial to v4.0 text
plasmapotential Mar 4, 2024
eec7a9a
elmer dependencies in dockerFile
plasmapotential Mar 5, 2024
99aba8c
adding Elmer fortran and SIF files
plasmapotential Mar 8, 2024
5cb2ebd
create elmer test case
plasmapotential Mar 8, 2024
2820e5a
Merge branch 'main' into elmer
plasmapotential Mar 8, 2024
d208639
adding minimum FEM mesh size
plasmapotential Mar 8, 2024
7e38b92
added Elmer FEM integration test
plasmapotential Mar 8, 2024
9939619
filament input file description
plasmapotential Mar 15, 2024
35e6c06
elmer docs
plasmapotential Mar 19, 2024
f84e3fd
adding clone builds
plasmapotential Mar 19, 2024
6a8b120
adding OFversion ARG for swak4foam compatibility
plasmapotential Mar 19, 2024
6712aad
fixed mercurial build
plasmapotential Mar 20, 2024
0873a91
docker clones and build stages
plasmapotential Mar 20, 2024
8a75be5
updating terminal mode documentation
plasmapotential Mar 21, 2024
69039cf
Merge branch 'elmer' into v4.1
plasmapotential Mar 21, 2024
24c869a
update TUI docs
plasmapotential Mar 21, 2024
eb75e8b
multiple log files using tags
plasmapotential Mar 21, 2024
c08fa23
elmer patch for container (python-is-python3)
plasmapotential Mar 21, 2024
a919b93
adding verbose capability for mpi commands to see error output
plasmapotential Mar 21, 2024
2d4b5ca
add v4.1 branch option to HEAT clone in build
plasmapotential Mar 21, 2024
3e17ee8
python-is-python3 patch in build
plasmapotential Mar 21, 2024
63a70fc
docker cache buster
plasmapotential Mar 21, 2024
066bb3a
adding CI triggers for branch v4.1
plasmapotential Mar 21, 2024
e0a744e
bug in CI bash script
plasmapotential Mar 21, 2024
08ab9c7
changing integration tests to v4.1
plasmapotential Mar 21, 2024
683e07d
removing old logfile touch method
plasmapotential Mar 21, 2024
03a6e91
fixing GUI log error
plasmapotential Mar 21, 2024
875120e
final commit with PR patches
plasmapotential Apr 2, 2024
a27af7c
final docker container check v4.1
plasmapotential Apr 2, 2024
cb3fdc7
Merge pull request #36 from plasmapotential/v4.1
plasmapotential Apr 2, 2024
5435a15
bug fixes for gui and bTraces
plasmapotential Apr 3, 2024
fb09daa
Merge pull request #38 from plasmapotential/v4.1.1
tloobyCFS Apr 3, 2024
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
29 changes: 23 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,43 @@ name: CI

on:
push:
branches: [ plasma3D ]
branches: [ main ]
pull_request:
branches: [ plasma3D ]
branches: [ main ]

jobs:
test:
check-final-image:
runs-on: ubuntu-latest
steps:
- name: Check if final Docker image exists on Docker Hub
id: check-final-image
run: |
if docker pull plasmapotential/heat:v4.1; then
echo "Image exists on Docker Hub."
else
echo "::error ::Final HEAT Docker image v4.1 does not exist."
exit 1
fi

test:
needs: check-final-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Pull Docker image
run: docker pull plasmapotential/heat:v4.0
run: docker pull plasmapotential/heat:v4.1

- name: Run simple CI configuration test
run: docker run -v ${{ github.workspace }}:/root/source/HEAT plasmapotential/heat:v4.0 python3 /root/source/HEAT/tests/integrationTests/ciTest.py
run: docker run -v ${{ github.workspace }}:/root/source/HEAT plasmapotential/heat:v4.1 python3 /root/source/HEAT/tests/integrationTests/ciTest.py

- name: NSTX-U Optical HEAT Calculation
run: docker run -v ${{ github.workspace }}:/root/source/HEAT plasmapotential/heat:v4.0 /root/source/HEAT/source/runTerminalModeTestOptical
run: docker run -v ${{ github.workspace }}:/root/source/HEAT plasmapotential/heat:v4.1 /root/source/HEAT/source/runTerminalModeTestOptical

- name: NSTX-U Optical Elmer FEM HEAT Calculation
run: docker run -v ${{ github.workspace }}:/root/source/HEAT plasmapotential/heat:v4.1 /root/source/HEAT/source/runTerminalModeTestOpticalElmer


# - name: NSTX-U Gyro-orbit HEAT Calculation
# run: docker run -v ${{ github.workspace }}:/root/source/HEAT plasmapotential/heat:v4.0 /root/source/HEAT/source/runTerminalModeTestGyro
#
Expand Down
239 changes: 196 additions & 43 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
#Dockerfile
#Engineer: T Looby
#Date: 01/27/2022
#Date: 03/20/2024
#Description: Dockerfile for building HEAT docker image
#
#this script should only be run on dev machine
#script is not run directly, but is used when buildDocker bash
#script is run. buildDocker script calls this file using syntax
#similar to this:
# docker build -t plasmapotential/heat -f ./Dockerfile ./github/source

# This dockerfile is broken into two stages. The first stage
# clones all the source code repos and builds everything from
# source inside of a container. This is time consuming, so
# it is made into its own stage called HEATbuilder. HEATbuilder
# will also be saved on dockerhub from now on, with a version
# tag. Users can pull HEATbuilder to save time.
#
# The second stage is the final HEAT container. It only contains
# the packages required to run HEAT, and none of the files used
# to build everything from source.
#
# A user can build both stages like this (command also works to only
# build final stage if HEATbuilder is already complete):
# docker build -t plasmapotential/heat .
#
# note: cross platform build (for apple silicon)
# docker buildx build --platform linux/amd64,linux/arm64 -t plasmapotential/heat -f ./Dockerfile . --push
#
# User can also only build the first stage (HEATbuilder) like this:
# docker build --target HEATbuilder -t plasmapotential/heatbuilder .
#
# after creating an image, tag it using a command like this
# docker tag plasmapotential/heat:latest plasmapotential/heat:<tag>
#
# upload to dockerhub via a command like this
# docker push plasmapotential/heat:<tag>
#
# launch bash terminal in container interatively
# docker-compose run HEAT /bin/bash
#
#======================================================================
#1st build stage. build all necessary packages from source
#======================================================================
# start from base
FROM ubuntu:22.04
FROM ubuntu:22.04 AS HEATbuilder
SHELL ["/bin/bash", "-c"]

LABEL maintainer="[email protected]"

# environment variables
ENV SHELL /bin/bash
ENV runMode docker
ENV AppDir /root
ENV APPDIR /root
ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONPATH /usr/lib/freecad-python3/lib

#set up paths for libs
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/qt5
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/netgen
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/mafot/lib
#ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/paraview/lib #comment to prevent qt5 conflicts
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/openfoam/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/openfoam/platforms/linux64GccDPInt32Opt/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/openfoam/platforms/linux64GccDPInt32Opt/lib/sys-openmpi
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/swak4foam/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/openfoam/platforms/linux64GccDPInt32Opt/lib/dummy
#ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/open3d/lib:/root/opt/open3d/lib/python_package
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/m3dc1/lib

#set up paths for bins
ENV PATH $PATH:/root/opt/mafot/bin
ENV PATH $PATH:/root/opt/paraview/bin
ENV PATH $PATH:/root/opt/openfoam/bin
ENV PATH $PATH:/root/opt/openfoam/platforms/linux64GccDPInt32Opt/bin
ENV PATH $PATH:/root/opt/swak4foam/bin
#ENV PATH $PATH:/root/opt/open3d/bin
ENV PATH $PATH:/root/opt/m3dc1/bin

#===system-wide deps for HEAT
#update layer
RUN apt-get -yqq update

Expand All @@ -54,6 +58,97 @@ RUN apt-get -yqq install python3 && \
apt-get -yqq install python3-distutils
#RUN apt-get -yqq install mdsplus-python

#utility tools/libs layers
#RUN apt-get -yqq libnglib-6.2
RUN apt-get -yqq install coreutils libcurl4 libunwind-dev nano git gfortran iputils-ping iproute2 htop

#3D plasmas layer
RUN apt-get -yqq install libopenmpi-dev libhdf5-openmpi-dev libnetcdf-dev libnetcdff-dev libblas-dev liblapack-dev

#linking layer
RUN ln -s /usr/lib/x86_64-linux-gnu/libunwind.so /usr/lib/x86_64-linux-gnu/libunwind.so.1

#clone EFIT
#RUN git clone https://github.com/ORNL-Fusion/EFIT.git /root/source/EFIT

#clone HEAT
RUN git clone https://github.com/plasmapotential/HEAT.git /root/source/HEAT

#change to root (home) dir
WORKDIR /root

#clone and build M3DC1 fusion-io libs
RUN git clone https://github.com/nferraro/fusion-io.git /root/source/M3DC1/fusion-io
COPY buildM3DC1 /root/source/M3DC1/fusion-io/buildM3DC1
COPY make.inc.ubuntu_x86 /root/source/M3DC1/fusion-io/install/make.inc.ubuntu_x86
RUN mkdir -p /root/source/M3DC1/build && /root/source/M3DC1/fusion-io/buildM3DC1

#clone and build MAFOT
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/hdf5/openmpi
#note branch here can be changed if PR goes thru
RUN git clone -b HEATv4.1 --single-branch https://github.com/ORNL-Fusion/MAFOT.git /root/source/MAFOT
COPY buildMAFOT /root/source/MAFOT/buildMAFOT
RUN mkdir -p /root/source/MAFOT/build/bin && \
mkdir -p /root/source/MAFOT/build/lib && \
/root/source/MAFOT/buildMAFOT

#clone openfoam, third party libs
#OpenFOAM version defined by user
ARG OFversion=2306
RUN apt-get -yqq update && \
apt-get install -yqq python-is-python3 flex bison wget mercurial libscotch-dev libptscotch-dev && \
wget -P /root/source/openfoam/ https://dl.openfoam.com/source/v${OFversion}/ThirdParty-v${OFversion}.tgz && \
wget -P /root/source/openfoam/ https://dl.openfoam.com/source/v${OFversion}/OpenFOAM-v${OFversion}.tgz && \
tar -xzf /root/source/openfoam/ThirdParty-v${OFversion}.tgz -C /root/source/openfoam/ && \
tar -xzf /root/source/openfoam/OpenFOAM-v${OFversion}.tgz -C /root/source/openfoam/ && \
mkdir -p /root/source/openfoam/swak4Foam

#build openfoam
ENV WM_THIRD_PARTY_DIR /root/source/openfoam/ThirdParty-v${OFversion}
WORKDIR /root/source/openfoam/OpenFOAM-v${OFversion}
RUN mkdir -p /root/source/openfoam/OpenFOAM-v${OFversion}/applications/solvers/custom && \
cp -au /root/source/HEAT/source/heatFoam /root/source/openfoam/OpenFOAM-v${OFversion}/applications/solvers/custom/heatFoam && \
source /root/source/openfoam/OpenFOAM-v${OFversion}/etc/bashrc && \
./Allwmake -j -s -q -l && \
cd /root/source/openfoam/OpenFOAM-v${OFversion}/applications/solvers/custom/heatFoam && \
wmake

#clone and build swak4foam
WORKDIR /root/source/openfoam/
RUN source /root/source/openfoam/OpenFOAM-v${OFversion}/etc/bashrc && \
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam && \
cd /root/source/openfoam/swak4Foam && \
hg update develop && \
./AllwmakeAll

#clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

#======================================================================
#2nd build stage. build container without unncesary build artifacts
#to keep final image smaller
#======================================================================
#if user doesnt want to build first stage, they can pull HEATbuilder from
#dockerhub using the following command (need to comment out first stage too):
#FROM plasmapotential/HEATbuilder:<tag> as HEATbuilder

FROM ubuntu:22.04
LABEL maintainer="[email protected]"
ARG DEBIAN_FRONTEND=noninteractive
ENV runMode docker

#update layer
RUN apt-get -yqq update && apt-get -yqq upgrade

#python layer
RUN apt-get -yqq install python3 && \
apt-get -yqq install python3-pip && \
apt-get -yqq install python3-pkg-resources && \
apt-get -yqq install python3-distutils && \
apt-get -yqq install python3-paraview

#RUN apt-get -yqq install mdsplus-python

# freecad layer
#RUN apt-get -yqq install libfreecad-python3-0.20 #22.04
#RUN apt-get -yqq install libfreecad-python3-0.19 #22.10
Expand All @@ -66,30 +161,88 @@ RUN apt-get -yqq install software-properties-common && \
apt-get update && \
apt-get install -yqq freecad-python3

#utility tools/libs layers
RUN apt-get -yqq install coreutils libnglib-6.2 libcurl4 libunwind-dev nano git gfortran iputils-ping iproute2 htop
# elmer layer / OF layer
RUN apt-get -yqq update && \
apt-add-repository ppa:elmer-csc-ubuntu/elmer-csc-ppa && \
apt-get update && \
apt-get install -yqq elmerfem-csc libglu1 libscotch-dev libptscotch-dev python-is-python3

#RUN apt-get -yqq libnglib-6.2
RUN apt-get -yqq install coreutils libcurl4 libunwind-dev nano git gfortran iputils-ping iproute2 htop

#3D plasmas layer
RUN apt-get -yqq install libopenmpi-dev libhdf5-openmpi-dev libnetcdf-dev libnetcdff-dev

#linking layer
RUN ln -s /usr/lib/x86_64-linux-gnu/libunwind.so /usr/lib/x86_64-linux-gnu/libunwind.so.1

# copy context
WORKDIR /root
COPY . .
#clone EFIT
RUN git clone https://github.com/ORNL-Fusion/EFIT.git /root/source/EFIT

# fetch app specific deps
#clone HEAT (note v4.1 branch can be changed)
RUN git clone -b v4.1 --single-branch https://github.com/plasmapotential/HEAT.git /root/source/HEAT

# fetch HEAT specific python dependencies
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --ignore-installed blinker && \
python3 -m pip install -r requirements.txt

#clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
python3 -m pip install -r /root/source/HEAT/docker/requirements.txt

#make build dirs
RUN mkdir -p /root/builds/M3DC1 && \
mkdir -p /root/builds/MAFOT && \
mkdir -p /root/builds/openfoam && \
mkdir -p /root/builds/swak4foam

#copy M3DC1 fusion-io bins / libs
COPY --from=HEATbuilder /root/source/M3DC1/build/bin /root/builds/M3DC1/bin
COPY --from=HEATbuilder /root/source/M3DC1/build/lib /root/builds/M3DC1/lib
COPY --from=HEATbuilder /root/source/M3DC1/build/include /root/builds/M3DC1/include
COPY --from=HEATbuilder /root/source/M3DC1/build/modules /root/builds/M3DC1/modules

#copy MAFOT bins / libs
COPY --from=HEATbuilder /root/source/MAFOT/build/bin /root/builds/MAFOT/bin
COPY --from=HEATbuilder /root/source/MAFOT/build/lib /root/builds/MAFOT/lib

#copy openFOAM bin / libs
ENV OFversion 2306
COPY --from=HEATbuilder /root/source/openfoam/OpenFOAM-v${OFversion}/platforms /root/builds/openfoam/platforms
COPY --from=HEATbuilder /root/source/openfoam/OpenFOAM-v${OFversion}/build /root/builds/openfoam/build
COPY --from=HEATbuilder /root/source/openfoam/OpenFOAM-v${OFversion}/bin /root/builds/openfoam/bin
COPY --from=HEATbuilder /root/source/openfoam/OpenFOAM-v${OFversion}/etc /root/builds/openfoam/etc

#copy swak4foam bins / libs
COPY --from=HEATbuilder /root/OpenFOAM/user-v2306/platforms/linux64GccDPInt32Opt/bin /root/builds/swak4Foam/bin
COPY --from=HEATbuilder /root/OpenFOAM/user-v2306/platforms/linux64GccDPInt32Opt/lib /root/builds/swak4Foam/lib

#paths for libs
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/qt5
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/netgen
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/MAFOT/lib
#ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/opt/paraview/lib #comment to prevent qt5 conflicts
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/openfoam/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/openfoam/platforms/linux64GccDPInt32Opt/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/openfoam/platforms/linux64GccDPInt32Opt/lib/sys-openmpi
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/openfoam/platforms/linux64GccDPInt32Opt/lib/dummy
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/swak4Foam/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/root/builds/M3DC1/lib
ENV PYTHONPATH $PYTHONPATH:/root/builds/M3DC1/lib

#set up paths for bins
ENV PATH $PATH:/root/builds/MAFOT/bin
#ENV PATH $PATH:/root/builds/paraview/bin
ENV PATH $PATH:/root/builds/openfoam/bin
ENV PATH $PATH:/root/builds/openfoam/platforms/linux64GccDPInt32Opt/bin
ENV PATH $PATH:/root/builds/swak4foam/bin
ENV PATH $PATH:/root/builds/M3DC1/bin
ENV PYTHONPATH $PYTHONPATH:/usr/lib/freecad-python3/lib

# expose port
EXPOSE 8050

WORKDIR /root

#clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# start app
CMD [ "python3", "./source/HEAT/source/launchHEAT.py", "--a", "0.0.0.0", "--p", "8050", "--m", "g" ]
1 change: 1 addition & 0 deletions docker/buildDocker
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#THIS FILE IS NO LONGER USED. LEGACY LEFT FOR REFERENCE UNTIL v5.0
#Engineer: T Looby
#Date: 12/27/2023
#Description: prepares docker context, then creates docker container
Expand Down
12 changes: 12 additions & 0 deletions docker/buildM3DC1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#builds M3DC1 Fusion-io libs inside the container
echo "Building M3DC1 fusion-io..."
#sets up environment and builds fusion-io libs
export FIO_ROOT=/root/source/M3DC1/fusion-io
export FIO_ARCH="ubuntu_x86"
export FIO_INSTALL_DIR=/root/source/M3DC1/build
export PYTHON=python3

cd /root/source/M3DC1/fusion-io
make
make install
15 changes: 15 additions & 0 deletions docker/buildMAFOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#builds MAFOT inside the container
echo "Building Blitz..."
cd ./source/MAFOT/blitz++
tar -xvzf blitz-0.9_cstdlibPatched.tar.gz
cd blitz-0.9
./configure
make lib
make install
cd /root/source/MAFOT
rm make.inc
ln -s install/make.inc.HEAT make.inc
ls /
echo "Building MAFOT..."
make heat
Loading
Loading