You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/aws/services/batch.md
+25-26Lines changed: 25 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
---
2
2
title: Batch
3
-
linkTitle: Batch
4
3
description: Get started with Batch on LocalStack
5
4
tags: ["Ultimate"]
6
5
---
@@ -11,7 +10,7 @@ Batch is a cloud-based service provided by Amazon Web Services (AWS) that simpli
11
10
Batch allows you to efficiently process large volumes of data and run batch jobs without the need to manage and provision underlying compute resources.
12
11
13
12
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.
15
14
16
15
## Getting started
17
16
@@ -30,15 +29,15 @@ We will demonstrate how you create and run a Batch job by following these steps:
30
29
31
30
You can create a role using the [`CreateRole`](https://docs.aws.amazon.com/cli/latest/reference/iam/create-role.html) API.
32
31
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.
34
33
35
34
Run the following command to create a role with an empty policy document:
36
35
37
-
{{< command >}}
38
-
$ awslocal iam create-role \
36
+
```bash
37
+
awslocal iam create-role \
39
38
--role-name myrole \
40
39
--assume-role-policy-document "{}"
41
-
{{< / command >}}
40
+
```
42
41
43
42
You should see the following output:
44
43
@@ -60,12 +59,12 @@ You should see the following output:
60
59
You can use the [`CreateComputeEnvironment`](https://docs.aws.amazon.com/cli/latest/reference/batch/create-compute-environment.html) API to create a compute environment.
61
60
Run the following command using the role ARN above (`arn:aws:iam::000000000000:role/myrole`), to create the compute environment:
62
61
63
-
{{< command >}}
64
-
$ awslocal batch create-compute-environment \
62
+
```bash
63
+
awslocal batch create-compute-environment \
65
64
--compute-environment-name myenv \
66
65
--type UNMANAGED \
67
66
--service-role <role-arn>
68
-
{{< / command >}}
67
+
```
69
68
70
69
You should see the following output:
71
70
@@ -76,19 +75,19 @@ You should see the following output:
76
75
}
77
76
```
78
77
79
-
{{< callout >}}
78
+
:::note
80
79
While an unmanaged compute environment has been specified, there is no need to provision any compute resources for this setup to function.
81
80
Your tasks will run independently in new Docker containers, alongside the LocalStack container.
82
-
{{< /callout >}}
81
+
:::
83
82
84
83
### Create a job queue
85
84
86
85
You can fetch the ARN using the [`DescribeComputeEnvironments`](https://docs.aws.amazon.com/cli/latest/reference/batch/describe-compute-environments.html) API.
87
86
Run the following command to fetch the ARN of the compute environment:
@@ -111,13 +110,13 @@ You should see the following output:
111
110
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.
112
111
Run the following command to create the job queue:
@@ -136,12 +135,12 @@ It's important to note that you can override this command when submitting the jo
136
135
137
136
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:
@@ -156,13 +155,13 @@ You should see the following output:
156
155
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.
157
156
This allows the dynamic passing of values at runtime for specific job definitions.
@@ -172,13 +171,13 @@ This command simulates work being done in the container.
172
171
173
172
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:
0 commit comments