From dc64de0a5019d7a2da9495323db1b627227114d1 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Thu, 1 Jun 2023 18:23:10 +0200 Subject: [PATCH 01/22] Restricting cornac to 1.15.1 --- setup.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 080dad2cb..739b58810 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ install_requires = [ "numpy>=1.19", # 1.19 required by tensorflow 2.6 "pandas>1.0.3,<2", - "scipy>=1.0.0,<2", + "scipy>=1.0.0,<2", "tqdm>=4.31.1,<5", "matplotlib>=2.2.2,<4", "scikit-learn>=0.22.1,<1.0.3", @@ -45,7 +45,7 @@ "jinja2>=2,<3.1", "pyyaml>=5.4.1,<6", "requests>=2.0.0,<3", - "cornac>=1.1.2,<2", + "cornac>=1.1.2,<1.15.2", "retrying>=1.3.3", "pandera[strategies]>=0.6.5", # For generating fake datasets "scikit-surprise>=1.0.6", @@ -137,6 +137,9 @@ install_requires=install_requires, package_dir={"recommenders": "recommenders"}, python_requires=">=3.6, <3.10", - packages=find_packages(where=".", exclude=["contrib", "docs", "examples", "scenarios", "tests", "tools"]), - setup_requires=["numpy>=1.15"] + packages=find_packages( + where=".", + exclude=["contrib", "docs", "examples", "scenarios", "tests", "tools"], + ), + setup_requires=["numpy>=1.15"], ) From 584c4ec16c90aba5e873bb486274175455af27f6 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 08:07:03 +0200 Subject: [PATCH 02/22] restrict cornac --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 739b58810..b7b4ef752 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,8 @@ "jinja2>=2,<3.1", "pyyaml>=5.4.1,<6", "requests>=2.0.0,<3", - "cornac>=1.1.2,<1.15.2", + "cornac>=1.1.2,<1.15.2;python_version<='3.7'", + "cornac>=1.1.2,<2;python_version>='3.8'", "retrying>=1.3.3", "pandera[strategies]>=0.6.5", # For generating fake datasets "scikit-surprise>=1.0.6", From cc8edd1ee32ec769032c0be596f2a241056f55cc Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 08:11:53 +0200 Subject: [PATCH 03/22] Clarification cornac --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b7b4ef752..43857617f 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ "pyyaml>=5.4.1,<6", "requests>=2.0.0,<3", "cornac>=1.1.2,<1.15.2;python_version<='3.7'", - "cornac>=1.1.2,<2;python_version>='3.8'", + "cornac>=1.1.2,<2;python_version>='3.8'", # After 1.15.2, Cornac requires python 3.8 "retrying>=1.3.3", "pandera[strategies]>=0.6.5", # For generating fake datasets "scikit-surprise>=1.0.6", From fce46cc319f41dbb126bf46ea9f0f8445faaa1ef Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 08:13:47 +0200 Subject: [PATCH 04/22] Install the development environment instead of the pip package --- tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index b3a57f1ee..61e850d21 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -205,15 +205,15 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") + conda_dep.add_pip_package(".[dev,examples,spark,gpu]") elif add_gpu_dependencies: - conda_dep.add_pip_package("recommenders[dev,examples,gpu]") + conda_dep.add_pip_package(".[dev,examples,gpu]") elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("recommenders[dev,examples,spark]") + conda_dep.add_pip_package(".[dev,examples,spark]") else: - conda_dep.add_pip_package("recommenders[dev,examples]") + conda_dep.add_pip_package(".[dev,examples]") run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 4938e380374332970042f28f0cd82c5e4ac16f91 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 08:30:46 +0200 Subject: [PATCH 05/22] Install the development environment instead of the pip package --- tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 61e850d21..34639814e 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -205,15 +205,15 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package(".[dev,examples,spark,gpu]") + conda_dep.add_pip_package("[dev,examples,spark,gpu]") elif add_gpu_dependencies: - conda_dep.add_pip_package(".[dev,examples,gpu]") + conda_dep.add_pip_package("[dev,examples,gpu]") elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package(".[dev,examples,spark]") + conda_dep.add_pip_package("[dev,examples,spark]") else: - conda_dep.add_pip_package(".[dev,examples]") + conda_dep.add_pip_package("[dev,examples]") run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 7a69fba3c7a54f727478d4a69814d54b14123729 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 12:51:30 +0200 Subject: [PATCH 06/22] Install the development environment instead of the pip package --- .../submit_groupwise_azureml_pytest.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 34639814e..f8dc5a276 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -205,15 +205,21 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("[dev,examples,spark,gpu]") + # conda_dep.add_pip_package("[dev,examples,spark,gpu]") + run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] elif add_gpu_dependencies: - conda_dep.add_pip_package("[dev,examples,gpu]") + # conda_dep.add_pip_package("[dev,examples,gpu]") + run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("[dev,examples,spark]") + # conda_dep.add_pip_package("[dev,examples,spark]") + run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] + else: - conda_dep.add_pip_package("[dev,examples]") + # conda_dep.add_pip_package("[dev,examples]") + run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] + run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 21460e51fc184c13226438c1f70c25ab9b038369 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 13:01:48 +0200 Subject: [PATCH 07/22] Install the development environment instead of the pip package --- tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index f8dc5a276..ab1c00956 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -206,19 +206,19 @@ def create_run_config( conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) # conda_dep.add_pip_package("[dev,examples,spark,gpu]") - run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] + run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] elif add_gpu_dependencies: # conda_dep.add_pip_package("[dev,examples,gpu]") - run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] + run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) # conda_dep.add_pip_package("[dev,examples,spark]") - run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] + run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] else: # conda_dep.add_pip_package("[dev,examples]") - run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] + run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] run_azuremlcompute.environment.python.conda_dependencies = conda_dep From 71bcd8fe6c906dccec33df7317eb91f946e8298a Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 13:51:38 +0200 Subject: [PATCH 08/22] Install the development environment instead of the pip package --- .../submit_groupwise_azureml_pytest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index ab1c00956..0a55a2ec1 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -205,16 +205,19 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("[dev,examples,spark,gpu]") - run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] + # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel + # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] # not working + run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] elif add_gpu_dependencies: - # conda_dep.add_pip_package("[dev,examples,gpu]") - run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] + # conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel + # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] # not working + run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("[dev,examples,spark]") - run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] + # conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel + # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] # not working + run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] else: # conda_dep.add_pip_package("[dev,examples]") From 643d81b34916b0af750888b25022b1167ffd5254 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 13:52:14 +0200 Subject: [PATCH 09/22] Install the development environment instead of the pip package --- tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 0a55a2ec1..b605dde1f 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -221,7 +221,9 @@ def create_run_config( else: # conda_dep.add_pip_package("[dev,examples]") - run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] + # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] + run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] + run_azuremlcompute.environment.python.conda_dependencies = conda_dep From 6960cb50ddc8408ee454b5381e3829b06f77d545 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Fri, 2 Jun 2023 14:02:02 +0200 Subject: [PATCH 10/22] Try with interpreter options --- .../submit_groupwise_azureml_pytest.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index b605dde1f..9ebf3b230 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -207,24 +207,25 @@ def create_run_config( conda_dep.add_conda_package(conda_pkg_jdk) # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] # not working - run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] + # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] # Error: Both Script and Command cannot be specified with the request + run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark,gpu]" elif add_gpu_dependencies: # conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] # not working - run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] + # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] # Error: Both Script and Command cannot be specified with the request + run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,gpu]" elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) # conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] # not working - run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] - + # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] # Error: Both Script and Command cannot be specified with the request + run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark]" else: # conda_dep.add_pip_package("[dev,examples]") - # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] - run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] - - + # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] # not working + # run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] # Error: Both Script and Command cannot be specified with the request + run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples]" run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From e18a4be9e65402df963ba7eca50f02747d403558 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Mon, 5 Jun 2023 17:21:21 +0200 Subject: [PATCH 11/22] cornac --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 43857617f..95d09e637 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ "pyyaml>=5.4.1,<6", "requests>=2.0.0,<3", "cornac>=1.1.2,<1.15.2;python_version<='3.7'", - "cornac>=1.1.2,<2;python_version>='3.8'", # After 1.15.2, Cornac requires python 3.8 + "cornac>=1.15.2,<2;python_version>='3.8'", # After 1.15.2, Cornac requires python 3.8 "retrying>=1.3.3", "pandera[strategies]>=0.6.5", # For generating fake datasets "scikit-surprise>=1.0.6", From 81c2bcef119886a87a72c531326be351a3fb5320 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Mon, 5 Jun 2023 17:24:58 +0200 Subject: [PATCH 12/22] WIP --- .../submit_groupwise_azureml_pytest.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 9ebf3b230..55ad5311f 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -192,7 +192,7 @@ def create_run_config( whl_url = run_azuremlcompute.environment.add_private_pip_wheel( workspace=workspace, file_path=reco_wheel_path, - exist_ok=True, + exist_ok=False, ) conda_dep = CondaDependencies() conda_dep.add_conda_package(conda_pkg_python) @@ -205,27 +205,27 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel + conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] # not working # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] # Error: Both Script and Command cannot be specified with the request - run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark,gpu]" + # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark,gpu]" elif add_gpu_dependencies: - # conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel + conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] # not working # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] # Error: Both Script and Command cannot be specified with the request - run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,gpu]" + # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,gpu]" elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel + conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] # not working # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] # Error: Both Script and Command cannot be specified with the request - run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark]" + # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark]" else: - # conda_dep.add_pip_package("[dev,examples]") + conda_dep.add_pip_package("recommenders[dev,examples]") # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] # not working # run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] # Error: Both Script and Command cannot be specified with the request - run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples]" + # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples]" run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 21b519be488d826e53d3c18f81138307b5380370 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Tue, 6 Jun 2023 09:47:11 +0200 Subject: [PATCH 13/22] Try building dockerfile --- .github/actions/azureml-test/action.yml | 26 ++-- .../submit_groupwise_azureml_pytest.py | 122 +++++++++++------- 2 files changed, 88 insertions(+), 60 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index 2c83b94da..c37afdbda 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -99,22 +99,24 @@ runs: shell: bash if: contains(inputs.TEST_GROUP, 'gpu') run: >- - python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} - --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} - --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - --disable-warnings + # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} + # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} + # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + # --disable-warnings + print("Skipping GPU tests for now") - name: Submit PySpark tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'spark') run: >- - python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} - --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} - --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - --disable-warnings + # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} + # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} + # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + # --disable-warnings + print("Skipping PySpark tests for now") - name: Print test logs shell: bash run: cat ${{inputs.TEST_LOGS_PATH}} diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 55ad5311f..1d6bb5ba0 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -179,55 +179,81 @@ def create_run_config( run_azuremlcompute = RunConfiguration() run_azuremlcompute.target = cpu_cluster - run_azuremlcompute.environment.docker.enabled = True - run_azuremlcompute.environment.docker.base_image = docker_proc_type + run_azuremlcompute.environment.docker.use_docker = True + # run_azuremlcompute.environment.docker.base_image = docker_proc_type + + dockerfile = """ + FROM mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04 + + ARG HOME + ARG VIRTUAL_ENV + ENV HOME="${HOME}" + WORKDIR ${HOME} + + RUN apt-get update && \ + apt-get install -y curl build-essential + + # Install Anaconda + ARG ANACONDA="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" + RUN curl ${ANACONDA} -o anaconda.sh && \ + /bin/bash anaconda.sh -b -p conda && \ + rm anaconda.sh && \ + echo ". ${HOME}/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate base" >> ~/.bashrc ; fi + + # Install Python packages + RUN conda install python=3.7 + RUN pip install .[dev,examples] - # Use conda_dependencies.yml to create a conda environment in - # the Docker image for execution - # False means the user will provide a conda file for setup - # True means the user will manually configure the environment - run_azuremlcompute.environment.python.user_managed_dependencies = False - - # install local version of recommenders on AzureML compute using .whl file - whl_url = run_azuremlcompute.environment.add_private_pip_wheel( - workspace=workspace, - file_path=reco_wheel_path, - exist_ok=False, - ) - conda_dep = CondaDependencies() - conda_dep.add_conda_package(conda_pkg_python) - conda_dep.add_pip_package(whl_url) - conda_dep.add_pip_package( - "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip" - ) - - # install extra dependencies - if add_gpu_dependencies and add_spark_dependencies: - conda_dep.add_channel("conda-forge") - conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel - # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] # not working - # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] # Error: Both Script and Command cannot be specified with the request - # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark,gpu]" - elif add_gpu_dependencies: - conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel - # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] # not working - # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] # Error: Both Script and Command cannot be specified with the request - # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,gpu]" - elif add_spark_dependencies: - conda_dep.add_channel("conda-forge") - conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel - # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] # not working - # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] # Error: Both Script and Command cannot be specified with the request - # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark]" - else: - conda_dep.add_pip_package("recommenders[dev,examples]") - # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] # not working - # run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] # Error: Both Script and Command cannot be specified with the request - # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples]" - - run_azuremlcompute.environment.python.conda_dependencies = conda_dep + """ + run_azuremlcompute.environment.docker.base_dockerfile = dockerfile + + # # Use conda_dependencies.yml to create a conda environment in + # # the Docker image for execution + # # False means the user will provide a conda file for setup + # # True means the user will manually configure the environment + # run_azuremlcompute.environment.python.user_managed_dependencies = False + + # # install local version of recommenders on AzureML compute using .whl file + # whl_url = run_azuremlcompute.environment.add_private_pip_wheel( + # workspace=workspace, + # file_path=reco_wheel_path, + # exist_ok=True, + # ) + # conda_dep = CondaDependencies() + # conda_dep.add_conda_package(conda_pkg_python) + # conda_dep.add_pip_package(whl_url) + # conda_dep.add_pip_package( + # "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip" + # ) + + # # install extra dependencies + # if add_gpu_dependencies and add_spark_dependencies: + # conda_dep.add_channel("conda-forge") + # conda_dep.add_conda_package(conda_pkg_jdk) + # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel + # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] # not working + # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] # Error: Both Script and Command cannot be specified with the request + # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark,gpu]" + # elif add_gpu_dependencies: + # conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel + # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] # not working + # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] # Error: Both Script and Command cannot be specified with the request + # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,gpu]" + # elif add_spark_dependencies: + # conda_dep.add_channel("conda-forge") + # conda_dep.add_conda_package(conda_pkg_jdk) + # conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel + # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] # not working + # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] # Error: Both Script and Command cannot be specified with the request + # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark]" + # else: + # conda_dep.add_pip_package("recommenders[dev,examples]") + # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] # not working + # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] # Error: Both Script and Command cannot be specified with the request + # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples]" + + # run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From a4adec9196ecc8ba0b27c0060f0f4c9f887817a0 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Tue, 6 Jun 2023 09:53:45 +0200 Subject: [PATCH 14/22] Error with spark and gpu excluded tests --- .github/actions/azureml-test/action.yml | 43 ++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index c37afdbda..dfc39dccf 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -95,28 +95,27 @@ runs: --testlogs ${{inputs.TEST_LOGS_PATH}} --testkind ${{inputs.TEST_KIND}} --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} --disable-warnings - - name: Submit GPU tests to AzureML - shell: bash - if: contains(inputs.TEST_GROUP, 'gpu') - run: >- - # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} - # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} - # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - # --disable-warnings - print("Skipping GPU tests for now") - - name: Submit PySpark tests to AzureML - shell: bash - if: contains(inputs.TEST_GROUP, 'spark') - run: >- - # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} - # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} - # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - # --disable-warnings - print("Skipping PySpark tests for now") + # - name: Submit GPU tests to AzureML + # shell: bash + # if: contains(inputs.TEST_GROUP, 'gpu') + # run: >- + # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} + # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} + # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + # --disable-warnings + # print("Skipping GPU tests for now") + # - name: Submit PySpark tests to AzureML + # shell: bash + # if: contains(inputs.TEST_GROUP, 'spark') + # run: >- + # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} + # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} + # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + # --disable-warnings - name: Print test logs shell: bash run: cat ${{inputs.TEST_LOGS_PATH}} From cdaeb7ad785cf8036d3c1244f2149e2ca3b0bd3e Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Tue, 6 Jun 2023 09:58:50 +0200 Subject: [PATCH 15/22] Error with spark and gpu excluded tests --- .github/actions/azureml-test/action.yml | 43 +++++++++++++------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index dfc39dccf..96c9e64f8 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -95,27 +95,28 @@ runs: --testlogs ${{inputs.TEST_LOGS_PATH}} --testkind ${{inputs.TEST_KIND}} --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} --disable-warnings - # - name: Submit GPU tests to AzureML - # shell: bash - # if: contains(inputs.TEST_GROUP, 'gpu') - # run: >- - # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} - # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} - # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - # --disable-warnings - # print("Skipping GPU tests for now") - # - name: Submit PySpark tests to AzureML - # shell: bash - # if: contains(inputs.TEST_GROUP, 'spark') - # run: >- - # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} - # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} - # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - # --disable-warnings + - name: Submit GPU tests to AzureML + shell: bash + if: contains(inputs.TEST_GROUP, 'gpu') + run: >- + # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} + # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} + # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + # --disable-warnings + touch ${{inputs.TEST_LOGS_PATH}} + - name: Submit PySpark tests to AzureML + shell: bash + if: contains(inputs.TEST_GROUP, 'spark') + run: >- + # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} + # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} + # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + # --disable-warnings + touch ${{inputs.TEST_LOGS_PATH}} - name: Print test logs shell: bash run: cat ${{inputs.TEST_LOGS_PATH}} From 5f80758c8d4ad3ae3707276eec78bee78852a79a Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Tue, 6 Jun 2023 10:32:42 +0200 Subject: [PATCH 16/22] Error with spark and gpu excluded tests --- .github/actions/azureml-test/action.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index 96c9e64f8..5e91b03e8 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -105,7 +105,6 @@ runs: # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} # --disable-warnings - touch ${{inputs.TEST_LOGS_PATH}} - name: Submit PySpark tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'spark') @@ -116,10 +115,9 @@ runs: # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} # --disable-warnings - touch ${{inputs.TEST_LOGS_PATH}} - - name: Print test logs - shell: bash - run: cat ${{inputs.TEST_LOGS_PATH}} + # - name: Print test logs + # shell: bash + # run: cat ${{inputs.TEST_LOGS_PATH}} - name: Get exit status shell: bash id: exit_status From 1c73cfb4bd7223868e32ac22a82f54e3d6bf4165 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Tue, 6 Jun 2023 10:41:06 +0200 Subject: [PATCH 17/22] Error with spark and gpu excluded tests --- tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 1d6bb5ba0..e200d03fe 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -179,7 +179,9 @@ def create_run_config( run_azuremlcompute = RunConfiguration() run_azuremlcompute.target = cpu_cluster - run_azuremlcompute.environment.docker.use_docker = True + + # Enable DockerSection https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.environment.dockersection + run_azuremlcompute.environment.docker.enabled = True # run_azuremlcompute.environment.docker.base_image = docker_proc_type dockerfile = """ From be684425572afb87812f23d55cf274f3d6c0deb0 Mon Sep 17 00:00:00 2001 From: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Date: Wed, 7 Jun 2023 16:13:23 +0800 Subject: [PATCH 18/22] Try to install the local wheel of recommenders --- .github/actions/azureml-test/action.yml | 35 +++--- .../submit_groupwise_azureml_pytest.py | 109 ++++++------------ 2 files changed, 53 insertions(+), 91 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index 5e91b03e8..e86fddb7a 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -84,7 +84,10 @@ runs: run: pip install --quiet wheel - name: Create wheel from setup.py shell: bash - run: python setup.py --quiet bdist_wheel + run: | + random_key=$(openssl rand 1000 | tr -dc 'a-z0-9' | fold -w 9 | head -n 1) + sed -i "/__version__/ s/$/ + '+${random_key}'/" setup.py + python setup.py --quiet bdist_wheel - name: Submit CPU tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'cpu') @@ -99,25 +102,25 @@ runs: shell: bash if: contains(inputs.TEST_GROUP, 'gpu') run: >- - # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} - # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} - # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - # --disable-warnings + python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.GPU_CLUSTER_NAME}} + --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} + --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + --disable-warnings - name: Submit PySpark tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'spark') run: >- - # python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} - # --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} - # --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} - # --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} - # --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - # --disable-warnings - # - name: Print test logs - # shell: bash - # run: cat ${{inputs.TEST_LOGS_PATH}} + python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{inputs.CPU_CLUSTER_NAME}} + --subid ${{inputs.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ github.ref }} + --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} + --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} + --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} + --disable-warnings + - name: Print test logs + shell: bash + run: cat ${{inputs.TEST_LOGS_PATH}} - name: Get exit status shell: bash id: exit_status diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index e200d03fe..ff6d2e199 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -179,83 +179,42 @@ def create_run_config( run_azuremlcompute = RunConfiguration() run_azuremlcompute.target = cpu_cluster - - # Enable DockerSection https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.environment.dockersection run_azuremlcompute.environment.docker.enabled = True - # run_azuremlcompute.environment.docker.base_image = docker_proc_type - - dockerfile = """ - FROM mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04 - - ARG HOME - ARG VIRTUAL_ENV - ENV HOME="${HOME}" - WORKDIR ${HOME} - - RUN apt-get update && \ - apt-get install -y curl build-essential - - # Install Anaconda - ARG ANACONDA="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" - RUN curl ${ANACONDA} -o anaconda.sh && \ - /bin/bash anaconda.sh -b -p conda && \ - rm anaconda.sh && \ - echo ". ${HOME}/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ - echo "conda activate base" >> ~/.bashrc ; fi - - # Install Python packages - RUN conda install python=3.7 - RUN pip install .[dev,examples] + run_azuremlcompute.environment.docker.base_image = docker_proc_type - """ - run_azuremlcompute.environment.docker.base_dockerfile = dockerfile - - # # Use conda_dependencies.yml to create a conda environment in - # # the Docker image for execution - # # False means the user will provide a conda file for setup - # # True means the user will manually configure the environment - # run_azuremlcompute.environment.python.user_managed_dependencies = False - - # # install local version of recommenders on AzureML compute using .whl file - # whl_url = run_azuremlcompute.environment.add_private_pip_wheel( - # workspace=workspace, - # file_path=reco_wheel_path, - # exist_ok=True, - # ) - # conda_dep = CondaDependencies() - # conda_dep.add_conda_package(conda_pkg_python) - # conda_dep.add_pip_package(whl_url) - # conda_dep.add_pip_package( - # "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip" - # ) - - # # install extra dependencies - # if add_gpu_dependencies and add_spark_dependencies: - # conda_dep.add_channel("conda-forge") - # conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]") # Not working, it installs the pip package instead of the local wheel - # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark,gpu]"] # not working - # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark,gpu]"] # Error: Both Script and Command cannot be specified with the request - # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark,gpu]" - # elif add_gpu_dependencies: - # conda_dep.add_pip_package("recommenders[dev,examples,gpu]") # Not working, it installs the pip package instead of the local wheel - # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,gpu]"] # not working - # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,gpu]"] # Error: Both Script and Command cannot be specified with the request - # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,gpu]" - # elif add_spark_dependencies: - # conda_dep.add_channel("conda-forge") - # conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("recommenders[dev,examples,spark]") # Not working, it installs the pip package instead of the local wheel - # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples,spark]"] # not working - # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples,spark]"] # Error: Both Script and Command cannot be specified with the request - # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples,spark]" - # else: - # conda_dep.add_pip_package("recommenders[dev,examples]") - # # run_azuremlcompute.script = ["pip", "install", ".[dev,examples]"] # not working - # # run_azuremlcompute.command = ["pip", "install", ".[dev,examples]"] # Error: Both Script and Command cannot be specified with the request - # # run_azuremlcompute.environment.python.interpreter_options = "-m venv .venv && source .venv/bin/activate && pip install -e .[dev,examples]" - - # run_azuremlcompute.environment.python.conda_dependencies = conda_dep + # Use conda_dependencies.yml to create a conda environment in + # the Docker image for execution + # False means the user will provide a conda file for setup + # True means the user will manually configure the environment + run_azuremlcompute.environment.python.user_managed_dependencies = False + + # install local version of recommenders on AzureML compute using .whl file + whl_url = run_azuremlcompute.environment.add_private_pip_wheel( + workspace=workspace, + file_path=reco_wheel_path, + exist_ok=True, + ) + conda_dep = CondaDependencies() + conda_dep.add_conda_package(conda_pkg_python) + conda_dep.add_pip_package( + "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip" + ) + + # install extra dependencies + if add_gpu_dependencies and add_spark_dependencies: + conda_dep.add_channel("conda-forge") + conda_dep.add_conda_package(conda_pkg_jdk) + conda_dep.add_pip_package(whl_url + "[dev,examples,spark,gpu]") + elif add_gpu_dependencies: + conda_dep.add_pip_package(whl_url + "[dev,examples,gpu]") + elif add_spark_dependencies: + conda_dep.add_channel("conda-forge") + conda_dep.add_conda_package(conda_pkg_jdk) + conda_dep.add_pip_package(whl_url + "[dev,examples,spark]") + else: + conda_dep.add_pip_package(whl_url + "[dev,examples]") + + run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 67c6d25edb4ac91de12cf45f1328c07dd1b438ab Mon Sep 17 00:00:00 2001 From: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Date: Wed, 7 Jun 2023 17:12:12 +0800 Subject: [PATCH 19/22] Change pip install scheme --- tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index ff6d2e199..3cd20d214 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -204,15 +204,15 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package(whl_url + "[dev,examples,spark,gpu]") + conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]@" + whl_url) elif add_gpu_dependencies: - conda_dep.add_pip_package(whl_url + "[dev,examples,gpu]") + conda_dep.add_pip_package("recommenders[dev,examples,gpu]@" + whl_url) elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package(whl_url + "[dev,examples,spark]") + conda_dep.add_pip_package("recommenders[dev,examples,spark]@" + whl_url) else: - conda_dep.add_pip_package(whl_url + "[dev,examples]") + conda_dep.add_pip_package("recommenders[dev,examples]@" + whl_url) run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 754e4282713e27523de592924310717c1e29f6f2 Mon Sep 17 00:00:00 2001 From: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Date: Thu, 8 Jun 2023 10:33:54 +0800 Subject: [PATCH 20/22] Test normal usage of Environment.add_private_pip_wheel() --- .../azureml_tests/submit_groupwise_azureml_pytest.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 3cd20d214..816d511fd 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -204,15 +204,19 @@ def create_run_config( if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]@" + whl_url) + # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]@" + whl_url) + conda_dep.add_pip_package(whl_url) elif add_gpu_dependencies: - conda_dep.add_pip_package("recommenders[dev,examples,gpu]@" + whl_url) + # conda_dep.add_pip_package("recommenders[dev,examples,gpu]@" + whl_url) + conda_dep.add_pip_package(whl_url) elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - conda_dep.add_pip_package("recommenders[dev,examples,spark]@" + whl_url) + # conda_dep.add_pip_package("recommenders[dev,examples,spark]@" + whl_url) + conda_dep.add_pip_package(whl_url) else: - conda_dep.add_pip_package("recommenders[dev,examples]@" + whl_url) + # conda_dep.add_pip_package("recommenders[dev,examples]@" + whl_url) + conda_dep.add_pip_package(whl_url) run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute From 28cdedcbe1a729c4a7e02675953681a5696dfecc Mon Sep 17 00:00:00 2001 From: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Date: Thu, 8 Jun 2023 15:54:29 +0800 Subject: [PATCH 21/22] Install recommenders from GitHub --- .github/actions/azureml-test/action.yml | 6 +-- .../submit_groupwise_azureml_pytest.py | 40 ++++++++----------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index e86fddb7a..f39877dce 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -97,7 +97,7 @@ runs: --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} --testlogs ${{inputs.TEST_LOGS_PATH}} --testkind ${{inputs.TEST_KIND}} --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - --disable-warnings + --disable-warnings --sha "${GITHUB_SHA}" - name: Submit GPU tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'gpu') @@ -107,7 +107,7 @@ runs: --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} --testlogs ${{inputs.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind ${{inputs.TEST_KIND}} --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - --disable-warnings + --disable-warnings --sha "${GITHUB_SHA}" - name: Submit PySpark tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'spark') @@ -117,7 +117,7 @@ runs: --rg ${{inputs.RG}} --wsname ${{inputs.WS}} --expname ${{inputs.EXP_NAME}}_${{inputs.TEST_GROUP}} --testlogs ${{inputs.TEST_LOGS_PATH}} --add_spark_dependencies --testkind ${{inputs.TEST_KIND}} --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - --disable-warnings + --disable-warnings --sha "${GITHUB_SHA}" - name: Print test logs shell: bash run: cat ${{inputs.TEST_LOGS_PATH}} diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 816d511fd..190089054 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -152,7 +152,7 @@ def create_run_config( add_spark_dependencies, conda_pkg_jdk, conda_pkg_python, - reco_wheel_path, + commit_sha, ): """ AzureML requires the run environment to be setup prior to submission. @@ -172,6 +172,7 @@ def create_run_config( added to the conda environment, else False add_spark_dependencies (bool) : True if PySpark packages should be added to the conda environment, else False + commit_sha (str) : the commit that triggers the workflow Return: run_azuremlcompute : AzureML run config @@ -188,35 +189,28 @@ def create_run_config( # True means the user will manually configure the environment run_azuremlcompute.environment.python.user_managed_dependencies = False - # install local version of recommenders on AzureML compute using .whl file - whl_url = run_azuremlcompute.environment.add_private_pip_wheel( - workspace=workspace, - file_path=reco_wheel_path, - exist_ok=True, - ) conda_dep = CondaDependencies() conda_dep.add_conda_package(conda_pkg_python) conda_dep.add_pip_package( "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip" ) - # install extra dependencies + # install recommenders + reco_extras = "dev,examples" if add_gpu_dependencies and add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("recommenders[dev,examples,spark,gpu]@" + whl_url) - conda_dep.add_pip_package(whl_url) + reco_extras = reco_extras + ",spark,gpu" elif add_gpu_dependencies: - # conda_dep.add_pip_package("recommenders[dev,examples,gpu]@" + whl_url) - conda_dep.add_pip_package(whl_url) + reco_extras = reco_extras + ",gpu" elif add_spark_dependencies: conda_dep.add_channel("conda-forge") conda_dep.add_conda_package(conda_pkg_jdk) - # conda_dep.add_pip_package("recommenders[dev,examples,spark]@" + whl_url) - conda_dep.add_pip_package(whl_url) - else: - # conda_dep.add_pip_package("recommenders[dev,examples]@" + whl_url) - conda_dep.add_pip_package(whl_url) + reco_extras = reco_extras + ",spark" + + conda_dep.add_pip_package( + f"recommenders[{reco_extras}]@git+https://github.com/microsoft/recommenders.git@{commit_sha}" + ) run_azuremlcompute.environment.python.conda_dependencies = conda_dep return run_azuremlcompute @@ -289,6 +283,11 @@ def create_arg_parser(): """ parser = argparse.ArgumentParser(description="Process some inputs") + parser.add_argument( + "--sha", + action="store", + help="the commit that triggers the workflow", + ) # script to run pytest parser.add_argument( "--test", @@ -451,11 +450,6 @@ def create_arg_parser(): max_nodes=args.maxnodes, ) - wheel_list = glob.glob("./dist/*.whl") - if not wheel_list: - logger.error("Wheel not found!") - logger.info("Found wheel at " + wheel_list[0]) - run_config = create_run_config( cpu_cluster=cpu_cluster, docker_proc_type=docker_proc_type, @@ -464,7 +458,7 @@ def create_arg_parser(): add_spark_dependencies=args.add_spark_dependencies, conda_pkg_jdk=args.conda_pkg_jdk, conda_pkg_python=args.conda_pkg_python, - reco_wheel_path=wheel_list[0], + commit_sha=args.sha, ) logger.info("exp: In Azure, look for experiment named {}".format(args.expname)) From caf71920e4d2f7d458c43b63ffa64207f86bac5b Mon Sep 17 00:00:00 2001 From: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Date: Thu, 8 Jun 2023 16:59:56 +0800 Subject: [PATCH 22/22] Clean up --- .github/actions/azureml-test/action.yml | 6 ------ setup.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index f39877dce..72b7e7dea 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -82,12 +82,6 @@ runs: - name: Install wheel package shell: bash run: pip install --quiet wheel - - name: Create wheel from setup.py - shell: bash - run: | - random_key=$(openssl rand 1000 | tr -dc 'a-z0-9' | fold -w 9 | head -n 1) - sed -i "/__version__/ s/$/ + '+${random_key}'/" setup.py - python setup.py --quiet bdist_wheel - name: Submit CPU tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'cpu') diff --git a/setup.py b/setup.py index 95d09e637..dbf919882 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ install_requires = [ "numpy>=1.19", # 1.19 required by tensorflow 2.6 "pandas>1.0.3,<2", - "scipy>=1.0.0,<2", + "scipy>=1.0.0,<2", "tqdm>=4.31.1,<5", "matplotlib>=2.2.2,<4", "scikit-learn>=0.22.1,<1.0.3",