Skip to content

Commit eb298c0

Browse files
authored
Merge pull request #847 from ukaea/develop
Develop
2 parents f4aa12e + ddcfff3 commit eb298c0

File tree

179 files changed

+12211
-5786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+12211
-5786
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
- run:
1919
name: run neutronics_utils tests
2020
command:
21-
pytest tests/test_neutronics_utils.py -v --cov=paramak --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
21+
pytest tests/test_neutronics_utils.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
2222

2323
- run:
2424
name: run neutronics_example tests
2525
command:
26-
pytest tests/test_example_neutronics_simulations.py -v --cov=paramak --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
26+
pytest tests/test_example_neutronics_simulations.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
2727

2828
- run:
2929
name: run utils tests
@@ -73,7 +73,7 @@ jobs:
7373
- run:
7474
name: run example reactor tests
7575
command:
76-
pytest tests/test_example_reactors.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
76+
pytest --capture=tee-sys tests/test_example_reactors.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
7777

7878
- store_test_results:
7979
path: test-reports

.github/workflows/docker_ci.yml

-17
This file was deleted.
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
name: CI - Develop
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
cadquery-version: [2.1]
14+
include-neutronics: [true]
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Build and test with Docker
19+
run: |
20+
docker build -t paramak --build-arg include_neutronics=${{ matrix.include-neutronics }} --build-arg cq_version=${{ matrix.cadquery-version}} --build-arg compile_cores=2 .
21+
docker run --rm paramak /bin/bash -c "bash run_tests.sh include_neutronics=${{ matrix.include-neutronics }} && curl -s https://codecov.io/bash | bash"

.github/workflows/docker_ci_main.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
name: CI - Main
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
cadquery-version: [2.1, master]
14+
include-neutronics: [true]
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Build and test with Docker
19+
run: |
20+
docker build -t paramak --build-arg include_neutronics=${{ matrix.include-neutronics }} --build-arg cq_version=${{ matrix.cadquery-version}} --build-arg compile_cores=2 .
21+
docker run --rm paramak /bin/bash -c "bash run_tests.sh include_neutronics=${{ matrix.include-neutronics }} && curl -s https://codecov.io/bash | bash"

.github/workflows/dockerhub-publish-dependencies.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
id: docker_build
3232
uses: docker/build-push-action@v2
3333
with:
34-
file: DockerfileDependencies
3534
push: true
3635
tags: ukaea/paramak:dependencies
36+
target: dependencies
3737
build-args: |
38-
cq_version=master
38+
cq_version=2.1
3939
compile_cores=2
4040
include_neutronics=true
4141
-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This yml file will trigger a Github Action on pushes to the main branch.
2+
# This Action will build and upload a Docker image to Dockerhub
3+
# https://github.com/marketplace/actions/publish-docker
4+
5+
name: dockerhub-publish-dev
6+
7+
on:
8+
push:
9+
branches: develop
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Set up QEMU
17+
uses: docker/setup-qemu-action@v1
18+
-
19+
name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v1
21+
-
22+
name: Login to DockerHub
23+
uses: docker/login-action@v1
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
-
28+
name: Build and push
29+
id: docker_build
30+
uses: docker/build-push-action@v2
31+
with:
32+
push: true
33+
tags: ukaea/paramak:dev
34+
build-args: |
35+
cq_version=2.1
36+
compile_cores=2
37+
include_neutronics=true
38+
-
39+
name: Image digest
40+
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/dockerhub-publish-geometry-dependencies.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# This Action will build and upload a Docker image to Dockerhub
33
# https://github.com/marketplace/actions/publish-docker
44

5-
name: dockerhub-publish-dev
5+
name: dockerhub-publish-geometry-dependencies
66

77
on:
88
push:
9-
branches: develop
9+
branches:
10+
- develop
11+
- main
1012

