Skip to content
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

[#32562] Incorporate Prism into the Beam Website. #32563

Merged
merged 12 commits into from
Sep 30, 2024
52 changes: 48 additions & 4 deletions website/www/site/content/en/documentation/runners/prism.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,57 @@ Prism aims to have minimal configuration required, and does not currently presen
## Running Prism Standalone

Prism can be executed as a stand alone binary and will present a basic UI for listing jobs, and job status.
lostluck marked this conversation as resolved.
Show resolved Hide resolved
This is an optional mode for Prism that is useful for demos or rapid iteration.
It is not a requirement for using Prism in the Java or Python SDKs.

It's recommended to use a released version of Prism, such as downloading one from the [Github Release](\(https://github.com/apache/beam/releases/tag/v{{< param release_latest >}})), or to build one from the latest version of the Beam Go module, using a [recent version of Go](https://go.dev/dl/).
This can be done in two ways, downloading an asset from the github release, or building the binary locally with Go installed.

In either case, Prism serves a JobManagement API endpoint, and a Webpage UI locally.
Jobs can be submitted using `--runner=PortableRunner --endpoint=<endpoint address>` and monitored using the webpage UI.

Example output from the Prism binary:

```
go run github.com/apache/beam/sdks/v2/go/cmd/prism@latest
2024/09/30 09:56:42 INFO Serving JobManagement endpoint=localhost:8073
2024/09/30 09:56:42 INFO Serving WebUI endpoint=http://localhost:8074
```

In either case, Prism serves a JobManagement API endpoint, and a Webpage UI locally.
Jobs can be submitted using `--runner=PortableRunner --endpoint=<endpoint address>` and monitored using the webpage UI.
The binary has the following optional flags:

* `--job_port` sets the port for the Job management server (defaults to 8073)
* `--web_port` sets the port for the web ui (defaults to 8074)
* `--serve_http` enables or disables the web ui (defaults to true)
* `---idle_shutdown_timeout` sets a duration that Prism will wait for a new job before automatically shutting itself down. Uses duration format like `10s`, `5m`,`2h`. Defaults to not shutting down.

### Download a release asset

This approach doesn't require other dependencies or runtimes installed.
This is recommended if you want to deploy Prism on some other machine.

Navigate to the latest [Beam Release Github page](https://github.com/apache/beam/releases/tag/v{{< param release_latest >}}), scroll to the bottom, and download the correct asset for where you want to run Prism.

For example, if you want to execute Prism on a newer MacBook, you'd download the `darwin-arm64` asset. For executing on many cloud machines, you'd download the `linux-amd64` asset.

This
requires downloading the right asset for the machine Prism will run on, such as your development
machine.
lostluck marked this conversation as resolved.
Show resolved Hide resolved

Simply unzip, and execute.

### Build from the release with Go.

This approach requires a [recent version of Go installed](https://go.dev/dl/).
This is recommended if you only want to run Prism on your local machine.

You can insall Prism with `go install`:

```sh
go install github.com/apache/beam/sdks/v2/go/cmd/prism@latest
prism
```

Or simply build and execute the binary immeadiately using `go run`:

```sh
go run github.com/apache/beam/sdks/v2/go/cmd/prism@latest
```
Loading