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

Added missing options in CLI guide #195

Merged
merged 6 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions doc/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sphinx:
navigation_with_keys: true
html_static_path:
- static/opengraph
myst_heading_anchors: 2
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this doing? why do we need it? please add a comment so we know why we added it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Without this configuration referencing header sections in other other files doesn't work


extra_extensions:
- notfound.extension
Expand Down
4 changes: 2 additions & 2 deletions doc/features/serverless-fns.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Serveless functions
# Serverless functions

```{important}
`@functions.serverless` supports Python 3.9, 3.10, and 3.11
Expand Down Expand Up @@ -109,7 +109,7 @@ subsequent executions will use the cache.
### Data types

If your function returns a data type that requires a third-party package (for example,
a numpy array), then, the environment that receives the resuslts must also have the
a numpy array), then, the environment that receives the results must also have the
same package and version of such package:

```python
Expand Down
87 changes: 87 additions & 0 deletions doc/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export PLOOMBER_CLOUD_KEY=YOURKEY
```

```{tip}

`pc` is a shortcut for `ploomber-cloud`. Example: `pc key`
```

Expand Down Expand Up @@ -73,6 +74,55 @@ Then, execute:
ploomber-cloud deploy
```

## Force initialize an app

You might want to re-initialize your project in case the `ploomber-cloud.json` file has got corrupted or doesn't contain the valid keys.

Then run the `init` command with the `--force` flag:

```sh
ploomber-cloud init --force
```

This will replace the existing `ploomber-cloud.json` with a new one, with a different `id` field.

It can also be combined with the `--from-existing` for re-initializing from an existing project:

```sh
ploomber-cloud init --from-existing --force
```

## Delete an app

For deleting a particular app run the `delete` command with the `--project-id` flag:

```sh
ploomber-cloud delete --project-id <project-id>
```

You can also delete a project without passing the ID by running the delete command from within the initialized project folder:

```sh
ploomber-cloud delete
```

To delete all apps:

```sh
ploomber-cloud delete --all
```

It should display a confirmation message:

```
Are you sure you want to delete all projects?
This action is irreversible and cannot be undone.
Pressing forward with this will result in a loss of all project data and configurations.
If you're unsure or wish to reconsider, please cancel immediately by pressing Ctrl + C. [y/N]:
```

Confirm with `y` to delete all projects in your account.

## Deploying an example

Ploomber Cloud hosts example applications for many different frameworks. To download and deploy one, run `ploomber-cloud examples`:
Expand Down Expand Up @@ -100,6 +150,43 @@ ploomber-cloud examples flask/basic-app

A full list of example applications is available [here](https://github.com/bryannho/doc/tree/main/examples)


## Monitor a deployment

An application deployment can be monitored by using the `watch` command by passing a `project_id` and an optional `job_id`:

```sh
ploomber-cloud watch --project-id <project-id> --job-id <job-id>
```

You should be able to find the parameters from the deployment message. Here's an example:

```
The deployment process started! Track its status at: https://www.platform.ploomber.io/applications/muddy-art-3373/8d1067be
```

Here, `project-id` is `muddy-art-3373` and `job-id` is `8d1067be`.

## Configure an application using a template

You can configure an application using a pre-defined template by running the command `ploomber-cloud templates <template-name>`.
Note that currently only the template `vllm` is supported.
This command should be run in an empty folder. [Click here](../apps/vllm.md) to learn more about deploying vLLM.

## Configure GitHub action

If your project is hosted on GitHub, you can configure an action for triggering project deployment everytime code changes are pushed.

For configuring a GitHub action through CLI run the command:

```sh
ploomber-cloud github
```

On confirming with `y` the CLI will create a `ploomber-cloud.yaml` file in the path `.github/workflows`.
[Click here](../user-guide/github.md#configure-action-through-cli) to learn more about configuring a GitHub action.


## Defining secrets

If your project uses secrets, you can define them in an `.env` file.
Expand Down
2 changes: 1 addition & 1 deletion doc/user-guide/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To deploy a GPU, first, [create an account](https://platform.ploomber.io/registe

![](../static/docker.png)

In the `Source code` section, drop a `.zip` file with your code. Or use oen of the examples (download them and zip them):
In the `Source code` section, drop a `.zip` file with your code. Or use one of the examples (download them and zip them):

::::{grid} 2 2 3 3
:class-container: text-center
Expand Down
2 changes: 1 addition & 1 deletion doc/user-guide/secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To add more, click on the button below:


```{tip}
You can also define secrets using the [command-line interface.](./cli.md)
You can also define secrets using the [command-line interface.](./cli.md#defining-secrets)
```

## Reading secrets
Expand Down