Skip to content

Commit 0d041ff

Browse files
casperdclrestyled-io[bot]0x2b3bfa0
authored
copyediting (#292)
* tabulate generic images - part of #267 & #158 * misc copyediting * Restyle copyediting (#293) * more consistency particularly line wrapping * minor table note * docs: terraform fmt * Apply suggestions from code review Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Helio Machado <0x2b3bfa0+git@googlemail.com>
1 parent e932f7b commit 0d041ff

File tree

3 files changed

+39
-56
lines changed

3 files changed

+39
-56
lines changed

docs/guides/getting-started.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Begin by [installing Terraform 1.0 or greater](https://learn.hashicorp.com/tutor
1010

1111
In the project root directory:
1212

13-
1. Create a directory named `shared` to store input data and output artifacts.
13+
1. Create a directory named `shared` to store input data and output artefacts.
1414
2. Create a file named `main.tf` with the following contents:
1515

1616
```hcl
1717
terraform {
1818
required_providers {
1919
iterative = {
20-
source = "iterative/iterative"
20+
source = "iterative/iterative"
2121
}
2222
}
2323
}
@@ -29,23 +29,22 @@ resource "iterative_task" "example" {
2929
cloud = "aws" # or any of: gcp, az, k8s
3030
3131
directory = "${path.root}/shared"
32-
33-
script = <<-END
32+
script = <<-END
3433
#!/bin/bash
3534
echo "Hello World!" > greeting.txt
3635
END
3736
}
3837
```
3938

40-
-> **Note:** The `script` argument can take anny string, including a [heredoc](https://www.terraform.io/docs/language/expressions/strings.html#heredoc-strings) or the contents of a file returned by the [`file`](https://www.terraform.io/docs/language/functions/file.html) function.
39+
-> **Note:** The `script` argument can take any string, including a [heredoc](https://www.terraform.io/docs/language/expressions/strings.html#heredoc-strings) or the contents of a file returned by the [`file`](https://www.terraform.io/docs/language/functions/file.html) function.
4140

4241
The project layout should look similar to this:
4342

4443
```
4544
project/
46-
├─ shared/
47-
│ └─ ···
48-
└─ main.tf
45+
├── main.tf
46+
└── shared/
47+
└── ...
4948
```
5049

5150
## Initializing Terraform
@@ -91,14 +90,14 @@ This command will:
9190
## Deleting Tasks
9291

9392
```console
94-
terraform destroy
93+
$ terraform destroy
9594
```
9695

9796
This command will:
9897

9998
1. Download the specified shared `directory` from the cloud.
100-
2. Delete all the created cloud resources.
99+
2. Delete all the cloud resources created by `terraform apply`.
101100

102101
## Viewing Task Results
103102

104-
After running `terraform destroy`, the `shared/` directory should contain a file named `greeting.txt` with the text `Hello, World!`
103+
After running `terraform destroy`, the `shared` directory should contain a file named `greeting.txt` with the text `Hello, World!`

docs/index.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Iterative Provider
22

3-
Use the Iterative Provider to launch resource-intensive tasks in popular cloud
4-
providers with a single Terraform file.
3+
Use the Iterative Provider to launch resource-intensive tasks in popular cloud providers with a single Terraform file.
54

65
## Example Usage
76

87
```hcl
98
terraform {
109
required_providers {
1110
iterative = {
12-
source = "iterative/iterative"
11+
source = "iterative/iterative"
1312
}
1413
}
1514
}
@@ -27,12 +26,11 @@ resource "iterative_task" "task" {
2726
}
2827
```
2928

30-
-> **Note:** See the [Getting Started](https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/getting-started) for more information.
29+
-> **Note:** See [Getting Started](https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/getting-started) for more information.
3130

3231
## Authentication
3332

34-
[Environment variables](https://registry.terraform.io/providers/iterative/iterative/latest/docs#authentication) are the only supported authentication method. They should
35-
be present when running any of the `terraform` commands.
33+
Environment variables are the only supported authentication method. They should be present when running any of the `terraform` commands.
3634

3735
### Example
3836

@@ -51,8 +49,7 @@ $ terraform apply
5149

5250
- `GOOGLE_APPLICATION_CREDENTIALS` - Path to a service account JSON key file.
5351

54-
-> **Note:** you can also use `GOOGLE_APPLICATION_CREDENTIALS_DATA` with the
55-
**contents** of the service account JSON key file.
52+
-> **Note:** you can also use `GOOGLE_APPLICATION_CREDENTIALS_DATA` with the **contents** of the service account JSON key file.
5653

5754
### Microsoft Azure
5855

docs/resources/task.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This resource will:
44

5-
1. Create cloud resources (storage, machines) for the task
6-
2. Upload the given `directory` to the cloud storage, if specified
7-
3. Run the given `script` upon completion or `timeout` in the cloud
5+
1. Create cloud resources (machines and storage) for the task.
6+
2. Upload the given `directory` to the cloud storage, if specified.
7+
3. Run the given `script` until completion or `timeout` in the cloud machine.
88

99
## Example Usage
1010

@@ -13,10 +13,9 @@ resource "iterative_task" "task" {
1313
name = "example"
1414
cloud = "aws"
1515
16-
environment = {GREETING = "Hello, world!"}
16+
environment = { GREETING = "Hello, world!" }
1717
directory = "${path.root}/shared"
18-
19-
script = <<-END
18+
script = <<-END
2019
#!/bin/bash
2120
echo "$GREETING" | tee $(uuidgen)
2221
END
@@ -60,31 +59,23 @@ In addition to all arguments above, the following attributes are exported:
6059

6160
### Generic
6261

63-
The Iterative Provider offers some common machine types which are roughly the same
64-
for all supported clouds.
65-
66-
#### No GPU
67-
68-
- `m` - Medium, with (at least), 8 CPU cores and 16 GB of RAM.
69-
- `l` - Large, with (at least) 32 CPU cores and 64 GB of RAM.
70-
- `xl` - Extra large, with (at least) 64 CPU cores and 128 GB of RAM.
71-
72-
#### NVIDIA Tesla K80 GPU
73-
74-
- `m+k80` - Medium, with (at least) 4 CPU cores, 53 GB of RAM and 1 GPU device.
75-
- `l+k80` - Large, with (at least) 12 CPU cores, 112 GB of RAM and 2 GPU devices.
76-
- `xl+k80` - Extra large, with (at least) 24 CPU cores, 212 GB of RAM and 4 GPU devices.
77-
78-
#### NVIDIA Tesla V100 GPU
62+
The Iterative Provider offers some common machine types (medium, large, and extra large) which are roughly the same for all supported clouds.
7963

80-
- `m+v100` - Medium, with (at least) 4 CPU cores, 61 GB of RAM and 1 GPU device.
81-
- `l+v100` - Large, with (at least) 12 CPU cores, 224 GB of RAM and 2 GPU devices.
82-
- `xl+v100` - Extra large, with (at least) 24 CPU cores, 448 GB of RAM and 4 GPU devices.
64+
| Type | Minimum CPU cores | Minimum RAM | GPU |
65+
| :-------- | ----------------: | ----------: | :------------------ |
66+
| `m` | 8 | 16 GB | - |
67+
| `l` | 32 | 64 GB | - |
68+
| `xl` | 64 | 128 GB | - |
69+
| `m+k80` | 4 | 53 GB | 1 NVIDIA Tesla K80 |
70+
| `l+k80` | 12 | 112 GB | 2 NVIDIA Tesla K80 |
71+
| `xl+k80` | 24 | 212 GB | 4 NVIDIA Tesla K80 |
72+
| `m+v100` | 4 | 61 GB | 1 NVIDIA Tesla V100 |
73+
| `l+v100` | 12 | 224 GB | 2 NVIDIA Tesla V100 |
74+
| `xl+v100` | 24 | 448 GB | 4 NVIDIA Tesla V100 |
8375

8476
### Cloud-specific
8577

86-
In addition to generic types, it's possible to specify any machine type
87-
supported by the underlying cloud provider.
78+
In addition to generic types, it's possible to specify any machine type supported by the underlying cloud provider.
8879

8980
#### Amazon Web Services
9081

@@ -112,15 +103,13 @@ supported by the underlying cloud provider.
112103

113104
### Generic
114105

115-
The Iterative Provider offers some common machine images which are roughly the same
116-
for all supported clouds.
106+
The Iterative Provider offers some common machine images which are roughly the same for all supported clouds.
117107

118-
- `ubuntu` - Official Ubuntu LTS image, currently 20.04.
108+
- `ubuntu` - Official [Ubuntu LTS](https://wiki.ubuntu.com/LTS) image (currently 20.04).
119109

120110
### Cloud-specific
121111

122-
In addition to generic images, it's possible to specify any machine image
123-
supported by the underlying cloud provider.
112+
In addition to generic images, it's possible to specify any machine image supported by the underlying cloud provider.
124113

125114
#### Amazon Web Services
126115

@@ -169,8 +158,7 @@ See https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findima
169158

170159
### Generic
171160

172-
The Iterative Provider offers some common cloud regions which are roughly the same
173-
for all supported clouds.
161+
The Iterative Provider offers some common cloud regions which are roughly the same for all supported clouds.
174162

175163
- `us-east` - United States of America, East.
176164
- `us-west` - United States of America, West.
@@ -179,8 +167,7 @@ for all supported clouds.
179167

180168
### Cloud-specific
181169

182-
In addition to generic regions, it's possible to specify any cloud region
183-
supported by the underlying cloud provider.
170+
In addition to generic regions, it's possible to specify any cloud region supported by the underlying cloud provider.
184171

185172
#### Amazon Web Services
186173

@@ -210,6 +197,6 @@ Setting the `region` attribute results in undefined behaviour.
210197

211198
Unlike public cloud providers, Kubernetes does not offer any portable way of persisting and sharing storage between pods. When specified, the `directory` attribute will create a `PersistentVolumeClaim` of the default `StorageClass`, with the same lifecycle as the task and the specified `disk_size`.
212199

213-
~> **Warning:** Access mode will be `ReadWriteOnce` for `parallelism` equal to 1 or `ReadWriteMany` otherwise.
200+
~> **Warning:** Access mode will be `ReadWriteOnce` if `parallelism=1` or `ReadWriteMany` otherwise.
214201

215202
-> **Note:** Rancher's [Local Path Provisioner](https://github.com/rancher/local-path-provisioner) might be the easiest way of deploying a quick `ReadWriteOnce` dynamically allocated storage solution for testing: just run `kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml`.

0 commit comments

Comments
 (0)