add cli doc

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
Hannah Hunter 2024-06-04 13:49:04 -04:00
parent 9c07cfdc88
commit a371daed98
2 changed files with 83 additions and 1 deletions

View File

@ -21,6 +21,7 @@ Dapr initialization includes:
1. Running a **Zipkin container instance** for observability. 1. Running a **Zipkin container instance** for observability.
1. Creating a **default components folder** with component definitions for the above. 1. Creating a **default components folder** with component definitions for the above.
1. Running a **Dapr placement service container instance** for local actor support. 1. Running a **Dapr placement service container instance** for local actor support.
1. Running a **Dapr scheduler service container instance** for job orchestration.
{{% alert title="Kubernetes Development Environment" color="primary" %}} {{% alert title="Kubernetes Development Environment" color="primary" %}}
To initialize Dapr in your local or remote **Kubernetes** cluster for development (including the Redis and Zipkin containers listed above), see [how to initialize Dapr for development on Kubernetes]({{<ref "kubernetes-deploy.md#install-dapr-from-the-official-dapr-helm-chart-with-development-flag">}}) To initialize Dapr in your local or remote **Kubernetes** cluster for development (including the Redis and Zipkin containers listed above), see [how to initialize Dapr for development on Kubernetes]({{<ref "kubernetes-deploy.md#install-dapr-from-the-official-dapr-helm-chart-with-development-flag">}})
@ -68,7 +69,13 @@ Install the latest Dapr runtime binaries:
dapr init dapr init
``` ```
**If you are installing on Mac OS Silicon with Docker,** you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes. If you run your Docker cmds with sudo, you need to use:
```bash
sudo dapr init
```
If you are installing on **Mac OS Silicon** with Docker, you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes.
1. Navigate to **Docker Desktop** > **Settings** > **Advanced**. 1. Navigate to **Docker Desktop** > **Settings** > **Advanced**.
1. Select the **Allow the default Docker socket to be used (requires password)** checkbox. 1. Select the **Allow the default Docker socket to be used (requires password)** checkbox.
@ -86,8 +93,30 @@ dapr init
{{< /tabs >}} {{< /tabs >}}
**Expected output:**
```
⌛ Making the jump to hyperspace...
✅ Downloaded binaries and completed components set up.
daprd binary has been installed to $HOME/.dapr/bin.
dapr_placement container is running.
dapr_scheduler container is running.
dapr_redis container is running.
dapr_zipkin container is running.
Use `docker ps` to check running containers.
✅ Success! Dapr is up and running. To get started, go here: https://aka.ms/dapr-getting-started
```
[See the troubleshooting guide if you encounter any error messages regarding Docker not being installed or running.]({{< ref "common_issues.md#dapr-cant-connect-to-docker-when-installing-the-dapr-cli" >}}) [See the troubleshooting guide if you encounter any error messages regarding Docker not being installed or running.]({{< ref "common_issues.md#dapr-cant-connect-to-docker-when-installing-the-dapr-cli" >}})
#### Slim init
To install the CLI without any default configuration files or Docker containers, use the `--slim` flag. [Learn more about the `init` command and its flags.]({{< ref dapr-init.md >}})
```bash
dapr init --slim
```
### Step 3: Verify Dapr version ### Step 3: Verify Dapr version
```bash ```bash

View File

@ -0,0 +1,53 @@
---
type: docs
title: "job CLI command reference"
linkTitle: "job"
description: "Detailed information on the job CLI command"
---
### Description
Schedule jobs on a given Dapr application.
### Supported platforms
- [Self-Hosted]({{< ref self-hosted >}})
- [Kubernetes]({{< ref kubernetes >}})
### Usage
```bash
dapr job [command] [flags]
```
### Commands
| Name | Description |
| ------------------- | ----------------------------------------------------- |
| `schedule` | Schedule job in your application |
| `get` | Get scheduled job |
| `delete` | Delete the scheduled job |
### Flags
| Name | Environment Variable | Default | Description |
| ------------------- | -------------------- | ------- | ----------------------------------------------------- |
| `--app-id`, `-i` | `APP_ID` | | The application id on which to schedule jobs |
| `--name`, `-n` | | | Name of the job |
| `--schedule`, `-s` | | | Interval schedule for the job |
| `--data`, `-d` | | | The JSON serialized data string (optional) |
| `--repeats`, `-r` | | | If the job is scheduled as recurring and how often it repeats (optional) |
### Examples
```bash
# Schedule a job on an hourly interval that repeats once
dapr job schedule --name myjob --app-id myapp --schedule "@hourly" --data '{"key":"value"}' --repeats 1
# Get information on the scheduled job
dapr job get --name myjob --app-id myapp
# Delete job
dapr job delete --name myjob --app-id myapp
```