Skip to content

fix: enable isolation while creating model from job #2553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/sagemaker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2625,6 +2625,7 @@ def create_model_from_job(
image_uri=None,
model_data_url=None,
env=None,
enable_network_isolation=False,
vpc_config_override=vpc_utils.VPC_CONFIG_DEFAULT,
tags=None,
):
Expand All @@ -2642,6 +2643,7 @@ def create_model_from_job(
model_data_url (str): S3 location of the model data (default: None). If None, defaults
to the ``ModelS3Artifacts`` of ``training_job_name``.
env (dict[string,string]): Model environment variables (default: {}).
enable_network_isolation (bool): Whether the model requires network isolation or not.
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the
model.
Default: use VpcConfig from training job.
Expand All @@ -2665,7 +2667,14 @@ def create_model_from_job(
env=env,
)
vpc_config = _vpc_config_from_training_job(training_job, vpc_config_override)
return self.create_model(name, role, primary_container, vpc_config=vpc_config, tags=tags)
return self.create_model(
name,
role,
primary_container,
enable_network_isolation=enable_network_isolation,
vpc_config=vpc_config,
tags=tags,
)

def create_model_package_from_algorithm(self, name, description, algorithm_arn, model_data):
"""Create a SageMaker Model Package from the results of training with an Algorithm Package.
Expand Down