diff --git a/.github/actions/azureml-test/action.yml b/.github/actions/azureml-test/action.yml index da4e1a403b..673f84b6c0 100644 --- a/.github/actions/azureml-test/action.yml +++ b/.github/actions/azureml-test/action.yml @@ -48,12 +48,12 @@ inputs: RG: required: false type: string - default: "recommenders_project_resources" + default: "recommenders_project_resources" # AzureML workspace name WS: required: false type: string - default: "azureml-test-workspace" + default: "azureml-test-workspace" # test logs path TEST_LOGS_PATH: required: false @@ -70,7 +70,7 @@ runs: steps: - name: Setup python uses: actions/setup-python@v4 - with: + with: python-version: "3.8" - name: Install azureml-core and azure-cli on a GitHub hosted server shell: bash @@ -92,9 +92,9 @@ runs: 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}} --testkind ${{inputs.TEST_KIND}} + --testlogs ${{inputs.TEST_LOGS_PATH}} --testkind ${{inputs.TEST_KIND}} --conda_pkg_python ${{inputs.PYTHON_VERSION}} --testgroup ${{inputs.TEST_GROUP}} - --disable-warnings + --disable-warnings - name: Submit GPU tests to AzureML shell: bash if: contains(inputs.TEST_GROUP, 'gpu') diff --git a/recommenders/utils/spark_utils.py b/recommenders/utils/spark_utils.py index b294879375..4162c00728 100644 --- a/recommenders/utils/spark_utils.py +++ b/recommenders/utils/spark_utils.py @@ -30,7 +30,7 @@ def start_or_get_spark( Args: app_name (str): set name of the application url (str): URL for spark master - memory (str): size of memory for spark driver + memory (str): size of memory for spark driver. This will be ignored if spark.driver.memory is set in config. config (dict): dictionary of configuration options packages (list): list of packages to install jars (list): list of jar files to add @@ -65,5 +65,9 @@ def start_or_get_spark( if config is None or "spark.driver.memory" not in config: spark_opts.append('config("spark.driver.memory", "{}")'.format(memory)) + # Set larger stack size + spark_opts.append('config("spark.executor.extraJavaOptions", "-Xss4m")') + spark_opts.append('config("spark.driver.extraJavaOptions", "-Xss4m")') + spark_opts.append("getOrCreate()") return eval(".".join(spark_opts)) diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index 2c9fe3dadb..b3a57f1ee7 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -266,7 +266,6 @@ def submit_experiment_to_azureml( script=test, run_config=run_config, arguments=arguments, - # docker_runtime_config=dc ) run = experiment.submit(script_run_config) # waits only for configuration to complete @@ -479,9 +478,13 @@ def create_arg_parser(): ) # add helpful information to experiment on Azure + run.tag("Python", args.conda_pkg_python) run.tag("RepoName", args.reponame) run.tag("Branch", args.branch) run.tag("PR", args.pr) + run.tag("script", args.test) + run.tag("testgroup", args.testgroup) + run.tag("testkind", args.testkind) # download logs file from AzureML run.download_file(name="test_logs", output_file_path=args.testlogs) diff --git a/tests/ci/azureml_tests/test_groups.py b/tests/ci/azureml_tests/test_groups.py index bd1cc4cec3..a244af6f4a 100644 --- a/tests/ci/azureml_tests/test_groups.py +++ b/tests/ci/azureml_tests/test_groups.py @@ -113,7 +113,8 @@ ], "group_gpu_005": [ # Total group time: 1844.05s "tests/unit/examples/test_notebooks_gpu.py::test_gpu_vm", # 0.76s (Always the first test to check the GPU works) - "tests/integration/examples/test_notebooks_gpu.py::test_wide_deep_integration", # 1843.29s + # FIXME: https://github.com/microsoft/recommenders/issues/1883 + # "tests/integration/examples/test_notebooks_gpu.py::test_wide_deep_integration", # 1843.29s # "tests/smoke/examples/test_notebooks_gpu.py::test_npa_smoke", # 366.22s # FIXME: https://github.com/microsoft/recommenders/issues/1883 @@ -146,8 +147,7 @@ # "tests/smoke/examples/test_notebooks_pyspark.py::test_als_pyspark_smoke", # 49.53s "tests/integration/examples/test_notebooks_pyspark.py::test_als_pyspark_integration", # 110.58s - # FIXME: https://github.com/microsoft/recommenders/issues/1898 - # "tests/integration/examples/test_notebooks_pyspark.py::test_benchmark_movielens_pyspark", # 142s + "tests/integration/examples/test_notebooks_pyspark.py::test_benchmark_movielens_pyspark", # 142s ], } diff --git a/tests/integration/examples/test_notebooks_pyspark.py b/tests/integration/examples/test_notebooks_pyspark.py index 9b1a7b9558..2ad878e049 100644 --- a/tests/integration/examples/test_notebooks_pyspark.py +++ b/tests/integration/examples/test_notebooks_pyspark.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import os import sys import pytest @@ -79,6 +80,11 @@ def test_mmlspark_lightgbm_criteo_integration(notebooks, output_notebook, kernel ) def test_benchmark_movielens_pyspark(notebooks, output_notebook, kernel_name, size, algos, expected_values_ndcg): notebook_path = notebooks["benchmark_movielens"] + + os.environ["PYSPARK_PYTHON"] = sys.executable + os.environ["PYSPARK_DRIVER_PYTHON"] = sys.executable + os.environ.pop("SPARK_HOME", None) + pm.execute_notebook( notebook_path, output_notebook,