diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24226af4ee..65b7c0ee0c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,10 @@ Before sending us a pull request, please ensure that: 1. Follow the instructions at [Modifying an EBS Volume Using Elastic Volumes (Console)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/requesting-ebs-volume-modifications.html#modify-ebs-volume) to increase the EBS volume size associated with the newly created EC2 instance. 1. Wait 5-10min for the new EBS volume increase to finalize. 1. Allow EC2 to claim the additional space by stopping and then starting your EC2 host. +2. Set up a venv to manage dependencies: + 1. `python -m venv ~/.venv/myproject-env` to create the venv + 2. `source ~/.venv/myproject-env/bin/activate` to activate the venv + 3. `deactivate` to exit the venv ### Pull Down the Code @@ -74,8 +78,8 @@ Before sending us a pull request, please ensure that: ### Run the Unit Tests 1. Install tox using `pip install tox` -1. Install coverage using `pip install .[test]` -1. cd into the sagemaker-python-sdk folder: `cd sagemaker-python-sdk` or `cd /environment/sagemaker-python-sdk` +1. cd into the github project sagemaker-python-sdk folder: `cd sagemaker-python-sdk` or `cd /environment/sagemaker-python-sdk` +1. Install coverage using `pip install '.[test]'` 1. Run the following tox command and verify that all code checks and unit tests pass: `tox tests/unit` 1. You can also run a single test with the following command: `tox -e py310 -- -s -vv ::` 1. You can run coverage via runcvoerage env : `tox -e runcoverage -- tests/unit` or `tox -e py310 -- tests/unit --cov=sagemaker --cov-append --cov-report xml` diff --git a/src/sagemaker/model.py b/src/sagemaker/model.py index 5494bf5e22..5cc260f3ef 100644 --- a/src/sagemaker/model.py +++ b/src/sagemaker/model.py @@ -1492,6 +1492,9 @@ def deploy( } model_reference_arn (Optional [str]): Hub Content Arn of a Model Reference type content (default: None). + inference_ami_version (Optional [str]): Specifies an option from a collection of preconfigured + Amazon Machine Image (AMI) images. For a full list of options, see: + https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ProductionVariant.html Raises: ValueError: If arguments combination check failed in these circumstances: - If no role is specified or @@ -1743,6 +1746,7 @@ def deploy( model_data_download_timeout=model_data_download_timeout, container_startup_health_check_timeout=container_startup_health_check_timeout, routing_config=routing_config, + inference_ami_version=inference_ami_version, ) if endpoint_name: self.endpoint_name = endpoint_name diff --git a/tests/unit/sagemaker/model/test_deploy.py b/tests/unit/sagemaker/model/test_deploy.py index 6bfb28f684..7b99281b96 100644 --- a/tests/unit/sagemaker/model/test_deploy.py +++ b/tests/unit/sagemaker/model/test_deploy.py @@ -130,6 +130,7 @@ def test_deploy(name_from_base, prepare_container_def, production_variant, sagem model_data_download_timeout=None, container_startup_health_check_timeout=None, routing_config=None, + inference_ami_version=None, ) sagemaker_session.create_model.assert_called_with( @@ -192,6 +193,7 @@ def test_deploy_accelerator_type( model_data_download_timeout=None, container_startup_health_check_timeout=None, routing_config=None, + inference_ami_version=None, ) sagemaker_session.endpoint_from_production_variants.assert_called_with( @@ -519,6 +521,7 @@ def test_deploy_serverless_inference(production_variant, create_sagemaker_model, model_data_download_timeout=None, container_startup_health_check_timeout=None, routing_config=None, + inference_ami_version=None, ) sagemaker_session.endpoint_from_production_variants.assert_called_with( @@ -956,6 +959,7 @@ def test_deploy_customized_volume_size_and_timeout( model_data_download_timeout=model_data_download_timeout_sec, container_startup_health_check_timeout=startup_health_check_timeout_sec, routing_config=None, + inference_ami_version=None, ) sagemaker_session.create_model.assert_called_with( @@ -1006,6 +1010,7 @@ def test_deploy_with_resources(sagemaker_session, name_from_base, production_var model_data_download_timeout=None, container_startup_health_check_timeout=None, routing_config=None, + inference_ami_version=None, ) sagemaker_session.endpoint_from_production_variants.assert_called_with( name=name_from_base(MODEL_NAME),