Skip to content

Commit fe940e1

Browse files
authored
CI: update prune_pkgs (#12382)
1 parent 1eff3b5 commit fe940e1

File tree

10 files changed

+19
-11
lines changed

10 files changed

+19
-11
lines changed

.actions/assistant.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ def prepare_nightly_version(proj_root: str = _PATH_ROOT) -> None:
3535
fp.write(init)
3636

3737
@staticmethod
38-
def requirements_prune_pkgs(req_file: str, packages: Sequence[str]) -> None:
38+
def requirements_prune_pkgs(packages: Sequence[str], req_files: Sequence[str] = REQUIREMENT_FILES) -> None:
39+
"""Remove some packages from given requirement files."""
40+
if isinstance(req_files, str):
41+
req_files = [req_files]
42+
for req in req_files:
43+
AssistantCLI._prune_packages(req, packages)
44+
45+
@staticmethod
46+
def _prune_packages(req_file: str, packages: Sequence[str]) -> None:
3947
"""Remove some packages from given requirement files."""
4048
with open(req_file) as fp:
4149
lines = fp.readlines()

.azure-pipelines/hpu-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ jobs:
2828

2929
steps:
3030
- bash: |
31+
apt-get install -y hwinfo
3132
hwinfo --short
3233
displayName: 'Instance HW info'

.github/workflows/ci_test-full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup Windows
5858
if: runner.os == 'windows'
5959
run: |
60-
python .actions/assistant.py requirements_prune_pkgs requirements/extra.txt --packages horovod
60+
python .actions/assistant.py requirements_prune_pkgs horovod
6161
- name: Set min. dependencies
6262
if: matrix.requires == 'oldest'
6363
run: |

.github/workflows/docs-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
pip --version
4444
pip install -q fire
4545
# remove Horovod from requirements
46-
python .actions/assistant.py requirements_prune_pkgs requirements/extra.txt --packages horovod
46+
python .actions/assistant.py requirements_prune_pkgs horovod
4747
# python -m pip install --upgrade --user pip
4848
pip install --requirement requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
4949
pip install --requirement requirements/extra.txt

dockers/base-conda/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ RUN \
9696
python requirements_adjust_versions.py requirements-extra.txt && \
9797
python -c "print(' '.join([ln for ln in open('requirements-extra.txt').readlines() if 'horovod' in ln]))" > requirements_horovod.txt && \
9898
pip install -q fire && \
99-
python assistant.py requirements_prune_pkgs requirements-extra.txt "horovod" && \
99+
python assistant.py requirements_prune_pkgs "horovod" --req_files requirements-extra.txt && \
100100
python requirements_adjust_versions.py requirements-examples.txt && \
101101
# Install remaining requirements
102102
pip install -r requirements.txt --no-cache-dir --find-links https://download.pytorch.org/whl/test/torch_test.html && \

dockers/base-cuda/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ RUN \
8383
python ./requirements/adjust-versions.py requirements/extra.txt ${PYTORCH_VERSION} && \
8484
python ./requirements/adjust-versions.py requirements/examples.txt ${PYTORCH_VERSION} && \
8585
python -c "print(' '.join([ln for ln in open('requirements/extra.txt').readlines() if 'horovod' in ln]))" > ./requirements/horovod.txt && \
86-
python assistant.py requirements_prune_pkgs requirements/extra.txt "horovod" && \
86+
python assistant.py requirements_prune_pkgs "horovod" && \
8787
# Install all requirements \
8888
pip install -r requirements/devel.txt --no-cache-dir --find-links https://download.pytorch.org/whl/cu${CUDA_VERSION_MM}/torch_stable.html && \
8989
rm -rf requirements.* && \

dockers/base-ipu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ RUN \
8383
python -c "import torch; print(torch.__version__)" && \
8484
python adjust_versions.py requirements-extra.txt && \
8585
pip install -q fire && \
86-
python assistant.py requirements_prune_pkgs requirements-extra.txt --packages fairscale,horovod && \
86+
python assistant.py requirements_prune_pkgs fairscale,horovod --req_files requirements-extra.txt && \
8787
# Install remaining requirements
8888
pip install -r requirements-extra.txt --no-cache-dir && \
8989
pip install -r requirements-test.txt --no-cache-dir && \

dockers/base-xla/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ RUN \
9393
cd pytorch-lightning && \
9494
pip install -q fire && \
9595
# drop packages installed with XLA
96-
python .actions/assistant.py requirements_prune_pkgs requirements.txt --packages torch && \
97-
python .actions/assistant.py requirements_prune_pkgs requirements/examples.txt --packages torchvision && \
96+
python .actions/assistant.py requirements_prune_pkgs torch,torchvision && \
9897
# drop unnecessary packages
99-
python .actions/assistant.py requirements_prune_pkgs requirements/extra.txt --packages fairscale,horovod && \
98+
python .actions/assistant.py requirements_prune_pkgs fairscale,horovod && \
10099
python ./requirements/adjust-versions.py ./requirements/extra.txt && \
101100
# install PL dependencies
102101
pip install --requirement ./requirements/devel.txt --no-cache-dir && \

dockers/nvidia/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RUN \
4242

4343
# Installations \
4444
pip install -q fire && \
45-
python ./pytorch-lightning/.actions/assistant.py requirements_prune_pkgs ./pytorch-lightning/requirements/extra.txt --packages horovod && \
45+
python ./pytorch-lightning/.actions/assistant.py requirements_prune_pkgs horovod --req_files ./pytorch-lightning/requirements/extra.txt && \
4646
pip install "Pillow>=8.2, !=8.3.0" "cryptography>=3.4" "py>=1.10" --no-cache-dir --upgrade-strategy only-if-needed && \
4747
pip install -r ./pytorch-lightning/requirements/extra.txt --no-cache-dir --upgrade-strategy only-if-needed && \
4848
pip install -r ./pytorch-lightning/requirements/examples.txt --no-cache-dir --upgrade-strategy only-if-needed && \

dockers/tpu-tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN cd pytorch-lightning && \
3030
RUN \
3131
pip install -q fire && \
3232
# drop unnecessary packages
33-
python .actions/assistant.py requirements_prune_pkgs ./pytorch-lightning/requirements/extra.txt --packages fairscale,horovod && \
33+
python .actions/assistant.py requirements_prune_pkgs fairscale,horovod --req_files ./pytorch-lightning/requirements/extra.txt && \
3434
pip install -r pytorch-lightning/requirements/devel.txt --no-cache-dir
3535

3636
COPY ./dockers/tpu-tests/docker-entrypoint.sh /usr/local/bin/

0 commit comments

Comments
 (0)