From ee5d0239a32ae613c7558f3c4cfc885ec8bbb495 Mon Sep 17 00:00:00 2001 From: amlrelsa-ms Date: Mon, 20 Jun 2022 20:45:50 +0000 Subject: [PATCH] update samples from Release-146 as a part of SDK release --- .../experimental/automl_thin_client_env.yml | 2 + .../automl_thin_client_env_mac.yml | 2 + ...regression-explanation-featurization.ipynb | 38 ++----------------- .../docker/Dockerfile-cpu | 2 + .../docker/Dockerfile-gpu | 3 ++ .../pong_rllib.ipynb | 4 +- .../cartpole_ci.ipynb | 2 +- .../files/docker/Dockerfile | 1 + .../cartpole_sc.ipynb | 2 +- .../files/docker/Dockerfile | 4 +- .../docker/cpu/Dockerfile | 4 +- .../multiagent-particle-envs/particle.ipynb | 2 +- 12 files changed, 24 insertions(+), 42 deletions(-) diff --git a/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env.yml b/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env.yml index 4696f1f2..7b03b84d 100644 --- a/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env.yml +++ b/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env.yml @@ -9,9 +9,11 @@ dependencies: - PyJWT < 2.0.0 - numpy==1.18.5 - pywin32==227 +- cryptography<37.0.0 - pip: # Required packages for AzureML execution, history, and data preparation. + - azure-mgmt-core==1.3.0 - azure-core==1.21.1 - azure-identity==1.7.0 - azureml-defaults diff --git a/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env_mac.yml b/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env_mac.yml index cb520bea..b8a02c6e 100644 --- a/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env_mac.yml +++ b/how-to-use-azureml/automated-machine-learning/experimental/automl_thin_client_env_mac.yml @@ -11,9 +11,11 @@ dependencies: - urllib3==1.26.7 - PyJWT < 2.0.0 - numpy==1.19.5 +- cryptography<37.0.0 - pip: # Required packages for AzureML execution, history, and data preparation. + - azure-mgmt-core==1.3.0 - azure-core==1.21.1 - azure-identity==1.7.0 - azureml-defaults diff --git a/how-to-use-azureml/automated-machine-learning/regression-explanation-featurization/auto-ml-regression-explanation-featurization.ipynb b/how-to-use-azureml/automated-machine-learning/regression-explanation-featurization/auto-ml-regression-explanation-featurization.ipynb index b6ef3ac7..063c8254 100644 --- a/how-to-use-azureml/automated-machine-learning/regression-explanation-featurization/auto-ml-regression-explanation-featurization.ipynb +++ b/how-to-use-azureml/automated-machine-learning/regression-explanation-featurization/auto-ml-regression-explanation-featurization.ipynb @@ -513,17 +513,7 @@ "conda_run_config.environment.docker.enabled = True\n", "\n", "# specify CondaDependencies obj\n", - "conda_run_config.environment.python.conda_dependencies = (\n", - " automl_run.get_environment().python.conda_dependencies\n", - ")\n", - "\n", - "conda_run_config.environment.python.conda_dependencies.add_pip_package(\n", - " \"dotnetcore2==2.1.23\"\n", - ")\n", - "\n", - "conda_run_config.environment.python.conda_dependencies.add_pip_package(\n", - " \"protobuf==3.20.1\"\n", - ")" + "conda_run_config.environment = automl_run.get_environment()" ] }, { @@ -652,28 +642,6 @@ ")" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create the conda dependencies for setting up the service\n", - "We need to create the conda dependencies comprising of the *azureml* packages using the training environment from the *automl_run*." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "conda_dep = conda_run_config.environment.python.conda_dependencies\n", - "\n", - "with open(\"myenv.yml\", \"w\") as f:\n", - " f.write(conda_dep.serialize_to_string())\n", - "with open(\"myenv.yml\", \"r\") as f:\n", - " print(f.read())" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -696,7 +664,7 @@ "metadata": {}, "source": [ "### Deploy the service\n", - "In the cell below, we deploy the service using the conda file and the scoring file from the previous steps. " + "In the cell below, we deploy the service using the automl training environment and the scoring file from the previous steps. " ] }, { @@ -718,7 +686,7 @@ " description=\"Get local explanations for Machine test data\",\n", ")\n", "\n", - "myenv = Environment.from_conda_specification(name=\"myenv\", file_path=\"myenv.yml\")\n", + "myenv = automl_run.get_environment()\n", "inference_config = InferenceConfig(entry_script=\"score_explain.py\", environment=myenv)\n", "\n", "# Use configs and models generated above\n", diff --git a/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-cpu b/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-cpu index 24af8505..18e97c96 100644 --- a/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-cpu +++ b/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-cpu @@ -11,6 +11,8 @@ RUN pip install azureml-core RUN pip install ray==0.8.7 RUN pip install ray[rllib,tune,serve]==0.8.7 RUN pip install tensorflow==1.14.0 +RUN pip install 'msrest<0.7.0' +RUN pip install protobuf==3.20.0 RUN apt-get update RUN apt-get install -y jq diff --git a/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-gpu b/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-gpu index 31ce41e0..3b156a71 100644 --- a/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-gpu +++ b/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/docker/Dockerfile-gpu @@ -69,6 +69,9 @@ RUN pip install --no-cache-dir \ # This is required for ray 0.8.7 RUN pip install -U aiohttp==3.7.4 +RUN pip install 'msrest<0.7.0' +RUN pip install protobuf==3.20.0 + # This is needed for mpi to locate libpython ENV LD_LIBRARY_PATH $AZUREML_CONDA_ENVIRONMENT_PATH/lib:$LD_LIBRARY_PATH diff --git a/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb b/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb index ce5bd6f4..6453d3ac 100644 --- a/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb +++ b/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb @@ -93,11 +93,11 @@ "source": [ "%matplotlib inline\n", "\n", - "# Azure Machine Learning Core imports\n", + "# Azure Machine Learning core imports\n", "import azureml.core\n", "\n", "# Check core SDK version number\n", - "print(\"Azure Machine Learning SDK Version: \", azureml.core.VERSION)" + "print(\"Azure Machine Learning SDK version: \", azureml.core.VERSION)" ] }, { diff --git a/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/cartpole_ci.ipynb b/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/cartpole_ci.ipynb index 8eea14f6..63734d11 100644 --- a/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/cartpole_ci.ipynb +++ b/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/cartpole_ci.ipynb @@ -90,7 +90,7 @@ "outputs": [], "source": [ "import azureml.core\n", - "print(\"Azure Machine Learning SDK Version:\", azureml.core.VERSION)" + "print(\"Azure Machine Learning SDK version:\", azureml.core.VERSION)" ] }, { diff --git a/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/files/docker/Dockerfile b/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/files/docker/Dockerfile index 897dff47..ae9726e1 100644 --- a/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/files/docker/Dockerfile +++ b/how-to-use-azureml/reinforcement-learning/cartpole-on-compute-instance/files/docker/Dockerfile @@ -12,6 +12,7 @@ RUN pip install azureml-dataset-runtime RUN pip install ray==0.8.7 RUN pip install ray[rllib,tune,serve]==0.8.7 RUN pip install tensorflow==1.14.0 +RUN pip install 'msrest<0.7.0' RUN apt-get update RUN apt-get install -y jq diff --git a/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/cartpole_sc.ipynb b/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/cartpole_sc.ipynb index cf7a11b8..c1b5cd9a 100644 --- a/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/cartpole_sc.ipynb +++ b/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/cartpole_sc.ipynb @@ -91,7 +91,7 @@ "source": [ "import azureml.core\n", "\n", - "print(\"Azure Machine Learning SDK Version:\", azureml.core.VERSION)" + "print(\"Azure Machine Learning SDK version:\", azureml.core.VERSION)" ] }, { diff --git a/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/files/docker/Dockerfile b/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/files/docker/Dockerfile index 9fa28a81..2a3c79fb 100644 --- a/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/files/docker/Dockerfile +++ b/how-to-use-azureml/reinforcement-learning/cartpole-on-single-compute/files/docker/Dockerfile @@ -33,4 +33,6 @@ RUN pip install ray-on-aml==0.1.6 & \ RUN pip install protobuf==3.20.0 RUN pip install --upgrade ray==0.8.3 \ - ray[rllib,dashboard,tune]==0.8.3 \ No newline at end of file + ray[rllib,dashboard,tune]==0.8.3 + +RUN pip install 'msrest<0.7.0' \ No newline at end of file diff --git a/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/docker/cpu/Dockerfile b/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/docker/cpu/Dockerfile index 9806b850..4bbda0d5 100644 --- a/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/docker/cpu/Dockerfile +++ b/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/docker/cpu/Dockerfile @@ -33,4 +33,6 @@ RUN pip install protobuf==3.20.0 RUN pip3 install --upgrade \ ray==0.8.7 \ ray[rllib]==0.8.7 \ - ray[tune]==0.8.7 \ No newline at end of file + ray[tune]==0.8.7 + +RUN pip install 'msrest<0.7.0' \ No newline at end of file diff --git a/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/particle.ipynb b/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/particle.ipynb index 5e99a9b5..97ea9a75 100644 --- a/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/particle.ipynb +++ b/how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/particle.ipynb @@ -85,7 +85,7 @@ "outputs": [], "source": [ "import azureml.core\n", - "print('Azure Machine Learning SDK Version: ', azureml.core.VERSION)" + "print('Azure Machine Learning SDK version: ', azureml.core.VERSION)" ] }, {