Skip to content

Commit

Permalink
Merge pull request #38 from dapr-sandbox/rename-to-shared
Browse files Browse the repository at this point in the history
Rename to Dapr Shared instead of Ambient
  • Loading branch information
salaboy authored Jan 8, 2024
2 parents 555f4ff + 2c1a52d commit f320f9e
Show file tree
Hide file tree
Showing 31 changed files with 316 additions and 317 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/dapr-ambient.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License.
#

name: dapr-ambient-init
name: dapr-shared-init

on:
pull_request:
Expand Down Expand Up @@ -70,12 +70,12 @@ jobs:

- name: Copy out file from volume
run: |
sudo cp ./ambient-init ${{ env.ARCHIVE_OUTDIR }}/ambient-init
sudo cp ./shared-init ${{ env.ARCHIVE_OUTDIR }}/shared-init
- name: upload artifacts
uses: actions/upload-artifact@master
with:
name: ambient-init
name: shared-init
path: ${{ env.ARCHIVE_OUTDIR }}

publish:
Expand All @@ -98,10 +98,10 @@ jobs:
REPO_OWNER=${{ github.repository_owner }}
# Lowercase the value
echo "REPO_OWNER=${REPO_OWNER,,}" >>${GITHUB_ENV}
- name: "download artifact: ambient-init"
- name: "download artifact: shared-init"
uses: actions/download-artifact@master
with:
name: ambient-init
name: shared-init
path: ${{ env.ARCHIVE_OUTDIR }}
- name: generate checksum files
run: cd ${{ env.ARCHIVE_OUTDIR }} && for i in *; do sha256sum -b $i > "$i.sha256"; done && cd -
Expand All @@ -121,12 +121,12 @@ jobs:
OWNER_NAME="${GITHUB_REPOSITORY%%/*}"
REPO_NAME="${GITHUB_REPOSITORY#*/}"
export GITHUB_TOKEN=${{ secrets.DAPR_BOT_TOKEN }}
echo "Uploading Dapr-Ambient Runtime Binaries to GitHub Release"
echo "Uploading Dapr-Shared Runtime Binaries to GitHub Release"
github-release upload \
--owner $OWNER_NAME \
--repo $REPO_NAME \
--tag "v${REL_VERSION}" \
--release-name "Dapr-Ambient Runtime v${REL_VERSION}" \
--release-name "Dapr-Shared Runtime v${REL_VERSION}" \
--body "${RELEASE_BODY}" \
--prerelease true \
${RELEASE_ARTIFACT[*]}
Expand Down Expand Up @@ -164,9 +164,9 @@ jobs:

- name: Build & Push Images
env:
KO_DOCKER_REPO: ${{ vars.DOCKER_DAPRIO_REGISTRY }}/dapr-ambient
KO_DOCKER_REPO: ${{ vars.DOCKER_DAPRIO_REGISTRY }}/dapr-shared
run: |
ko build cmd/ambient-init/main.go --platform=linux/amd64,linux/arm64 --tags ${REL_VERSION} --bare
ko build cmd/shared-init/main.go --platform=linux/amd64,linux/arm64 --tags ${REL_VERSION} --bare
helm:
runs-on: ubuntu-latest
Expand All @@ -190,12 +190,12 @@ jobs:
run: helm plugin install https://github.com/quintush/helm-unittest

- name: execute unit tests
run: helm unittest chart/dapr-ambient
run: helm unittest chart/dapr-shared

- name: Update init-container tag
run: |
sed -i -e "s|tag: latest|tag: ${REL_VERSION}|g" ./chart/dapr-ambient/values.yaml
cat ./chart/dapr-ambient/values.yaml
sed -i -e "s|tag: latest|tag: ${REL_VERSION}|g" ./chart/dapr-shared/values.yaml
cat ./chart/dapr-shared/values.yaml
- name: Container Registry login
uses: docker/login-action@v2
Expand All @@ -208,7 +208,7 @@ jobs:
- name: Package & Push Helm Chart
run : |
helm package \
./chart/dapr-ambient \
./chart/dapr-shared \
--version ${REL_VERSION}
helm push dapr-ambient-chart-${REL_VERSION}.tgz oci://docker.io/${{ vars.DOCKER_DAPRIO_REGISTRY }}
helm push dapr-shared-chart-${REL_VERSION}.tgz oci://docker.io/${{ vars.DOCKER_DAPRIO_REGISTRY }}
shell: bash
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ go.work

*.tgz

/dapr-ambient
/dapr-shared
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM busybox:1.34

COPY ambient-init ambient-init
COPY shared-init shared-init

ENTRYPOINT [ "./ambient-init" ]
ENTRYPOINT [ "./shared-init" ]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.PHONY: init/build
init/build:
CGO_ENABLED=0 go build -o ambient-init cmd/ambient-init/main.go
CGO_ENABLED=0 go build -o shared-init cmd/shared-init/main.go

# build
.PHONY: init/build-image
init/build-image: init/build
docker build -t $(image) .

release:
CGO_ENABLED=0 go build -o ambient-init cmd/ambient-init/main.go
CGO_ENABLED=0 go build -o shared-init cmd/shared-init/main.go
85 changes: 42 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,81 @@
# Dapr Ambient
# Dapr Shared

Dapr Ambient allows you to create Dapr Applications using the `daprd` Sidecar as a Kubernetes `Daemonset` or `Deployment`. This enables other use cases where Sidecars are not the best option.
Dapr Shared allows you to create Dapr Applications using the `daprd` Sidecar as a Kubernetes `Daemonset` or `Deployment`. This enables other use cases where Sidecars are not the best option.

By running `daprd` as a Kubernetes `DaemonSet` (or as a `Deployment`), the `daprd` container will be running in each Kubernetes Node, reducing the network hops between the applications and Dapr.

If you need multiple Dapr Applications, you can deploy this chart multiple times using different `ambient.appId`s.
If you need multiple Dapr Applications, you can deploy this chart multiple times using different `shared.appId`s.

## Getting Started

Before installing Dapr Ambient, please ensure you have Dapr installed in your cluster.
Before installing Dapr Shared, please ensure you have Dapr installed in your cluster.

If you want to get started with Dapr Ambient, you can easily create a new Dapr Ambient instance by installing the official Helm Chart:
If you want to get started with Dapr Shared, you can easily create a new Dapr Shared instance by installing the official Helm Chart:

```
helm install my-ambient-dapr-ambient oci://registry-1.docker.io/daprio/dapr-ambient-chart --set ambient.appId=<DAPR_APP_ID> --set ambient.remoteURL=<REMOTE_URL> ambient.remotePort=<REMOTE_PORT>
helm install my-dapr-shared oci://registry-1.docker.io/daprio/dapr-shared-chart --set shared.appId=<DAPR_APP_ID> --set shared.remoteURL=<REMOTE_URL> shared.remotePort=<REMOTE_PORT>
```

If you want to look at a step-by-step tutorial using some applications and interacting with Dapr Components, check out the [step-by-step tutorial using Kubernetes KinD here](tutorial/README.md).

## From Source

To deploy this chart from source you can run from inside the `chart/dapr-ambient` directory:
To deploy this chart from the source you can run from inside the `chart/dapr-shared` directory:

```
helm install my-ambient . --set ambient.appId=<DAPR_APP_ID> --set ambient.remoteURL=<REMOTE_URL>
helm install my-shared . --set shared.appId=<DAPR_APP_ID> --set shared.remoteURL=<REMOTE_URL>
```

Where `<DAPR_APP_ID>` is the Dapr App Id that you can use in your components (for example, for scopes) and `<REMOTE_URL>` is a reachable URL where `dapr-ambient` will forward notifications received by the Dapr sidecar.
Where `<DAPR_APP_ID>` is the Dapr App Id that you can use in your components (for example, for scopes) and `<REMOTE_URL>` is a reachable URL where `dapr-shared` will forward notifications received by the Dapr sidecar.

Future versions include forwarding notifications to multiple remote URLs.