1113
jobs:
1214
main:
@@ -32,7 +34,7 @@ jobs:
3234
push: true
3335
tags: ukaea/paramak:geometry-dependencies
3436
build-args: |
35-
cq_version=master
37+
cq_version=2.1
3638
compile_cores=2
3739
include_neutronics=false
3840
-

.github/workflows/dockerhub-publish-stable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
uses: docker/build-push-action@v2
3131
with:
3232
push: true
33-
tags: ukaea/paramak:latest
33+
tags: ukaea/paramak:stable
3434
build-args: |
35-
cq_version=master
35+
cq_version=2.1
3636
compile_cores=2
3737
include_neutronics=true
3838
-

.github/workflows/python-publish.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
name: Upload Python Package
77

88
on:
9-
push:
10-
branches:
11-
- main
9+
release:
10+
types: [created]
1211

1312
jobs:
1413
deploy:

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ paramak.egg-info/
2424
coverage.xml
2525
.coverage
2626

27-
# trelis journal files
27+
# trelis output files
2828
*.jou
2929
*.log
30+
*.trelis
31+
*.cub
3032

3133
# neutronics geometry files
3234
*.h5m
@@ -59,3 +61,7 @@ test-reports/
5961

6062
# ppp output directory
6163
manifest_processed/
64+
65+
# conda buid and dist dir
66+
build/
67+
dist/

Dockerfile

+28-28
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Options: [1, 2, 3, 4, 5, 6...]
2121
#
2222
# Example builds:
23-
# Building using the defaults (cq_version 2, no neutronics and 1 core compile)
23+
# Building using the defaults (cq_version 2.1, no neutronics and 1 core compile)
2424
# docker build -t ukaea/paramak .
2525
#
2626
# Building to include cadquery master, neutronics dependencies and use 8 cores.
@@ -40,10 +40,10 @@
4040
# docker run --rm ukaea/paramak pytest /tests
4141
# docker run --rm ukaea/paramak /bin/bash -c "cd .. && bash run_tests.sh"
4242

43-
FROM continuumio/miniconda3:4.9.2
43+
FROM continuumio/miniconda3:4.9.2 as dependencies
4444

4545
# By default this Dockerfile builds with the latest release of CadQuery 2
46-
ARG cq_version=2
46+
ARG cq_version=2.1
4747
ARG include_neutronics=false
4848
ARG compile_cores=1
4949

@@ -62,12 +62,13 @@ RUN apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev \
6262
apt-get clean
6363

6464
# Installing CadQuery
65-
# jupyter is installed before cadquery to avoid a conflict
6665
RUN echo installing CadQuery version $cq_version && \
67-
conda install jupyter -y --quiet && \
68-
conda install -c cadquery -c conda-forge cadquery="$cq_version" && \
66+
conda install -c conda-forge -c python python=3.8 && \
67+
conda install -c conda-forge -c cadquery cadquery="$cq_version" && \
68+
pip install jupyter-cadquery==2.1.0 && \
6969
conda clean -afy
7070

71+
7172
# Install neutronics dependencies from Debian package manager
7273
RUN if [ "$include_neutronics" = "true" ] ; \
7374
then echo installing with include_neutronics=true ; \
@@ -88,20 +89,9 @@ RUN if [ "$include_neutronics" = "true" ] ; \
8889
apt-get --yes install libglfw3-dev ; \
8990
fi
9091

