Skip to content

Commit fd64b76

Browse files
committed
doc+container updates
1 parent 4efce70 commit fd64b76

File tree

43 files changed

+1219
-1268
lines changed

Some content is hidden

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

43 files changed

+1219
-1268
lines changed

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
extend-ignore =
33
# E402: module level import not at top of file
44
E402,
5+
# E741 ambiguous variable name
6+
E741,
57
# H301: one import per line
68
H301,
79
# H306: imports not in alphabetical order

.github/workflows/build.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ jobs:
4444
steps:
4545
- name: Check out repo
4646
if: always()
47-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4848

4949
- name: Pull ccache cache
5050
if: always()
5151
id: ccache-restore
52-
uses: actions/cache/restore@v3
52+
uses: actions/cache/restore@v4
5353
with:
5454
path: /home/runner/.cache/ccache
5555
key: ccache-${{ env.BUILD_IDENTIFIER }}
5656

57-
- uses: actions/setup-python@v4
57+
- uses: actions/setup-python@v5
5858
if: always()
5959
with:
6060
python-version: ${{ matrix.py-version }}
@@ -89,7 +89,7 @@ jobs:
8989

9090
- name: Push ccache cache
9191
if: always()
92-
uses: actions/cache/save@v3
92+
uses: actions/cache/save@v4
9393
with:
9494
path: /home/runner/.cache/ccache
9595
key: ccache-${{ env.BUILD_IDENTIFIER }}
@@ -115,7 +115,7 @@ jobs:
115115
mv cython-lint.xml cython-lint-${{ env.BUILD_IDENTIFIER }}.xml
116116
117117
- name: Archive results
118-
uses: actions/upload-artifact@v3
118+
uses: actions/upload-artifact@v4
119119
if: always()
120120
with:
121121
name: Results (${{ env.BUILD_PRETTY_IDENTIFIER }})
@@ -154,20 +154,20 @@ jobs:
154154

155155
steps:
156156
- name: Check out repo
157-
uses: actions/checkout@v3
157+
uses: actions/checkout@v4
158158

159159
- name: Pull ccache cache
160160
if: always()
161161
id: ccache-restore
162-
uses: actions/cache/restore@v3
162+
uses: actions/cache/restore@v4
163163
with:
164164
path: /Users/runner/Library/Caches/ccache
165165
key: ccache-${{ runner.os }}-${{ matrix.py-version }}
166166

167167
- name: Setup GNU Fortran
168168
uses: fortran-lang/setup-fortran@v1
169169

170-
- uses: actions/setup-python@v4
170+
- uses: actions/setup-python@v5
171171
with:
172172
python-version: ${{ matrix.py-version }}
173173

@@ -203,7 +203,7 @@ jobs:
203203

204204
- name: Push ccache cache
205205
if: always()
206-
uses: actions/cache/save@v3
206+
uses: actions/cache/save@v4
207207
with:
208208
path: /Users/runner/Library/Caches/ccache
209209
key: ccache-${{ runner.os }}-${{ matrix.py-version }}
@@ -229,7 +229,7 @@ jobs:
229229
mv cython-lint.xml cython-lint-${{ runner.os }}-${{ matrix.py-version }}.xml
230230
231231
- name: Archive results
232-
uses: actions/upload-artifact@v3
232+
uses: actions/upload-artifact@v4
233233
if: always()
234234
with:
235235
name: Results ${{ github.job }}

.github/workflows/container.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Container
33
on:
44
push:
55
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
68
workflow_dispatch:
79

810
env:
@@ -21,14 +23,15 @@ jobs:
2123
steps:
2224
- name: Check out
2325
if: always()
24-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2527
with:
2628
fetch-depth: 0
2729

28-
- uses: hadolint/hadolint-action@v3.1.0
29-
with:
30-
dockerfile: Dockerfile
31-
ignore: 'DL3008,DL3013'
30+
# - uses: hadolint/hadolint-action@v3.1.0
31+
# with:
32+
# dockerfile: Dockerfile
33+
# ignore: 'DL3008,DL3013'
34+
# verbose: true
3235

