Skip to content

Commit

Permalink
docs(hydroflow_plus): make bash snippets copyable and link from Hydro…
Browse files Browse the repository at this point in the history
…flow landing (#1020)
  • Loading branch information
shadaj authored Jan 7, 2024
1 parent 542eeb9 commit 7e4d577
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
6 changes: 6 additions & 0 deletions docs/docs/hydroflow/quickstart/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Quickstart
This section will get you up and running with Rust and Hydroflow, and work you through a set of concrete examples illustrating much of what you need to know to get productive with Hydroflow.

:::tip

Hydroflow is the low-level IR that forms the foundation of the Hydro stack. If you're looking for a higher-level API, check out [Hydroflow+](../../hydroflow_plus/index.mdx).

:::
9 changes: 6 additions & 3 deletions docs/docs/hydroflow_plus/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ The main logic of Hydroflow+ programs manipulates **streams**, which capture inf
Hydroflow+ requires a particular workspace setup, as any crate that uses Hydroflow+ must have an supporting macro crate to drive the code generation. To get started, we recommend using the Hydroflow+ template.

```bash
$ cargo install cargo-generate
$ cargo generate hydro-project/hydroflow-plus-template
#shell-command-next-line
cargo install cargo-generate
#shell-command-next-line
cargo generate hydro-project/hydroflow-plus-template
```

Then, you can test the example dataflow:

```bash
$ cargo test
#shell-command-next-line
cargo test
```
3 changes: 2 additions & 1 deletion docs/docs/hydroflow_plus/quickstart/clusters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ async fn main() {
If we run this script, we should see the following output:

```bash
$ cargo run -p flow --example broadcast
#shell-command-next-line
cargo run -p flow --example broadcast
[worker/0] 0
[worker/1] 0
[worker/0] 1
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/hydroflow_plus/quickstart/distributed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ Most importantly, we specify a `DeployProcessSpec`, which takes a closure that c
We can then run our distributed dataflow with:

```bash
$ cargo run -p flow --example first_ten_distributed
#shell-command-next-line
cargo run -p flow --example first_ten_distributed
[service/1] 0
[service/1] 1
[service/1] 2
Expand Down
9 changes: 6 additions & 3 deletions docs/docs/hydroflow_plus/quickstart/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ In this tutorial, we'll walk through the basics of Hydroflow+ by building a simp
To get started with a new project, we'll use the Hydroflow+ template. The template comes with a pre-configured build system and an implementation of the following examples.

```bash
$ cargo install cargo-generate
$ cargo generate hydro-project/hydroflow-plus-template
#shell-command-next-line
cargo install cargo-generate
#shell-command-next-line
cargo generate hydro-project/hydroflow-plus-template
# Project Name: my-example-project
$ cd my-example-project
#shell-command-next-line
cd my-example-project
```
9 changes: 6 additions & 3 deletions docs/docs/hydroflow_plus/quickstart/structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ Hydroflow+ programs require special structure to support code generation and dis
We recommend using the Hydroflow+ template to get started with a new project. The template comes with a pre-configured build system and the following example pre-implemented.

```bash
$ cargo install cargo-generate
$ cargo generate hydro-project/hydroflow-plus-template
#shell-command-next-line
cargo install cargo-generate
#shell-command-next-line
cargo generate hydro-project/hydroflow-plus-template
```

:::
Expand Down Expand Up @@ -90,7 +92,8 @@ async fn main() {
We can now run this binary to see the output of our dataflow:

```bash
$ cargo run -p flow --bin first_ten
#shell-command-next-line
cargo run -p flow --bin first_ten
0
1
2
Expand Down

0 comments on commit 7e4d577

Please sign in to comment.