91-
# Clone and install NJOY2016
92-
RUN if [ "$include_neutronics" = "true" ] ; \
93-
then git clone --single-branch --branch master https://github.com/njoy/NJOY2016.git /opt/NJOY2016 ; \
94-
cd /opt/NJOY2016 ; \
95-
mkdir build ; \
96-
cd build ; \
97-
cmake -Dstatic=on .. ; \
98-
make 2>/dev/null ; \
99-
make install ; \
100-
fi
101-
10292
# Clone and install Embree
10393
RUN if [ "$include_neutronics" = "true" ] ; \
104-
then git clone --single-branch --branch master https://github.com/embree/embree.git ; \
94+
then git clone --single-branch --branch v3.12.2 --depth 1 https://github.com/embree/embree.git ; \
10595
cd embree ; \
10696
mkdir build ; \
10797
cd build ; \
@@ -117,7 +107,7 @@ RUN if [ "$include_neutronics" = "true" ] ; \
117107
mkdir MOAB ; \
118108
cd MOAB ; \
119109
mkdir build ; \
120-
git clone --single-branch --branch develop https://bitbucket.org/fathomteam/moab.git ; \
110+
git clone --single-branch --branch 5.2.1 --depth 1 https://bitbucket.org/fathomteam/moab.git ; \
121111
cd build ; \
122112
cmake ../moab -DENABLE_HDF5=ON \
123113
-DENABLE_NETCDF=ON \
@@ -141,7 +131,6 @@ RUN if [ "$include_neutronics" = "true" ] ; \
141131
python setup.py install ; \
142132
fi
143133

144-
145134
# Clone and install Double-Down
146135
RUN if [ "$include_neutronics" = "true" ] ; \
147136
then git clone --single-branch --branch main https://github.com/pshriwise/double-down.git ; \
@@ -159,7 +148,7 @@ RUN if [ "$include_neutronics" = "true" ] ; \
159148
RUN if [ "$include_neutronics" = "true" ] ; \
160149
then mkdir DAGMC ; \
161150
cd DAGMC ; \
162-
git clone --single-branch --branch develop https://github.com/svalinn/DAGMC.git ; \
151+
git clone --single-branch --branch 3.2.0 --depth 1 https://github.com/svalinn/DAGMC.git ; \
163152
mkdir build ; \
164153
cd build ; \
165154
cmake ../DAGMC -DBUILD_TALLY=ON \
@@ -187,23 +176,30 @@ RUN if [ "$include_neutronics" = "true" ] ; \
187176
make -j"$compile_cores" install ; \
188177
cd .. ; \
189178
pip install -e .[test] ; \
190-
/opt/openmc/tools/ci/download-xs.sh ; \
191179
fi
192180

193-
ENV OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml
194-
195181
RUN if [ "$include_neutronics" = "true" ] ; \
196182
then pip install vtk ; \
197183
pip install parametric_plasma_source ; \
198-
pip install neutronics_material_maker ; \
184+
pip install neutronics_material_maker==0.3.2 ; \
185+
pip install openmc_data_downloader ; \
186+
openmc_data_downloader -e all -i H3 -l ENDFB-7.1-NNDC TENDL-2019 -p neutron photon ; \
199187
fi
200188

201189
COPY requirements.txt requirements.txt
202190
RUN pip install -r requirements.txt
203191

204-
# @pullrequest reviewer, we would like to make the copy optional but don't know
205-
# how. Then we can build a dependency image for use in circle ci.
206-
# Copy over the source code, examples and tests
192+
ENV OPENMC_CROSS_SECTIONS=/cross_sections.xml
193+
ENV PATH="/MOAB/build/bin:${PATH}"
194+
ENV PATH="/DAGMC/bin:${PATH}"
195+
196+
RUN mkdir /home/paramak
197+
EXPOSE 8888
198+
WORKDIR /home/paramak
199+
200+
201+
FROM dependencies as final
202+
207203
COPY run_tests.sh run_tests.sh
208204
COPY paramak paramak/
209205
COPY examples examples/
@@ -213,3 +209,7 @@ COPY README.md README.md
213209

214210
# using setup.py instead of pip due to https://github.com/pypa/pip/issues/5816
215211
RUN python setup.py install
212+
213+
# this helps prevent the kernal failing
214+
RUN echo "#!/bin/bash\n\njupyter lab --notebook-dir=/home/paramak --port=8888 --no-browser --ip=0.0.0.0 --allow-root" >> /home/paramak/docker-cmd.sh
215+
CMD bash /home/paramak/docker-cmd.sh

0 commit comments

Comments
 (0)