Skip to content

Commit 640d82f

Browse files
committed
revamp batch
1 parent a3fb8e5 commit 640d82f

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

src/content/docs/aws/services/batch.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Batch
3-
linkTitle: Batch
43
description: Get started with Batch on LocalStack
54
tags: ["Ultimate"]
65
---
@@ -11,7 +10,7 @@ Batch is a cloud-based service provided by Amazon Web Services (AWS) that simpli
1110
Batch allows you to efficiently process large volumes of data and run batch jobs without the need to manage and provision underlying compute resources.
1211

1312
LocalStack allows you to use the Batch APIs to automate and scale computational tasks in your local environment while handling batch workloads.
14-
The supported APIs are available on our [API Coverage Page]({{< ref "coverage_batch" >}}), which provides information on the extent of Batch integration with LocalStack.
13+
The supported APIs are available on our [API Coverage Page](), which provides information on the extent of Batch integration with LocalStack.
1514

1615
## Getting started
1716

@@ -30,15 +29,15 @@ We will demonstrate how you create and run a Batch job by following these steps:
3029

3130
You can create a role using the [`CreateRole`](https://docs.aws.amazon.com/cli/latest/reference/iam/create-role.html) API.
3231
For LocalStack, the service role simply needs to exist.
33-
However, when [enforcing IAM policies]({{< ref "user-guide/aws/iam#enforcing-iam-policies" >}}), it is necessary that the policy is valid.
32+
However, when [enforcing IAM policies](/aws/services/iam/#enforcing-iam-policies), it is necessary that the policy is valid.
3433

3534
Run the following command to create a role with an empty policy document:
3635

37-
{{< command >}}
38-
$ awslocal iam create-role \
36+
```bash
37+
awslocal iam create-role \
3938
--role-name myrole \
4039
--assume-role-policy-document "{}"
41-
{{< / command >}}
40+
```
4241

4342
You should see the following output:
4443

@@ -60,12 +59,12 @@ You should see the following output:
6059
You can use the [`CreateComputeEnvironment`](https://docs.aws.amazon.com/cli/latest/reference/batch/create-compute-environment.html) API to create a compute environment.
6160
Run the following command using the role ARN above (`arn:aws:iam::000000000000:role/myrole`), to create the compute environment:
6261

63-
{{< command >}}
64-
$ awslocal batch create-compute-environment \
62+
```bash
63+
awslocal batch create-compute-environment \
6564
--compute-environment-name myenv \
6665
--type UNMANAGED \
6766
--service-role <role-arn>
68-
{{< / command >}}
67+
```
6968

7069
You should see the following output:
7170

@@ -76,19 +75,19 @@ You should see the following output:
7675
}
7776
```
7877

79-
{{< callout >}}
78+
:::note
8079
While an unmanaged compute environment has been specified, there is no need to provision any compute resources for this setup to function.
8180
Your tasks will run independently in new Docker containers, alongside the LocalStack container.
82-
{{< /callout >}}
81+
:::
8382

8483
### Create a job queue
8584

8685
You can fetch the ARN using the [`DescribeComputeEnvironments`](https://docs.aws.amazon.com/cli/latest/reference/batch/describe-compute-environments.html) API.
8786
Run the following command to fetch the ARN of the compute environment:
8887

89-
{{< command >}}
90-
$ awslocal batch describe-compute-environments --compute-environments myenv
91-
{{< / command >}}
88+
```bash
89+
awslocal batch describe-compute-environments --compute-environments myenv
90+
```
9291

9392
You should see the following output:
9493

@@ -111,13 +110,13 @@ You should see the following output:
111110
You can use the ARN to create the job queue using [`CreateJobQueue`](https://docs.aws.amazon.com/cli/latest/reference/batch/create-job-queue.html) API.
112111
Run the following command to create the job queue:
113112

114-
{{< command >}}
115-
$ awslocal batch create-job-queue \
113+
```bash
114+
awslocal batch create-job-queue \
116115
--job-queue-name myqueue \
117116
--priority 1 \
118117
--compute-environment-order order=0,computeEnvironment=arn:aws:batch:us-east-1:000000000000:compute-environment/myenv \
119118
--state ENABLED
120-
{{< / command >}}
119+
```
121120

122121
You should see the following output:
123122

@@ -136,12 +135,12 @@ It's important to note that you can override this command when submitting the jo
136135

137136
Run the following command to create the job definition using the [`RegisterJobDefinition`](https://docs.aws.amazon.com/cli/latest/reference/batch/register-job-definition.html) API:
138137

139-
{{< command >}}
140-
$ awslocal batch register-job-definition \
138+
```bash
139+
awslocal batch register-job-definition \
141140
--job-definition-name myjobdefn \
142141
--type container \
143142
--container-properties '{"image":"busybox","vcpus":1,"memory":128,"command":["sleep","30"]}'
144-
{{< / command >}}
143+
```
145144

146145
You should see the following output:
147146

@@ -156,13 +155,13 @@ You should see the following output:
156155
If you want to pass arguments to the command as [parameters](https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html#parameters), you can use the `Ref::` declaration to set placeholders for parameter substitution.
157156
This allows the dynamic passing of values at runtime for specific job definitions.
158157

159-
{{< command >}}
160-
$ awslocal batch register-job-definition \
158+
```bash
159+
awslocal batch register-job-definition \
161160
--job-definition-name myjobdefn \
162161
--type container \
163162
--parameters '{"time":"10"}' \
164163
--container-properties '{"image":"busybox","vcpus":1,"memory":128,"command":["sleep","Ref::time"]}'
165-
{{< / command >}}
164+
```
166165

167166
### Submit a job to the job queue
168167

@@ -172,13 +171,13 @@ This command simulates work being done in the container.
172171

173172
Run the following command to submit a job to the job queue using the [`SubmitJob`](https://docs.aws.amazon.com/cli/latest/reference/batch/submit-job.html) API:
174173

175-
{{< command >}}
176-
$ awslocal batch submit-job \
174+
```bash
175+
awslocal batch submit-job \
177176
--job-name myjob \
178177
--job-queue myqueue \
179178
--job-definition myjobdefn \
180179
--container-overrides '{"command":["sh", "-c", "sleep 5; pwd"]}'
181-
{{< / command >}}
180+
```
182181

183182
You should see the following output:
184183

0 commit comments

Comments
 (0)