-
Notifications
You must be signed in to change notification settings - Fork 28
docs: iteration 3 #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
docs: iteration 3 #492
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
af6445f
more info on cloud account creation
casperdcl 01cc68b
update USPs
casperdcl b5cefe6
update example scripts
casperdcl 91e57c4
low-level diagram
casperdcl 739ffea
bi-directional cache
casperdcl 1df2ec1
minor shading
casperdcl eb8e209
udpate diagram styles
casperdcl 215d1c1
fix cross-refs
casperdcl 5db25b0
fix epochs
casperdcl ad941c4
readme: how it works
casperdcl 1e2434c
Apply suggestions from code review
casperdcl 64c45ec
split features & USPs
casperdcl 4aeffa8
fix example
casperdcl 2a30b67
add high-level diagram
casperdcl ad2c377
minify list
casperdcl 0468e53
update diagrams
casperdcl bba3c83
more work on features/USPs
casperdcl 9dc7c5b
explicit epochs
casperdcl 6a6f94a
copyediting
casperdcl 3917887
table providers
casperdcl 81551d5
sync docs
casperdcl 041e34b
fix light/dark
casperdcl 1ff0ba1
auth: GCP env vars
casperdcl 1bb47a3
POSIX compliance
casperdcl 1ad01a9
better badge links
casperdcl 1887610
Restyled by prettier-markdown
restyled-commits d2edbc9
colonic problems
casperdcl 54ab9d1
@jurv11 copyedits
casperdcl a1f1c8c
logging typo (#512)
dacbd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,19 +8,21 @@ | |
|
||
TPI is a [Terraform](https://terraform.io) plugin built with machine learning in mind. Full lifecycle management of computing resources (including GPUs and respawning spot instances) from several cloud vendors (AWS, Azure, GCP, K8s)... without needing to be a cloud expert. | ||
|
||
- **Provision Resources**: create cloud compute (CPU, GPU, RAM) & storage resources without reading pages of documentation | ||
- **Sync & Execute**: easily sync & run local data & code in the cloud | ||
- **Easy to use**: create cloud compute (CPU, GPU, RAM) & storage resources without reading pages of documentation | ||
- **Low cost**: transparent auto-recovery from interrupted low-cost spot/preemptible instances | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **No cloud vendor lock-in**: switch between several cloud vendors with ease due to concise unified configuration | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **Seamless developer experience**: easily sync & run data & code in the cloud as easily as on a local laptop | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **No waste**: auto-cleanup unused resources (terminate compute instances upon job completion/failure & remove storage upon download of results) | ||
- **No lock-in**: switch between several cloud vendors with ease due to concise unified configuration | ||
|
||
Supported cloud vendors include: | ||
Supported cloud vendors [include][auth]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💅🏼 I'd link the other 3 words instead. |
||
|
||
- Amazon Web Services (AWS) | ||
- Microsoft Azure | ||
- Google Cloud Platform (GCP) | ||
- Kubernetes (K8s) | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[auth]: https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/authentication | ||
|
||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Usage | ||
|
||
### Requirements | ||
|
@@ -36,7 +38,7 @@ Supported cloud vendors include: | |
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | ||
sudo apt-get update && sudo apt-get install terraform | ||
``` | ||
- Create an account with any supported cloud vendor and expose its [authentication credentials via environment variables](https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/authentication) | ||
- Create an account with any supported cloud vendor and expose its [authentication credentials via environment variables][auth] | ||
|
||
### Define a Task | ||
|
||
|
@@ -59,8 +61,17 @@ resource "iterative_task" "example" { | |
} | ||
script = <<-END | ||
#!/bin/bash | ||
mkdir results | ||
echo "Hello World!" > results/greeting.txt | ||
|
||
# create output directory if needed | ||
mkdir -p results | ||
# read last result (in case of spot/preemptible instance recovery) | ||
if [[ -f results/epoch.txt ]]; then EPOCH="$(cat results/epoch.txt)"; fi | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# (re)start training loop up to 42 epochs | ||
for epoch in $(seq ${EPOCH:-1} 10); do | ||
sleep 1 | ||
echo "$epoch" > results/epoch.txt | ||
done | ||
END | ||
} | ||
``` | ||
|
@@ -119,6 +130,38 @@ Instead of using the latest stable release, a local copy of the repository must | |
``` | ||
3. Use `source = "github.com/iterative/iterative"` in your `main.tf` to use the local repository (`source = "iterative/iterative"` will download the latest release instead), and run `terraform init --upgrade` | ||
|
||
This diagram may also help to see what TPI does under-the-hood: | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```mermaid | ||
flowchart LR | ||
subgraph tpi [what TPI manages] | ||
direction LR | ||
subgraph you [what you manage] | ||
direction LR | ||
A([Personal Computer]) | ||
end | ||
B[("Cloud Storage (low cost)")] | ||
C{{"Cloud Orchestrator (zero cost)"}} | ||
D[["Cloud (spot) Instance"]] | ||
A ---> |create cloud storage| B | ||
A --> |create cloud orchestrator| C | ||
A ==> |upload script & workdir| B | ||
A -.-> |"offline (lunch break)"| A | ||
C -.-> |"(re)provision instance"| D | ||
D ==> |run script| D | ||
B <-.-> |persistent workdir cache| D | ||
D ==> |script end,\nshutdown instance| B | ||
D -.-> |outage| C | ||
B ==> |download output| A | ||
end | ||
style you fill:#FFFFFF00,stroke:#13ADC7 | ||
style tpi fill:#FFFFFF00,stroke:#FFFFFF00,stroke-width:0px | ||
style A fill:#13ADC7,stroke:#333333,color:#000000 | ||
style B fill:#945DD5,stroke:#333333,color:#000000 | ||
style D fill:#F46737,stroke:#333333,color:#000000 | ||
style C fill:#7B61FF,stroke:#333333,color:#000000 | ||
``` | ||
|
||
## Copyright | ||
|
||
This project and all contributions to it are distributed under [![Apache-2.0][licence-badge]][licence-file] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.