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: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ terraform init
76
76
### Run Task
77
77
78
78
```
79
-
terraform apply
79
+
TF_LOG_PROVIDER=INFO terraform apply
80
80
```
81
81
82
82
This launches a `machine` in the `cloud`, uploads `workdir`, and runs the `script`. Upon completion (or error), the `machine` is terminated.
@@ -88,21 +88,21 @@ With spot/preemptible instances (`spot >= 0`), auto-recovery logic and persisten
88
88
Results and logs are periodically synced to persistent cloud storage. To query this status and view logs:
89
89
90
90
```
91
-
terraform refresh
92
-
terraform show
91
+
TF_LOG_PROVIDER=INFO terraform refresh
92
+
TF_LOG_PROVIDER=INFO terraform show
93
93
```
94
94
95
95
### Stop Tasks
96
96
97
97
```
98
-
terraform destroy
98
+
TF_LOG_PROVIDER=INFO terraform destroy
99
99
```
100
100
101
101
This terminates the `machine` (if still running), downloads `output`, and removes the persistent `disk_size` storage.
102
102
103
103
## Help
104
104
105
-
The [getting started guide](https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/getting-started) has some more information.
105
+
The [getting started guide](https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/getting-started) has some more information. In case of errors, extra debugging information is available using `TF_LOG_PROVIDER=DEBUG` instead of `INFO`.
106
106
107
107
Feature requests and bugs can be [reported via GitHub issues](https://github.com/iterative/terraform-provider-iterative/issues), while general questions and feedback are very welcome on our active [Discord server](https://discord.gg/bzA6uY7).
@@ -74,7 +77,7 @@ This command will check `main.tf` and download the required TPI plugin.
74
77
## Run Task
75
78
76
79
```console
77
-
$ terraform apply
80
+
$ TF_LOG_PROVIDER=INFO terraform apply
78
81
```
79
82
80
83
This command will:
@@ -92,7 +95,8 @@ With spot/preemptible instances (`spot >= 0`), auto-recovery logic and persisten
92
95
## Query Status
93
96
94
97
```console
95
-
$ terraform refresh && terraform show
98
+
$ TF_LOG_PROVIDER=INFO terraform refresh
99
+
$ TF_LOG_PROVIDER=INFO terraform show
96
100
```
97
101
98
102
These commands will:
@@ -103,7 +107,7 @@ These commands will:
103
107
## Stop Task
104
108
105
109
```console
106
-
$ terraform destroy
110
+
$ TF_LOG_PROVIDER=INFO terraform destroy
107
111
```
108
112
109
113
This command will:
@@ -114,3 +118,26 @@ This command will:
114
118
In this example, after running `terraform destroy`, the `results` directory should contain a file named `greeting.txt` with the text `Hello, World!`
115
119
116
120
-> **Note:** A large `output` directory may take a long time to download.
121
+
122
+
## Debugging
123
+
124
+
Use `TF_LOG_PROVIDER=DEBUG` in lieu of `INFO` to increase verbosity for debugging. See the [logging docs](https://www.terraform.io/plugin/log/managing) for a full list of options.
125
+
126
+
In case of errors within the `script` itself, both `stdout` and `stderr` are available from the [status](#query-status).
127
+
128
+
Advanced users may also want to SSH to debug failed scripts. This means preventing TPI from terminating the instance on `script` errors. For example:
-`storage.workdir` - (Optional) Local working directory to upload and use as the `script` working directory.
52
52
-`storage.output` - (Optional) Results directory (**relative to `workdir`**) to download (default: no download).
53
53
-`environment` - (Optional) Map of environment variable names and values for the task script. Empty string values are replaced with local environment values. Empty values may also be combined with a [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) name to import all matching variables.
54
-
-`timeout` - (Optional) Maximum number of seconds to run before termination.
55
-
-`name` - (Optional) Discouraged and may be removed in future. Deterministic task name (e.g. `name="Hello, World!"` always produces `id="tpi-hello-world-5kz6ldls-57wo7rsp"`).
54
+
-`timeout` - (Optional) Maximum number of seconds to run before instances are force-terminated. The countdown is reset each time TPI auto-respawns a spot instance.
55
+
-`name` - (Optional) _Discouraged and may be removed in future - change the resource name instead, i.e. `resource "iterative_task" "some_other_example_name"`._ Deterministic task name (e.g. `name="Hello, World!"` always produces `id="tpi-hello-world-5kz6ldls-57wo7rsp"`).
56
56
57
57
-> **Note:**`output` is relative to `workdir`, so `storage { workdir = "foo", output = "bar" }` means "upload `./foo/`, change working directory to the uploaded folder, run `script`, and download `bar` (i.e. `./foo/bar`)".
58
58
@@ -70,6 +70,38 @@ In addition to all arguments above, the following attributes are exported:
70
70
71
71
~> **Warning:**`events` have different formats across cloud providers and cannot be relied on for programmatic consumption/automation.
72
72
73
+
After `terraform apply`, these attributes may be obtained using `terraform console`. For example:
0 commit comments