Choosing private subnet for SageMaker model deployment

0

Below is the infra config:

  • 1 VPC with 2 private subnets
  • VPC endpoints configured only to 1 private subnet, say primary subnet (for cost optimization)
  • SageMaker domain configured with same VPC and only the primary subnet
  • All SageMaker jobs containers use the same primary subnet

Issue: SageMaker model deployment function requires 2 private subnets to be provided in the VPC config parameter. We can provide both the subnets under the VPC but want to enforce that the model deployment happens in primary subnets only. Is there a way to provide the preferred subnet id?

Will the below options work:

  • Configure CIDR for secondary subnet in such a way that no more than 1 IP is available and SageMaker can determine the same and do the model deployment in primary subnet only?
  • In the VPC config input parameter, provide the subnets id in the preferred order and SageMaker always picks the first id in the subnets list of the input parameter?

Note: Achieving HA during failover/DR is not necessary here as these model deployments are for trial purposes only.

Thanks.

1 réponse
0

It seems like SageMaker doesn't let you pick and choose exactly which subnet to use when you've got multiple ones for your deployments. While it's not ideal, SageMaker decides which subnet to deploy based on its internal logic, primarily for availability and operational efficiency.

Unfortunately, there's no straightforward way to specify a "preferred" subnet directly in the setup. People usually just provide a list of subnets, and SageMaker works out the rest. It might seem a bit limiting, especially when you're trying to control your deployment environments closely.

One thing you might think about (though it's a bit of a hack and comes with its own risks) is adjusting the available IPs in your secondary subnet. But, this approach is like walking a tightrope without a net – it's tricky and could lead to other problems.

profile picture
EXPERT
répondu il y a 2 mois
profile picture
EXPERT
vérifié il y a un mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions