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

docker: revamp base deployment #2162

Merged
merged 6 commits into from Jul 17, 2023
Merged

docker: revamp base deployment #2162

merged 6 commits into from Jul 17, 2023

Conversation

mloubout
Copy link
Contributor

  • Revamp base deployment not to rebuild nvhpc. Reduces the number of jobs and should reduce CI time since all extras are mostly an env var on top of the existing image. Little bit more verbose but I don't think it's really an issue there
  • Added icx as a separate image
  • Fix MPI flags for oneapi

@mloubout mloubout added dependencies Pull requests that update a dependency file CI continuous integration installation labels Jul 10, 2023
@mloubout mloubout requested a review from ggorman July 10, 2023 12:36
@codecov
Copy link

codecov bot commented Jul 10, 2023

Codecov Report

Merging #2162 (9f608a8) into master (c5fe4e6) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #2162      +/-   ##
==========================================
- Coverage   87.06%   87.04%   -0.03%     
==========================================
  Files         223      223              
  Lines       39931    39946      +15     
  Branches     5174     5177       +3     
==========================================
+ Hits        34765    34769       +4     
- Misses       4589     4598       +9     
- Partials      577      579       +2     
Impacted Files Coverage Δ
devito/arch/compiler.py 38.72% <20.00%> (-0.63%) ⬇️
conftest.py 84.04% <33.33%> (ø)
devito/core/autotuning.py 93.91% <100.00%> (ø)
devito/types/dense.py 94.02% <100.00%> (+<0.01%) ⬆️
devito/types/dimension.py 94.32% <100.00%> (+<0.01%) ⬆️
examples/seismic/source.py 83.33% <100.00%> (ø)

@mloubout mloubout force-pushed the docker-base-fast branch 22 times, most recently from 304b3a7 to 00b2eb5 Compare July 12, 2023 13:47
docker/Dockerfile.cpu Show resolved Hide resolved
docker/Dockerfile.cpu Show resolved Hide resolved
docker/Dockerfile.nvidia Show resolved Hide resolved
@mloubout mloubout force-pushed the docker-base-fast branch 3 times, most recently from 8da0f96 to fae6d62 Compare July 13, 2023 19:12
Copy link
Contributor

@ggorman ggorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTO once green and comments addressed.

@@ -18,6 +23,7 @@ RUN python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir --upgrade pip && \
/venv/bin/pip install --no-cache-dir jupyter && \
/venv/bin/pip install --no-cache-dir wheel && \
eval "$MPI4PY_FLAGS /venv/bin/pip install --no-cache-dir mpi4py" && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does MPI4PY_FLAGS come from? A quick google indicates zero hits. Add link/comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a made up one I made to handle all our different compilers and arches

pyrevolve
scipy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update any install instructions - what happens when new users try the tutorials? Will they know that these requirements need to be installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install instruvtions should still be the same and examples should always be installed with .[extras] these were leftover that should have been moved here

requirements-testing.txt Outdated Show resolved Hide resolved
conftest.py Outdated
@@ -21,6 +21,11 @@
MPI = None


def pytest_collectstart(collector):
if collector.fspath and collector.fspath.ext == '.ipynb':
collector.skip_compare += ('text/latex',)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see https://nbval.readthedocs.io/en/latest/#Skipping-certain-output-types

This just avoid failures for different sympy version printing slightly different latex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needed to be moved to root directory so that conftest is found when testing the examples

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, so this cancels out my LATEX changes in the other PR?

@mloubout mloubout force-pushed the docker-base-fast branch 2 times, most recently from a0f2f15 to aad6f20 Compare July 15, 2023 15:07
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mloubout mloubout force-pushed the docker-base-fast branch 2 times, most recently from 2f32636 to ae615c1 Compare July 16, 2023 16:22
password: ${{ secrets.DOCKER_PASSWORD }}

- name: cleanup
run: docker system prune -a -f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we actually need to prune everything? can we not just prune ourselves?

this might kill for example my local docker images 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not touch your images only the 'action" user one, always been there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, I was pretty sure "docker system prune" were a system-level action, that is as if it were issued by the docker group?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhmmm

runs-on: ubuntu-latest
strategy:
matrix:
arch: [gcc, icc, icx]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop icc and just focus on icx (and clearly gcc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought so too wasn't sure if we wanted to keep it until intel drop it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree to drop it. Worst case scenario if someone is so eager to use icc by default, we could always point out to use the latest stable release

@@ -707,6 +709,17 @@ def __init__(self, *args, **kwargs):
if mpi_distro != 'IntelMPI':
warning("Expected Intel MPI distribution with `%s`, but found `%s`"
% (self.__class__.__name__, mpi_distro))
self.cflags.insert(0, '-cc=%s' % self.CC)

def get_version(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who calls this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codepy does, it's basically copied from there but making sure the -cc doesn't make it error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. Could use a small comment, but that's fine

devito/arch/compiler.py Show resolved Hide resolved
@@ -321,7 +321,8 @@ def _arg_check(self, args, size, interval):
upper = interval.upper
else:
# Autopadding causes non-integer upper limit
upper = interval.upper.subs(args)
from devito.symbolics import normalize_args
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sooner or later we will have to fix these cycling imports

########################################################################
# HIPCC for GPUs (HIP)
########################################################################
# This will only trigger if arch is hip since the final stage depends on it
FROM sdk-base as hip

# Install OpenMPI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was OpenMPI expanded out ? there must be a logic, but I'm missing it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, for CC=, CXX= etc...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, decided to go concervative and force all the compiler for openmpi we can revisit

pyrevolve
scipy
distributed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent

flake8>=2.1.0
nbval
scipy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent

@@ -12,4 +9,4 @@ codepy>=2019.1
click<9.0
multidict
anytree>=2.4.3,<=2.9.0
distributed<2023.8
cloudpickle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic 👍

self.stop = stop
self.step = step
self.num = num
self.start = float(start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

@mloubout mloubout force-pushed the docker-base-fast branch 3 times, most recently from f54a46a to 68ddd67 Compare July 17, 2023 12:50
.github/workflows/docker-bases.yml Outdated Show resolved Hide resolved
@@ -25,6 +25,7 @@ jobs:
env:
DEVITO_LANGUAGE: "openmp"
DEVITO_ARCH: "gcc-9"
OMP_NUM_THREADS: "1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in retrospect, I'm not sure about this one. Don't we want to test the numerical accuracy of MPI+OpenMP tests

@@ -707,6 +709,17 @@ def __init__(self, *args, **kwargs):
if mpi_distro != 'IntelMPI':
warning("Expected Intel MPI distribution with `%s`, but found `%s`"
% (self.__class__.__name__, mpi_distro))
self.cflags.insert(0, '-cc=%s' % self.CC)

def get_version(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. Could use a small comment, but that's fine

@@ -10,9 +10,9 @@ Devito provides several images that target different architectures and compilers

We provide two CPU images:
- `devito:gcc-*` with the standard GNU gcc compiler.
- `devito:icc-*` with the Intel C compiler for Intel architectures.
- `devito:icx-*` with the Intel C compiler for Intel architectures.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic. GTG for me

@mloubout mloubout merged commit 9466a03 into master Jul 17, 2023
32 checks passed
@mloubout mloubout deleted the docker-base-fast branch July 17, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI continuous integration dependencies Pull requests that update a dependency file installation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants