From 74404504b6b449e6a0cb3e16ac456343bec2e2c2 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:59:40 +0100 Subject: [PATCH 1/5] Move merlin deps install from commands to deps configuration --- tox.ini | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tox.ini b/tox.ini index da0c1239a3..83a3d021a8 100644 --- a/tox.ini +++ b/tox.ini @@ -16,13 +16,13 @@ setenv = ; Runs in: Github Actions ; Runs all CPU-based tests. NOTE: if you are using an M1 mac, this will fail. You need to ; change the tensorflow dependency to `tensorflow-macos` in requirements/test-cpu.txt. -deps = -rrequirements/test.txt +deps = + -rrequirements/test.txt + git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_REF} commands = - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main} - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git@{posargs:main} - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/models.git@{posargs:main} - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main} - python -m pytest --cov-report term --cov=merlin -rxs tests/unit + python -m pytest --cov-report term --cov=merlin -rxs {posargs:tests/unit} [testenv:test-gpu] setenv = @@ -39,14 +39,12 @@ sitepackages=true ; to install requirements.txt yet. As we get better at python environment isolation, we will ; need to add some back. deps = - pytest - pytest-cov + -rrequirements/test.txt + git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_REF} commands = - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/models.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main} - python -m pytest --cov-report term --cov merlin -rxs tests/unit + python -m pytest --cov-report term --cov merlin -rxs {posargs:tests/unit} [testenv:test-merlin] ; Runs in: Internal Jenkins @@ -90,4 +88,3 @@ commands = python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git sphinx-multiversion --dump-metadata docs/source docs/build/html | jq "keys" sphinx-multiversion docs/source docs/build/html - From bfc3d2baf99617abaedaac466db64d916b90d7d7 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:55:36 +0100 Subject: [PATCH 2/5] Move dependencies to deps section of tox environment --- requirements/test.txt | 2 +- tox.ini | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/requirements/test.txt b/requirements/test.txt index 0a29deeed9..93b974e66a 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -19,7 +19,7 @@ s3fs>=2021.4 aiobotocore>=1.3.3 # required for synthetic data `merlin.datasets` and notebook tests using merlin models -merlin-models[tensorflow]@git+https://github.com/NVIDIA-Merlin/models.git +merlin-models[tensorflow] # needed to run notebook tests nest-asyncio diff --git a/tox.ini b/tox.ini index 83a3d021a8..d3e22d440e 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ passenv = NR_USER CUDA_VISIBLE_DEVICES sitepackages=true -; Runs in: Internal Jenkins +; Runs in: GitHub Actions ; Runs GPU-based tests. ; The jenkins jobs run on an image based on merlin-hugectr. This will include all cudf configuration ; and other gpu-specific libraries that we can enxpect will always exist. Thus, we don't need @@ -55,15 +55,13 @@ sitepackages=true allowlist_externals = git deps = -rrequirements/gpu.txt + git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/systems.git@{env:MERLIN_REF} commands = ; the GIT_COMMIT env is the current commit of the systems repo ; NOTE!!!! We must clean this up in the jenkins configuration with `rm -rf "Merlin-$GIT_COMMIT"` - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/models.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/systems.git - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main} - python -m pip install . git clone https://github.com/NVIDIA-Merlin/Merlin.git Merlin-{env:GIT_COMMIT} From 5c797f0108e0af940bd30ec7739084238c597d28 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:58:40 +0100 Subject: [PATCH 3/5] Move core dependency to deps section --- tox.ini | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index d3e22d440e..377a495a21 100644 --- a/tox.ini +++ b/tox.ini @@ -62,7 +62,6 @@ deps = commands = ; the GIT_COMMIT env is the current commit of the systems repo ; NOTE!!!! We must clean this up in the jenkins configuration with `rm -rf "Merlin-$GIT_COMMIT"` - git clone https://github.com/NVIDIA-Merlin/Merlin.git Merlin-{env:GIT_COMMIT} ; this runs the tests then removes the Merlin repo directory whether the tests work or fail @@ -73,16 +72,18 @@ commands = ; Generates documentation with sphinx. There are other steps in the Github Actions workflow ; to publish the documentation on release. changedir = {toxinidir} -deps = -rrequirements/docs.txt +deps = + -rrequirements/docs.txt + git+https://github.com/NVIDIA-Merlin/core.git commands = - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git python -m sphinx.cmd.build -P -b {posargs:html} docs/source docs/build/{posargs:html} [testenv:docs-multi] ; Run the multi-version build that is shown on GitHub Pages. changedir = {toxinidir} -deps = -rrequirements/docs.txt +deps = + -rrequirements/docs.txt + git+https://github.com/NVIDIA-Merlin/core.git commands = - python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git sphinx-multiversion --dump-metadata docs/source docs/build/html | jq "keys" sphinx-multiversion docs/source docs/build/html From 3317c8d4949c1bd096cb806ee0029758a83b381a Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:58:57 +0100 Subject: [PATCH 4/5] Pass MERLIN_REF env var through tox command --- .github/workflows/cpu-tests.yml | 2 +- .github/workflows/gpu-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpu-tests.yml b/.github/workflows/cpu-tests.yml index 431e82ccc7..6e880a93a2 100644 --- a/.github/workflows/cpu-tests.yml +++ b/.github/workflows/cpu-tests.yml @@ -49,7 +49,7 @@ jobs: raw=$(git branch -r --contains ${{ github.ref_name }}) branch=${raw/origin\/} fi - tox -e test-cpu -- $branch + MERLIN_REF=$branch tox -e test-cpu # Build docs, treat warnings as errors - name: Building docs diff --git a/.github/workflows/gpu-tests.yml b/.github/workflows/gpu-tests.yml index a12bdad57f..8fafe27b55 100644 --- a/.github/workflows/gpu-tests.yml +++ b/.github/workflows/gpu-tests.yml @@ -31,4 +31,4 @@ jobs: raw=$(git branch -r --contains ${{ github.ref_name }}) branch=${raw/origin\/} fi - cd ${{ github.workspace }}; tox -e test-gpu -- $branch + cd ${{ github.workspace }}; MERLIN_REF=$branch tox -e test-gpu From 552879784b91bd0cac189ffcfae614828f811f28 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 12:10:38 +0100 Subject: [PATCH 5/5] Rename MERLIN_REF to MERLIN_BRANCH --- .github/workflows/cpu-tests.yml | 2 +- .github/workflows/gpu-tests.yml | 2 +- tox.ini | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cpu-tests.yml b/.github/workflows/cpu-tests.yml index 6e880a93a2..c3f0127887 100644 --- a/.github/workflows/cpu-tests.yml +++ b/.github/workflows/cpu-tests.yml @@ -49,7 +49,7 @@ jobs: raw=$(git branch -r --contains ${{ github.ref_name }}) branch=${raw/origin\/} fi - MERLIN_REF=$branch tox -e test-cpu + MERLIN_BRANCH=$branch tox -e test-cpu # Build docs, treat warnings as errors - name: Building docs diff --git a/.github/workflows/gpu-tests.yml b/.github/workflows/gpu-tests.yml index 8fafe27b55..5b93fd9756 100644 --- a/.github/workflows/gpu-tests.yml +++ b/.github/workflows/gpu-tests.yml @@ -31,4 +31,4 @@ jobs: raw=$(git branch -r --contains ${{ github.ref_name }}) branch=${raw/origin\/} fi - cd ${{ github.workspace }}; MERLIN_REF=$branch tox -e test-gpu + cd ${{ github.workspace }}; MERLIN_BRANCH=$branch tox -e test-gpu diff --git a/tox.ini b/tox.ini index 377a495a21..fd532cb1d1 100644 --- a/tox.ini +++ b/tox.ini @@ -18,9 +18,9 @@ setenv = ; change the tensorflow dependency to `tensorflow-macos` in requirements/test-cpu.txt. deps = -rrequirements/test.txt - git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_BRANCH} commands = python -m pytest --cov-report term --cov=merlin -rxs {posargs:tests/unit} @@ -40,9 +40,9 @@ sitepackages=true ; need to add some back. deps = -rrequirements/test.txt - git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_BRANCH} commands = python -m pytest --cov-report term --cov merlin -rxs {posargs:tests/unit} @@ -55,10 +55,10 @@ sitepackages=true allowlist_externals = git deps = -rrequirements/gpu.txt - git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_REF} - git+https://github.com/NVIDIA-Merlin/systems.git@{env:MERLIN_REF} + git+https://github.com/NVIDIA-Merlin/core.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/dataloader.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/models.git@{env:MERLIN_BRANCH} + git+https://github.com/NVIDIA-Merlin/systems.git@{env:MERLIN_BRANCH} commands = ; the GIT_COMMIT env is the current commit of the systems repo ; NOTE!!!! We must clean this up in the jenkins configuration with `rm -rf "Merlin-$GIT_COMMIT"`