Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Create a service environment in
Amazon Batch
Before you can run SageMaker Training jobs in Amazon Batch, you need to create a service
environment. You can create a service environment that contains the configuration parameters
required for Amazon Batch to integrate with SageMaker AI services and submit SageMaker Training jobs on your
behalf.
Prerequisites
Before creating a service environment, ensure you have:
- Create a service environment (Amazon Console)
-
Use the Amazon Batch console to create a service environment through the web
interface.
To create a service environment
-
Open the Amazon Batch console at https://console.aws.amazon.com/batch/.
-
In the navigation pane, choose Environments.
-
Choose Create environment, select
Service environment.
-
For Service environment configuration
choose SageMaker AI.
-
For Name, enter a unique name for
your service environment. Valid characters are a-z, A-Z, 0-9, hyphens
(-), and underscores (_).
-
For Max number of instances enter the
maximum number of concurrent training instances
-
(Optional) Add tags by choosing Add
tag and entering key-value pairs.
-
Choose Next.
-
Review the details of the new service environment and choose Create service environment.
- Create a service environment (Amazon CLI)
-
Use the create-service-environment
command to create a service
environment with the Amazon CLI.
To create a service environment
-
Create a service environment with the basic required
parameters:
aws batch create-service-environment \
--service-environment-name my-sagemaker-service-env \
--service-environment-type SAGEMAKER_TRAINING \
--capacity-limits capacityUnit=NUM_INSTANCES,maxCapacity=10
-
(Optional) Create a service environment with tags:
aws batch create-service-environment \
--service-environment-name my-sagemaker-service-env \
--service-environment-type SAGEMAKER_TRAINING \
--capacity-limits capacityUnit=NUM_INSTANCES,maxCapacity=10 \
--tags team=data-science,project=ml-training
-
Verify the service environment was created successfully:
aws batch describe-service-environments \
--service-environment my-sagemaker-service-env
The service environment appears in the Environments list with a
CREATING
state. When creation completes successfully, the state
changes to VALID
and the service environment is ready to have a
service job queue added to it so the service environment can start processing
jobs.