## Customize Dapr Ambient
Is possible to customize Dapr Ambient using custom Helm values.
## Customize Dapr Shared
Customize Dapr Shared using custom Helm values

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| ambient.controlPlane.namespace | string | `"dapr-system"` | Namespace where Dapr Control Plane is. |
| ambient.daprd.apiLogging.enabled | bool | `true` | Enables API logging for the daprd. |
| ambient.daprd.app.protocol | string | `"http"` | Dapr which protocol your application is using. Valid options are `http`` and `grpc``. |
| ambient.daprd.grpcPort | int | `50001` | gRPC port for the Dapr Internal API to listen on. |
| ambient.daprd.httpPort | int | `3500` | The HTTP port for the Dapr API. |
| ambient.daprd.image.name | string | `"daprd"` | Daprd image. |
| ambient.daprd.image.pullPolicy | string | `"Always"` | Daprd image pull policy. |
| ambient.daprd.image.registry | string | `"docker.io/daprio"` | Daprd image registry. |
| ambient.daprd.image.tag | string | `"1.11.0"` | Daprd image version. |
| ambient.daprd.internalGrpcPort | int | `50002` | gRPC port for the Dapr Internal API to listen on. |
| ambient.daprd.listenAddresses | string | `"0.0.0.0"` | Comma separated list of IP addresses that daprd will listen to. Defaults to all in standalone mode. Defaults to [::1],127.0.0.1 in Kubernetes. To listen to all IPv4 addresses, use 0.0.0.0. To listen to all IPv6 addresses, use [::]. |
| ambient.daprd.metrics.enabled | bool | `true` | Enable prometheus metric. |
| ambient.daprd.metrics.port | int | `9090` | Sets the port for the sidecar metrics server. |
| ambient.daprd.mtls.enabled | bool | `false` | Enables automatic mTLS for daprd to daprd communication channels. |
| ambient.daprd.publicPort | int | `3501` | The HTTP public port for the Dapr API. |
| ambient.daprd.token | string | `""` | Dapr API token to use for token based API authentication. |
| ambient.deployment.replicas | int | `1` | The quantity of replicas. This property is set only when `ambient.strategy` is equal to `deployment` |
| ambient.initContainer.image.name | string | `"dapr-ambient"` | The dapr-ambient image name. |
| ambient.initContainer.image.pullPolicy | string | `"Always"` | The init container pull policy. |
| ambient.initContainer.image.registry | string | `"docker.io/matheuscruzdev"` | The dapr-ambient image registry. |
| ambient.initContainer.image.tag | string | `"latest"` | The dapr-ambient-init image tag. |
| ambient.initContainer.token | string | `""` | The dapr API token. |
| ambient.log.json | bool | `true` | The daprd log format. |
| ambient.log.level | string | `"info"` | The daprd log level. |
| ambient.remotePort | int | `0` | The remote port. |
| ambient.service.type | string | `"ClusterIP"` | The daprd service type. |
| ambient.serviceAccount.annotations | object | `{}` | |
| ambient.serviceAccount.create | bool | `true` | Allows the option to create or not the service account. |
| ambient.serviceAccount.name | string | `""` | Kubernetes Service Account name. |
| ambient.strategy | string | `"daemonset"` | The default strategy to run dapr in ambient mode. Possible values `daemonset`, `deployment`. |
| shared.controlPlane.namespace | string | `"dapr-system"` | Namespace where Dapr Control Plane is. |
| shared.daprd.apiLogging.enabled | bool | `true` | Enables API logging for the daprd. |
| shared.daprd.app.protocol | string | `"http"` | Dapr which protocol your application is using. Valid options are `http`` and `grpc``. |
| shared.daprd.grpcPort | int | `50001` | gRPC port for the Dapr Internal API to listen on. |
| shared.daprd.httpPort | int | `3500` | The HTTP port for the Dapr API. |
| shared.daprd.image.name | string | `"daprd"` | Daprd image. |
| shared.daprd.image.pullPolicy | string | `"Always"` | Daprd image pull policy. |
| shared.daprd.image.registry | string | `"docker.io/daprio"` | Daprd image registry. |
| shared.daprd.image.tag | string | `"1.11.0"` | Daprd image version. |
| shared.daprd.internalGrpcPort | int | `50002` | gRPC port for the Dapr Internal API to listen on. |
| shared.daprd.listenAddresses | string | `"0.0.0.0"` | Comma separated list of IP addresses that daprd will listen to. Defaults to all in standalone mode. Defaults to [::1],127.0.0.1 in Kubernetes. To listen to all IPv4 addresses, use 0.0.0.0. To listen to all IPv6 addresses, use [::]. |
| shared.daprd.metrics.enabled | bool | `true` | Enable prometheus metric. |
| shared.daprd.metrics.port | int | `9090` | Sets the port for the sidecar metrics server. |
| shared.daprd.mtls.enabled | bool | `false` | Enables automatic mTLS for daprd to daprd communication channels. |
| shared.daprd.publicPort | int | `3501` | The HTTP public port for the Dapr API. |
| shared.daprd.token | string | `""` | Dapr API token to use for token based API authentication. |
| shared.deployment.replicas | int | `1` | The quantity of replicas. This property is set only when `shared.strategy` is equal to `deployment` |
| shared.initContainer.image.name | string | `"dapr-shared"` | The dapr-shared image name. |
| shared.initContainer.image.pullPolicy | string | `"Always"` | The init container pull policy. |
| shared.initContainer.image.registry | string | `"docker.io/matheuscruzdev"` | The dapr-shared image registry. |
| shared.initContainer.image.tag | string | `"latest"` | The dapr-shared-init image tag. |
| shared.initContainer.token | string | `""` | The dapr API token. |
| shared.log.json | bool | `true` | The daprd log format. |
| shared.log.level | string | `"info"` | The daprd log level. |
| shared.remotePort | int | `0` | The remote port. |
| shared.service.type | string | `"ClusterIP"` | The daprd service type. |
| shared.serviceAccount.annotations | object | `{}` | |
| shared.serviceAccount.create | bool | `true` | Allows the option to create or not the service account. |
| shared.serviceAccount.name | string | `""` | Kubernetes Service Account name. |
| shared.strategy | string | `"daemonset"` | The default strategy to run dapr in shared mode. Possible values `daemonset`, `deployment`. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

### Building from source

I've used the [CNCF `ko` project](https://ko.build/) to build multiplatform images for the proxy.
You can run the following command to build containers for the `dapr-ambient` proxy:
You can run the following command to build containers for the `dapr-shared` proxy:

```
ko build --platform=linux/amd64,linux/arm64
Expand Down
5 changes: 0 additions & 5 deletions chart/dapr-ambient/Chart.yaml

This file was deleted.

83 changes: 0 additions & 83 deletions chart/dapr-ambient/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions chart/dapr-ambient/templates/daemonset.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions chart/dapr-ambient/templates/deployment.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions chart/dapr-ambient/templates/secret.yaml

This file was deleted.

Loading

0 comments on commit f320f9e

Please sign in to comment.