Skip to content

Commit

Permalink
Merge branch 'v1.13' into issue_3868
Browse files Browse the repository at this point in the history
Signed-off-by: Hannah Hunter <[email protected]>
  • Loading branch information
hhunter-ms authored Feb 1, 2024
2 parents 9218028 + 59ed30e commit 6f67dc9
Show file tree
Hide file tree
Showing 29 changed files with 586 additions and 46 deletions.
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/go:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/hugo:1": {
"extended": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts",
"nvmVersion": "latest"
}
},
"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
"davidanson.vscode-markdownlint",
"budparr.language-hugo-vscode"
],
"settings": {
"git.alwaysSignOff": true
}
}
},
"forwardPorts": [1313],
"postAttachCommand": "bash scripts/init-container.sh"
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
52 changes: 37 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,44 @@ The Dapr docs are built using [Hugo](https://gohugo.io/) with the [Docsy](https:

The [daprdocs](./daprdocs) directory contains the hugo project, markdown files, and theme configurations.

## Pre-requisites
## Setup with a devcontainer

- [Hugo extended version](https://gohugo.io/getting-started/installing)
- [Node.js](https://nodejs.org/en/)
This repository comes with a [devcontainer](/.devcontainer/devcontainer.json) configuration that automatically installs all the required dependencies and VSCode extensions to build and run the docs.

This devcontainer can be used to develop locally with VSCode or via GitHub Codespaces completely in the browser. Other IDEs that support [devcontainers](https://containers.dev/) can be used but won't have the extensions preconfigured and will likely have different performance characteristics.

### Pre-requisites

## Environment setup
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
- [VSCode](https://code.visualstudio.com/download)

1. Ensure pre-requisites are installed
2. Clone this repository
### Environment setup

1. [Fork](https://github.com/dapr/docs/fork) and clone this repository.

1. Open the forked repository in VS Code

```sh
git clone https://github.com/dapr/docs.git
code .
```

3. Change to daprdocs directory:
1. When prompted, click "Reopen in Container" to open the repository in the devcontainer.

Continue with the [Run local server](#run-local-server) steps.

## Setup without a devcontainer

### Pre-requisites

- [Hugo extended version](https://gohugo.io/getting-started/installing)
- [Node.js](https://nodejs.org/en/)

### Environment setup

1. Ensure pre-requisites are installed.
1. [Fork](https://github.com/dapr/docs/fork) and clone this repository.

1. Change to daprdocs directory:

```sh
cd ./daprdocs
Expand All @@ -63,7 +86,7 @@ npm install

## Run local server

1. Make sure you're still in the `daprdocs` directory
1. Make sure you're in the `daprdocs` directory
2. Run

```sh
Expand All @@ -72,14 +95,13 @@ hugo server

3. Navigate to `http://localhost:1313/`


## Update docs

1. Fork repo into your account
1. Create new branch
1. Commit and push changes to forked branch
1. Submit pull request from downstream branch to the upstream branch for the correct version you are targeting
1. Staging site will automatically get created and linked to PR to review and test
1. Ensure you are in your forked repo
2. Create new branch
3. Commit and push changes to forked branch
4. Submit pull request from downstream branch to the upstream branch for the correct version you are targeting
5. Staging site will automatically get created and linked to PR to review and test

## Code of Conduct

Expand Down
1 change: 1 addition & 0 deletions daprdocs/content/en/contributing/codespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ If you haven't already forked the repo, creating the Codespace will also create
- [dapr/dapr](https://github.com/dapr/dapr)
- [dapr/components-contrib](https://github.com/dapr/components-contrib)
- [dapr/cli](https://github.com/dapr/cli)
- [dapr/docs](https://github.com/dapr/docs)
- [dapr/python-sdk](https://github.com/dapr/python-sdk)

## Developing Dapr Components in a Codespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: Get started with contributing to the Dapr docs

In this guide, you'll learn how to contribute to the [Dapr docs repository](https://github.com/dapr/docs). Since Dapr docs are published to [docs.dapr.io](https://docs.dapr.io), you must make sure your contributions compile and publish correctly.

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/uPYuXcaEs-c" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Prerequisites

Before contributing to the Dapr docs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ Watch this [demo video of the Cryptography API from the Dapr Community Call #83]

## Related links
- [Cryptography overview]({{< ref cryptography-overview.md >}})
- [Cryptography component specs]({{< ref supported-cryptography >}})
- [Cryptography component specs]({{< ref supported-cryptography >}})
- [Cryptography API reference doc]({{< ref cryptography_api >}})
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ The `filter` specifies the query conditions in the form of a tree, where each no

The following operations are supported:

| Operator | Operands | Description |
|----------|-------------|--------------|
| `EQ` | key:value | key == value |
| Operator | Operands | Description |
|----------|-------------|--------------------------------------------------------------|
| `EQ` | key:value | key == value |
| `NEQ` | key:value | key != value |
| `GT` | key:value | key > value |
| `GTE` | key:value | key >= value |
| `LT` | key:value | key < value |
| `LTE` | key:value | key <= value |
| `IN` | key:[]value | key == value[0] OR key == value[1] OR ... OR key == value[n] |
| `AND` | []operation | operation[0] AND operation[1] AND ... AND operation[n] |
| `OR` | []operation | operation[0] OR operation[1] OR ... OR operation[n] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ APIs that generate random numbers, random UUIDs, or the current date are _non-de

For example, instead of this:

{{< tabs ".NET" Java Go >}}
{{< tabs ".NET" Java JavaScript Go >}}

{{% codetab %}}

Expand All @@ -188,8 +188,20 @@ string randomString = GetRandomString();

{{% codetab %}}

```javascript
// DON'T DO THIS!
const currentTime = new Date();
const newIdentifier = uuidv4();
const randomString = getRandomString();
```

{{% /codetab %}}

{{% codetab %}}

```go
// DON'T DO THIS!

```

{{% /codetab %}}
Expand All @@ -198,7 +210,7 @@ string randomString = GetRandomString();

Do this:

{{< tabs ".NET" Java Go >}}
{{< tabs ".NET" Java JavaScript Go >}}

{{% codetab %}}

Expand All @@ -224,12 +236,23 @@ String randomString = context.callActivity(GetRandomString.class.getName(), Stri

{{% codetab %}}

```go
```javascript
// Do this!!
const currentTime = context.getCurrentUtcDateTime();
const randomString = yield context.callActivity(getRandomString);
```

{{% /codetab %}}


{{% codetab %}}

```go
// Do this!!

```
{{% /codetab %}}

{{< /tabs >}}


Expand All @@ -240,7 +263,7 @@ Instead, workflows should interact with external state _indirectly_ using workfl

For example, instead of this:

{{< tabs ".NET" Java Go >}}
{{< tabs ".NET" Java JavaScript Go >}}

{{% codetab %}}

Expand All @@ -265,6 +288,25 @@ HttpResponse<String> response = HttpClient.newBuilder().build().send(request, Ht

{{% codetab %}}

```javascript
// DON'T DO THIS!
// Accessing an Environment Variable (Node.js)
const configuration = process.env.MY_CONFIGURATION;

fetch('https://postman-echo.com/get')
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
```

{{% /codetab %}}

{{% codetab %}}

```go
// DON'T DO THIS!
```
Expand All @@ -275,7 +317,7 @@ HttpResponse<String> response = HttpClient.newBuilder().build().send(request, Ht

Do this:

{{< tabs ".NET" Java Go >}}
{{< tabs ".NET" Java JavaScript Go >}}

{{% codetab %}}

Expand All @@ -299,12 +341,22 @@ String data = ctx.callActivity(MakeHttpCall.class, "https://example.com/api/data

{{% codetab %}}

```go
```javascript
// Do this!!
const configuation = workflowInput.getConfiguration(); // imaginary workflow input argument
const data = yield ctx.callActivity(makeHttpCall, "https://example.com/api/data");
```

{{% /codetab %}}


{{% codetab %}}

```go
// Do this!!
```

{{% /codetab %}}
{{< /tabs >}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ apps:
The following rules apply for all the paths present in the template file:
- If the path is absolute, it is used as is.
- All relative paths under command section should be provided relative to the template file path.
- All relative paths under common section should be provided relative to the template file path.
- `appDirPath` under apps section should be provided relative to the template file path.
- All relative paths under app section should be provided relative to the `appDirPath`.
- All other relative paths under apps section should be provided relative to the `appDirPath`.

{{% /codetab %}}

Expand Down
27 changes: 25 additions & 2 deletions daprdocs/content/en/getting-started/install-dapr-selfhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Dapr initialization includes:
1. Running a **Dapr placement service container instance** for local actor support.

{{% alert title="Docker" color="primary" %}}
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{<ref self-hosted-no-docker.md>}})), the next steps in this guide assume the recommended Docker development environment.
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}})), the next steps in this guide assume the recommended Docker development environment.

You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{<ref dapr-init.md>}}).
You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{< ref dapr-init.md >}}).
{{% /alert %}}

### Step 1: Open an elevated terminal
Expand Down Expand Up @@ -54,12 +54,35 @@ Run Windows Terminal or command prompt as administrator.

### Step 2: Run the init CLI command

{{< tabs "Linux/MacOS" "Windows">}}

{{% codetab %}}

Install the latest Dapr runtime binaries:

```bash
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. Select the **Enable default Docker socket** checkbox.

{{% /codetab %}}

{{% codetab %}}

Install the latest Dapr runtime binaries:

```bash
dapr init
```

{{% /codetab %}}

{{< /tabs >}}


### Step 3: Verify Dapr version

```bash
Expand Down
Loading

0 comments on commit 6f67dc9

Please sign in to comment.