Skip to content

Remove installation of build requirements from workflows, since they are already installed in the underlying docker images #2854

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

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ jobs:
python3 -m isort --check .
- name: mypy checks
run: |
python3 -m pip install mypy types-setuptools --upgrade # TO REMOVE
Copy link
Member Author

@francesco-ballarin francesco-ballarin Nov 2, 2023

Choose a reason for hiding this comment

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

The current workflow upgrades mypy at every run, i.e. if the version of mypy on ghcr.io/fenics/test-env:current-openmpi is old it will get upgraded.

From https://github.com/FEniCS/dolfinx/actions/workflows/docker-dev-test-env.yml I see that the docker-dev-test-env.yml workflow is manually triggered once a month or so, so I do not expect the version of mypy will ever be too old.

Copy link
Member

Choose a reason for hiding this comment

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

The workflows should not be using pip to install/upgrade dependencies or related tools. Everything should be in the appropriate Dockerfile.

Sometimes it's necessary to install something in a workflow to get the tests to pass and the PR through. The images should then be rebuilt and a cleanup PR created.

It's good practice to add a note e.g. # TO REMOVE as it's easy to forget.

Copy link
Member Author

Choose a reason for hiding this comment

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

The only remaining pip install in these three workflows is https://github.com/FEniCS/dolfinx/blame/ef7255b655e96c88ef9556efa982df1c00987cf7/.github/workflows/redhat.yml#L27
which was just added 3 days ago. Do you want me to get rid of that as well?

Copy link
Member

Choose a reason for hiding this comment

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

The current workflow upgrades mypy at every run, i.e. if the version of mypy on ghcr.io/fenics/test-env:current-openmpi is old it will get upgraded.

From https://github.com/FEniCS/dolfinx/actions/workflows/docker-dev-test-env.yml I see that the docker-dev-test-env.yml workflow is manually triggered once a month or so, so I do not expect the version of mypy will ever be too old.

You're welcome to try. Would be interesting to see if redhat's pip is up to the task. If not we need to adjust the Dockerfile.

cd python/
mypy dolfinx
mypy demo
Expand Down Expand Up @@ -118,7 +117,6 @@ jobs:

- name: Build C++ interface documentation
run: |
python3 -m pip install breathe # TO REMOVE
export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="`
echo $DOLFINX_VERSION
cd cpp/doc
Expand Down Expand Up @@ -147,11 +145,9 @@ jobs:

- name: Build Python interface
run: |
python3 -m pip install -r python/build-requirements.txt # TO REMOVE
python3 -m pip -v install --check-build-dependencies --no-build-isolation python/
- name: Build Python interface documentation
run: |
python3 -m pip install sphinx==5.0.2 # TO REMOVE
cd python/doc
make html

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/oneapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ jobs:
- name: Build DOLFINx Python interface
run: |
. /opt/intel/oneapi/setvars.sh
pip -v install -r python/build-requirements.txt # TO REMOVE
pip -v install --check-build-dependencies --no-build-isolation python/
- name: Set default DOLFINx JIT options
run: |
Expand All @@ -96,7 +95,6 @@ jobs:
- name: Run DOLFINx demos (Python, serial)
run: |
. /opt/intel/oneapi/setvars.sh
pip install matplotlib # TO REMOVE
pytest -v -n=2 -m serial --durations=10 python/demo/test.py
- name: Run DOLFINx demos (Python, MPI (np=2))
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:

- name: Build Python interface (editable install)
run: |
python3 -m pip -v install -r python/build-requirements.txt # TO REMOVE
python3 -m pip -v install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type=Debug --config-settings=build-dir="build" -e python/

- name: Set default DOLFINx JIT options
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.test-env
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ RUN if [ "$MPI" = "mpich" ]; then \
# - Second set of packages are recommended and/or required to build
# documentation or run tests.
RUN pip3 install --no-cache-dir --upgrade setuptools pip && \
pip3 install -no-cache-dir cffi mpi4py numba numpy==${NUMPY_VERSION} scikit-build-core[pyproject] && \
pip3 install --no-cache-dir breath clang-format cppimport cmakelang flake8 isort jupytext matplotlib mypy myst-parser pybind11==${PYBIND11_VERSION} pytest pytest-xdist scipy sphinx==5.0.2 sphinx_rtd_theme types-setuptools
pip3 install --no-cache-dir cffi mpi4py numba numpy==${NUMPY_VERSION} scikit-build-core[pyproject] && \
pip3 install --no-cache-dir breathe clang-format cppimport cmakelang flake8 isort jupytext matplotlib mypy myst-parser pybind11==${PYBIND11_VERSION} pytest pytest-xdist scipy sphinx==5.0.2 sphinx_rtd_theme types-setuptools

# Install KaHIP
RUN wget -nc --quiet https://github.com/kahip/kahip/archive/v${KAHIP_VERSION}.tar.gz && \
Expand Down