3336
- name: Build Image
3437
id: build_image
@@ -41,9 +44,10 @@ jobs:
4144
4245
- name: Run tests
4346
run: |
44-
podman run -e MPIEXEC_FLAGS="--allow-run-as-root --oversubscribe" --rm ${{ steps.build_image.outputs.image }}:${{ github.sha }} python3 -m pytest --junit-xml=test-results.xml tests/
47+
podman run --rm ${{ steps.build_image.outputs.image }}:${{ github.sha }} cd /pynucleus && python3 -m pytest --junit-xml=test-results.xml tests/
4548
4649
- name: Push To GHCR
50+
if: github.event_name == 'push'
4751
uses: redhat-actions/push-to-registry@v2
4852
id: push
4953
with:
@@ -56,5 +60,6 @@ jobs:
5660
--disable-content-trust
5761
5862
- name: Echo outputs
63+
if: github.event_name == 'push'
5964
run: |
6065
echo "${{ toJSON(steps.push.outputs) }}"
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Documentation CI
2+
3+
on:
4+
pull_request:
5+
branches: [ "master" ]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
13+
linux:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 180
16+
env:
17+
MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe"
18+
PYNUCLEUS_BUILD_PARALLELISM: 2
19+
20+
steps:
21+
- name: Check out repo
22+
uses: actions/checkout@v4
23+
24+
- name: Pull ccache cache
25+
id: ccache-restore
26+
uses: actions/cache/restore@v4
27+
with:
28+
path: /home/runner/.cache/ccache
29+
key: ccache
30+
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.11'
34+
35+
- name: Install Ubuntu packages
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install mpi-default-bin mpi-default-dev libmetis-dev libparmetis-dev libsuitesparse-dev ccache
39+
40+
- name: Install Python dependencies
41+
run: make prereq && make prereq-extra && python -m pip install wheel
42+
43+
- name: Install
44+
run: make dev
45+
46+
- name: Remove ccache cache
47+
if: ${{ steps.ccache-restore.outputs.cache-hit }}
48+
shell: bash
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
run: |
52+
gh extension install actions/gh-actions-cache
53+
gh actions-cache delete ccache --confirm
54+
continue-on-error: true
55+
56+
- name: Push ccache cache
57+
uses: actions/cache/save@v4
58+
with:
59+
path: /home/runner/.cache/ccache
60+
key: ccache
61+
62+
- name: Build documentation
63+
run: |
64+
make docs
65+
66+
- name: Upload artifact
67+
uses: actions/upload-artifact@v4
68+
with:
69+
path: 'docs/build'

.github/workflows/documentation.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Documentation
32

43
on:
@@ -26,16 +25,16 @@ jobs:
2625

2726
steps:
2827
- name: Check out repo
29-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
3029

3130
- name: Pull ccache cache
3231
id: ccache-restore
33-
uses: actions/cache/restore@v3
32+
uses: actions/cache/restore@v4
3433
with:
3534
path: /home/runner/.cache/ccache
3635
key: ccache
3736

38-
- uses: actions/setup-python@v4
37+
- uses: actions/setup-python@v5
3938
with:
4039
python-version: '3.11'
4140

@@ -61,24 +60,23 @@ jobs:
6160
continue-on-error: true
6261

6362
- name: Push ccache cache
64-
uses: actions/cache/save@v3
63+
uses: actions/cache/save@v4
6564
with:
6665
path: /home/runner/.cache/ccache
6766
key: ccache
6867

6968
- name: Build documentation
7069
run: |
7170
make docs
72-
cat docs/example1_stepMesh.py
7371
7472
- name: Setup Pages
75-
uses: actions/configure-pages@v3
73+
uses: actions/configure-pages@v4
7674

7775
- name: Upload artifact
78-
uses: actions/upload-pages-artifact@v1
76+
uses: actions/upload-pages-artifact@v3
7977
with:
8078
path: 'docs/build'
8179

8280
- name: Deploy to GitHub Pages
8381
id: deployment
84-
uses: actions/deploy-pages@v2
82+
uses: actions/deploy-pages@v4

Dockerfile

+27-21
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
FROM debian:testing
77
LABEL maintainer Christian Glusa
88

9-
ENV LANG C.UTF-8
9+
ENV LANG en_US.UTF-8
1010

1111
# install packages needed for build
1212
RUN sed -i 's/Components: main/Components: main contrib non-free/' /etc/apt/sources.list.d/debian.sources \
1313
&& apt-get update && \
1414
DEBIAN_FRONTEND=noninteractive apt-get install -y \
15+
locales \
1516
autoconf automake gcc g++ make gfortran wget zlib1g-dev libffi-dev \
1617
tk-dev \
1718
libssl-dev ca-certificates cmake \
@@ -25,32 +26,37 @@ RUN sed -i 's/Components: main/Components: main contrib non-free/' /etc/apt/sour
2526
libmetis-dev libparmetis-dev \
2627
texlive texlive-extra-utils texlive-latex-extra ttf-staypuft dvipng cm-super \
2728
jupyter-notebook \
29+
emacs-nox vim \
2830
--no-install-recommends \
29-
&& rm -rf /var/lib/apt/lists/*
30-
31-
COPY . /pynucleus
32-
ENV VIRTUAL_ENV=/pynucleus/venv
33-
RUN python3 -m venv $VIRTUAL_ENV
34-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
35-
WORKDIR /pynucleus
36-
RUN make prereq PIP_FLAGS=--no-cache-dir && \
37-
make prereq-extra PIP_FLAGS=--no-cache-dir && \
38-
make install && \
39-
python -m pip install --no-cache-dir ipykernel && \
40-
rm -rf build packageTools/build base/build metisCy/build fem/build multilevelSolver/build nl/build
41-
42-
RUN echo "alias ls='ls --color=auto -FN'" >> /root/.bashrc \
43-
&& echo 'set completion-ignore-case On' >> /root/.inputrc
31+
&& rm -rf /var/lib/apt/lists/* \
32+
&& sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen \
33+
&& dpkg-reconfigure --frontend=noninteractive locales \
34+
&& update-locale LANG=$LANG
4435

4536
# allow running MPI as root in the container
4637
# bind MPI ranks to hwthreads
47-
ENV OMPI_MCA_hwloc_base_binding_policy=hwthread \
38+
ENV LANG=en_US.UTF-8 \
39+
LANGUAGE=en_US:en \
40+
LC_ALL=en_US.UTF-8 \
41+
VIRTUAL_ENV=/pynucleus/venv \
42+
PATH="/pynucleus/venv/bin:$PATH" \
43+
OMPI_MCA_hwloc_base_binding_policy=hwthread \
4844
MPIEXEC_FLAGS=--allow-run-as-root \
4945
OMPI_ALLOW_RUN_AS_ROOT=1 \
5046
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
5147

52-
RUN python -m ipykernel install --name=PyNucleus
48+
COPY . /pynucleus
49+
50+
WORKDIR /pynucleus
51+
52+
RUN python3 -m venv $VIRTUAL_ENV && \
53+
make prereq PIP_FLAGS=--no-cache-dir && \
54+
make prereq-extra PIP_FLAGS=--no-cache-dir && \
55+
make install && \
56+
make docs && \
57+
python -m pip install --no-cache-dir ipykernel && \
58+
rm -rf build packageTools/build base/build metisCy/build fem/build multilevelSolver/build nl/build && \
59+
python -m ipykernel install --name=PyNucleus && \
60+
echo '[ ! -z "$TERM" -a -r /pynucleus/README.container.rst ] && printf "\e[32m" && cat /pyncleus/README.container.rst && printf "\e[0m"' >> /etc/bash.bashrc
5361

54-
COPY README.container.rst /README.container.rst
55-
# hadolint ignore=SC2016
56-
RUN echo '[ ! -z "$TERM" -a -r /README.container.rst ] && cat /README.container.rst' >> /etc/bash.bashrc
62+
WORKDIR /root

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ clean_package :
115115

116116
.PHONY: docs
117117
docs :
118-
cd docs && make
119118
$(PYTHON) -m sphinx -b html docs docs/build
119+
find docs/build/_downloads -name "*.ipynb" | xargs -I {} cp {} examples
120120

121121
clean_docs :
122122
cd docs; rm -rf build
@@ -169,7 +169,7 @@ prereq:
169169
$(PYTHON) -m pip install $(PIP_FLAGS) $(PIP_INSTALL_FLAGS) scikit-sparse
170170

171171
prereq-extra:
172-
$(PYTHON) -m pip install $(PIP_FLAGS) pytest pytest-html pytest-xdist Sphinx sphinxcontrib-programoutput flake8 flake8-junit-report cython-lint
172+
$(PYTHON) -m pip install $(PIP_FLAGS) pytest pytest-html pytest-xdist Sphinx sphinxcontrib-programoutput sphinx-gallery sphinx-rtd-theme flake8 flake8-junit-report cython-lint
173173

174174
flake8:
175175
$(PYTHON) -m flake8 --output-file=flake8.txt --exit-zero drivers examples packageTools base metisCy fem multilevelSolver nl tests

README.container.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
This is a container image for PyNucleus.
33

4-
The drivers and examples for PyNucleus can be found in /pynucleus/drivers and /pynucleus/examples
4+
The directory from which the container was launched on the host system is mapped to /root.
5+
PyNucleus is installed at /pynucleus.
6+
A copy of the drivers and examples for PyNucleus can be found in /root/drivers and /root/examples.
7+
The Jupyter notebook interface is available at https://localhost:8889 on the host.
8+
A quick way to check that everything works is to run
59

6-
The directory from which the container was launched on the host system is mapped to /user
10+
/root/drivers/runFractional.py
11+
12+
This should print some information about the solution of a fractional Laplacian problem and show several plots.

0 commit comments

Comments
 (0)