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

Palette CLI - docs #1879

Merged
merged 5 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs-content/palette-cli/commands/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ The following list contains all the supported Palette CLI subcommands. Click on

* `completion` - Generate the autocompletion script for the specified shell.


* `help` - Help with any command.

* [`docs`](docs.md) - Start the Palette documentation site in your local environment for an offline experience.

* [`ec`](ec.md) - Palette Enterprise Cluster installation & pre-validation.

Expand Down
73 changes: 73 additions & 0 deletions docs/docs-content/palette-cli/commands/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
sidebar_label: "Docs"
title: "Docs"
description: "Learn how to enable the Palette documentation site in your local environment for an offline experience."
hide_table_of_contents: false
sidebar_position: 10
tags: ["palette-cli"]
---

The `docs` command starts the Palette documentation site in your local environment for an offline experience. A [container image](https://github.com/spectrocloud/librarium/pkgs/container/librarium) with the latest documentation content is downloaded and a local [Caddy](https://caddyserver.com/) server is started to serve the documentation site. You can access the Palette documentation site at `http://localhost:8080` using your browser.

:::tip

To stop the documentation site, type `Ctrl+C` in the terminal window where you started the documentation site.
karl-cardenas-coding marked this conversation as resolved.
Show resolved Hide resolved

:::


The `docs` command exposes the following flags.

| Short Flag | Long Flag | Description | Type |
|------------|------------------------|--------------------------------------------------------------------------|---------|
| `-d` | `--detach` | Start the container in the background and print the container ID. | boolean |
| `-h` | `--help` | Help with any command. | N/A |
| | `--host` | The address of the host to expose the container on. The default value is set to `127.0.0.1` | string |
| | `--image` | The container image to use. The documentation image to use. Default value is `ghcr.io/spectrocloud/librarium:nightly`. | string |
karl-cardenas-coding marked this conversation as resolved.
Show resolved Hide resolved
| | `--name` | The name of the container. Default value is `spectrocloud-docs`. | string |
| | `--port` | The port to expose the container on. The default value is set to `8080`. | string |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we combine the Short flag and Long flag columns into 1 and just title it Flag then have the values separated by a dash? (example -d/--detach) The columns are looking a bit scrunched on my monitor and there are really only 2 short flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addetz No because then we lose consistency with the rest of the docs.

karl-cardenas-coding marked this conversation as resolved.
Show resolved Hide resolved


### Examples

Start the documentation site in the background.

```bash
palette docs --detach
```

```shell hideClipboard
{"status":"Pulling from spectrocloud/librarium","id":"nightly"}
{"status":"Digest: sha256:754a75fe5b2724ad7fdd42389432fa8f81c2362880c236dabaa29ef6963b7ac6"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should remove the digest from these outputs? I'm thinking it will change and perhaps confuse people?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's example output, that's expected.

{"status":"Status: Image is up to date for ghcr.io/spectrocloud/librarium:nightly"}
Started ghcr.io/spectrocloud/librarium:nightly at 127.0.0.1:8080
d7c8190bb73f4e96b5275fd0d7e1f27a06b784c881ec9437a233ac0a3a8ca979
```

Start the documentation site in the background and expose it on port `9000`.

```bash
palette docs --detach --port 9000
```

```shell {4} hideClipboard
{"status":"Pulling from spectrocloud/librarium","id":"nightly"}
{"status":"Digest: sha256:754a75fe5b2724ad7fdd42389432fa8f81c2362880c236dabaa29ef6963b7ac6"}
{"status":"Status: Image is up to date for ghcr.io/spectrocloud/librarium:nightly"}
Started ghcr.io/spectrocloud/librarium:nightly at 127.0.0.1:9000
cd9b79f7947b317c76d9517cc5c09ad6e12e7606c08ce24b497e07c7af6775c3
```

Start the documentation site in the background and change the container name.

```bash
palette docs --detach --name palette-offline
```

```shell hideClipboard
{"status":"Pulling from spectrocloud/librarium","id":"nightly"}
{"status":"Digest: sha256:754a75fe5b2724ad7fdd42389432fa8f81c2362880c236dabaa29ef6963b7ac6"}
{"status":"Status: Image is up to date for ghcr.io/spectrocloud/librarium:nightly"}
Started ghcr.io/spectrocloud/librarium:nightly at 127.0.0.1:8080
94928fc8b2dd9118fe66c72dd7e977f1075f85e234a131832f43537d91e27bc3
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ keywords: ["self-hosted", "vertex"]

If you are in an environment that requires the Palette Vertex documentation to be available offline, you can use our offline Docker image to serve the documentation locally. The image is updated nightly to ensure that the latest documentation is available. When you start the container, the documentation is available at `http://localhost:8080` and you can access it using your browser.


:::tip

You can use the Palette CLI to download and start the offline documentation container with a single command. Check out the Palette CLI `docs` command [page](../../../palette-cli/commands/docs.md) for more information.

:::


### Limitations

The following limitations apply when using the offline documentation:
Expand Down