Fix links due to repo rename (#281)

* Removing numbering and README changes

* Fixing build.yaml and other references to numbered names

* Changing more places to use quickstart term

* Additional samples to quickstarts changes
This commit is contained in:
Ori Zohar 2020-08-12 16:39:52 -07:00 committed by GitHub
parent 5c24105778
commit e7ed68f6ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
247 changed files with 116 additions and 119 deletions

View File

@ -12,6 +12,6 @@ Please reference the issue this PR will close: #_[issue number]_
Please make sure you've completed the relevant tasks for this PR, out of the following list:
* [ ] The sample code compiles correctly
* [ ] You've tested new builds of the sample if you changed sample code
* [ ] You've updated the sample's README if necessary
* [ ] The quickstart code compiles correctly
* [ ] You've tested new builds of the quickstart if you changed quickstart code
* [ ] You've updated the quickstart's README if necessary

View File

@ -29,7 +29,7 @@ jobs:
echo "##[set-env name=SAMPLE_REGISTRY;]$SAMPLE_REGISTRY"
fi
SAMPLE_LIST=(2.hello-kubernetes 3.distributed-calculator 4.pub-sub 5.bindings 7.middleware 8.observability 9.secretstore 10.hello-docker-compose)
SAMPLE_LIST=(hello-kubernetes distributed-calculator pub-sub bindings middleware observability secretstore hello-docker-compose)
for sample in "${SAMPLE_LIST[@]}"; do
echo "Building image for ${sample}..."
@ -44,7 +44,7 @@ jobs:
- name: publish image to dockerhub
if: github.event_name != 'pull_request'
run: |
SAMPLE_LIST=(2.hello-kubernetes 3.distributed-calculator 4.pub-sub 5.bindings 7.middleware 8.observability 9.secretstore)
SAMPLE_LIST=(hello-kubernetes distributed-calculator pub-sub bindings middleware observability secretstore)
for sample in "${SAMPLE_LIST[@]}"; do
echo "Push image for ${sample}..."

View File

@ -40,7 +40,7 @@ Before you file an issue, make sure you've checked the following:
1. Is it the right repository?
- The Dapr project is distributed across multiple repositories. Check the list of [repositories](https://github.com/dapr) if you aren't sure which repo is the correct one.
1. Check for existing issues
- Before you create a new issue, please do a search in [open issues](https://github.com/dapr/samples/issues) to see if the issue or feature request has already been filed.
- Before you create a new issue, please do a search in [open issues](https://github.com/dapr/quickstarts/issues) to see if the issue or feature request has already been filed.
- If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reaction-to-pull-requests-issues-and-comments). Use a reaction:
- 👍 up-vote
- 👎 down-vote

View File

@ -1,10 +1,10 @@
# Dapr Samples
# Dapr Quickstarts
[![Build Status](https://github.com/dapr/samples/workflows/samples/badge.svg?event=push&branch=master)](https://github.com/dapr/samples/actions?workflow=samples)
[![Build Status](https://github.com/dapr/quickstarts/workflows/samples/badge.svg?event=push&branch=master)](https://github.com/dapr/quickstarts/actions?workflow=samples)
[![Join the chat at https://gitter.im/Dapr/samples](https://badges.gitter.im/Dapr/samples.svg)](https://gitter.im/Dapr/samples?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
This repository contains a series of samples that highlight Dapr capabilities. The first sample demonstrates how we run Dapr in standalone mode, while the second highlights how we run the same application in Kubernetes. Each subsequent sample includes instructions for running both in standalone and in Kubernetes.
This repository contains a collection of code samples that are aimed to get you started quickly with Dapr, each highlighting a different Dapr capability. The first quickstart to begin with is *hello-world*, it demonstrates how to run Dapr in standalone mode locally on your machine. If you are familiar with Kubernetes and want to see how to run the same application in Kubernetes, look for the *hello-kubernetes* quickstart. Each of the other quickstarts which explore different Dapr capabilities include instructions for running both in standalone and in Kubernetes.
## Getting Started
@ -14,33 +14,30 @@ It is recommended to go through the samples via the [Getting Started](https://gi
Dapr is currently under community development with preview releases. The master branch includes breaking changes, therefore ensure that you're running the samples with the right version of Dapr runtime.
| Dapr Sample Version | Dapr Runtime Version |
| Dapr Quickstart Version | Dapr Runtime Version |
|:--------------------:|:--------------------:|
| [v0.9.0](https://github.com/dapr/samples/tree/v0.9.0) | [v0.9.0](https://github.com/dapr/dapr/tree/v0.9.0) |
| [v0.8.0](https://github.com/dapr/samples/tree/v0.8.0) | [v0.8.0](https://github.com/dapr/dapr/tree/v0.8.0) |
| [v0.7.0](https://github.com/dapr/samples/tree/v0.7.0) | [v0.7.0](https://github.com/dapr/dapr/tree/v0.7.0) |
| [v0.6.0](https://github.com/dapr/samples/tree/v0.6.0) | [v0.6.0](https://github.com/dapr/dapr/tree/v0.6.0) |
| [v0.5.0](https://github.com/dapr/samples/tree/v0.5.0) | [v0.5.0](https://github.com/dapr/dapr/tree/v0.5.0) |
| [v0.4.0](https://github.com/dapr/samples/tree/v0.4.0) | [v0.4.0](https://github.com/dapr/dapr/tree/v0.4.0) |
| [v0.3.0](https://github.com/dapr/samples/tree/v0.3.0) | [v0.3.0](https://github.com/dapr/dapr/tree/v0.3.0) |
| [v0.2.0](https://github.com/dapr/samples/tree/v0.2.0) | [v0.2.0](https://github.com/dapr/dapr/tree/v0.2.0) |
| [v0.1.0](https://github.com/dapr/samples/tree/v0.1.0) | [v0.1.0](https://github.com/dapr/dapr/tree/v0.1.0) |
| [v0.9.0](https://github.com/dapr/quickstarts/tree/v0.9.0) | [v0.9.0](https://github.com/dapr/dapr/tree/v0.9.0) |
| [v0.8.0](https://github.com/dapr/quickstarts/tree/v0.8.0) | [v0.8.0](https://github.com/dapr/dapr/tree/v0.8.0) |
| [v0.7.0](https://github.com/dapr/quickstarts/tree/v0.7.0) | [v0.7.0](https://github.com/dapr/dapr/tree/v0.7.0) |
| [v0.6.0](https://github.com/dapr/quickstarts/tree/v0.6.0) | [v0.6.0](https://github.com/dapr/dapr/tree/v0.6.0) |
| [v0.5.0](https://github.com/dapr/quickstarts/tree/v0.5.0) | [v0.5.0](https://github.com/dapr/dapr/tree/v0.5.0) |
| [v0.4.0](https://github.com/dapr/quickstarts/tree/v0.4.0) | [v0.4.0](https://github.com/dapr/dapr/tree/v0.4.0) |
| [v0.3.0](https://github.com/dapr/quickstarts/tree/v0.3.0) | [v0.3.0](https://github.com/dapr/dapr/tree/v0.3.0) |
| [v0.2.0](https://github.com/dapr/quickstarts/tree/v0.2.0) | [v0.2.0](https://github.com/dapr/dapr/tree/v0.2.0) |
| [v0.1.0](https://github.com/dapr/quickstarts/tree/v0.1.0) | [v0.1.0](https://github.com/dapr/dapr/tree/v0.1.0) |
## Samples
## Quickstarts
| Sample | Description |
| Quickstart | Description |
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [1. Hello-world](./1.hello-world) | Demonstrates how to run Dapr locally. Highlights service invocation and state management. |
| [2. Hello-kubernetes](./2.hello-kubernetes) | Demonstrates how to run Dapr in Kubernetes. Highlights service invocation and state management. |
| [1. Hello-world](./hello-world) | Demonstrates how to run Dapr locally. Highlights service invocation and state management. |
| [2. Hello-kubernetes](./hello-kubernetes) | Demonstrates how to run Dapr in Kubernetes. Highlights service invocation and state management. |
| [3. Distributed-calculator](./3.distributed-calculator) | Demonstrates a distributed calculator application that uses Dapr services to power a React web app. Highlights polyglot (multi-language) programming, service invocation and state management. |
| [4. Pub-sub](./4.pub-sub) | Demonstrates how we use Dapr to enable pub-sub applications. Uses Redis as a pub-sub component. |
| [5. Bindings](./5.bindings) | Demonstrates how we use Dapr to create input and output bindings to other components. Uses bindings to Kafka. |
| [6. Functions-and-keda](./6.functions-and-keda) | Demonstrates use of Dapr pub/sub from Azure Functions, as well as composition with KEDA. |
| [7. Middleware](./7.middleware) | Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization. |
| [8. Observability](./8.observability) | Demonstrates Dapr tracing capabilities. Uses Zipkin as a tracing component. |
| [9. Secret Store](./9.secretstore) | Demonstrates the use of Dapr Secrets API. |
| [10. Docker Compose](./10.hello-docker-compose) | Demonstrates how to get Dapr running locally with Docker Compose. |
| [11. Minimal Init (Dapr Slim)](./11.hello-dapr-slim) | Demonstrates how to run dapr locally, without a dependency on Docker. |
| [4. Pub-sub](./pub-sub) | Demonstrates how we use Dapr to enable pub-sub applications. Uses Redis as a pub-sub component. |
| [5. Bindings](./bindings) | Demonstrates how we use Dapr to create input and output bindings to other components. Uses bindings to Kafka. |
| [6. Middleware](./middleware) | Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization. |
| [7. Observability](./observability) | Demonstrates Dapr tracing capabilities. Uses Zipkin as a tracing component. |
| [8. Secret Store](./secretstore) | Demonstrates the use of Dapr Secrets API. |
## SDKs
@ -55,8 +52,8 @@ Find SDK-specific samples in the links below:
- **[Javascript SDK](https://github.com/dapr/js-sdk)**
- **[Python SDK](https://github.com/dapr/python-sdk)**
To get started with the samples, clone this repository and follow instructions in each sample:
To get started with the quickstarts, clone this repository and follow instructions in each sample:
```bash
git clone [-b <dapr_version_tag>] https://github.com/dapr/samples.git
git clone [-b <dapr_version_tag>] https://github.com/dapr/quickstarts.git
```
> **Note**: See https://github.com/dapr/samples#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/samples.git` when using the edge version of dapr runtime.
> **Note**: See https://github.com/dapr/quickstarts#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/quickstarts.git` when using the edge version of dapr runtime.

View File

@ -1,8 +1,8 @@
# Dapr Bindings Sample
# Dapr Bindings
In this sample, we'll create two microservices, one with an input binding and another with an output binding. We'll bind to Kafka, but note that there are a myriad of components that Dapr can bind to ([see Dapr components](https://github.com/dapr/docs/tree/master/concepts/bindings)).
In this quickstart, we'll create two microservices, one with an input binding and another with an output binding. We'll bind to Kafka, but note that there are a myriad of components that Dapr can bind to ([see Dapr components](https://github.com/dapr/docs/tree/master/concepts/bindings)).
This sample includes two microservices:
This quickstart includes two microservices:
- Node.js microservice that utilizes an input binding
- Python microservice that utilizes an output binding
@ -11,7 +11,7 @@ The bindings connect to Kafka, allowing us to push messages into a Kafka instanc
![Architecture Diagram](./img/Bindings_Standalone.png)
Dapr allows us to deploy the same microservices from our local machines to Kubernetes. Correspondingly, this sample has instructions for deploying this project [locally](#Run-Locally) or in [Kubernetes](#Run-in-Kubernetes).
Dapr allows us to deploy the same microservices from our local machines to Kubernetes. Correspondingly, this quickstart has instructions for deploying this project [locally](#Run-Locally) or in [Kubernetes](#Run-in-Kubernetes).
## Prerequisites
@ -27,16 +27,16 @@ Dapr allows us to deploy the same microservices from our local machines to Kuber
## Run Locally
### Clone the sample repository
Clone this sample repository to your local machine:
### Clone the quickstarts repository
Clone this quickstarts repository to your local machine:
```bash
git clone [-b <dapr_version_tag>] https://github.com/dapr/samples.git
git clone [-b <dapr_version_tag>] https://github.com/dapr/quickstarts.git
```
> **Note**: See https://github.com/dapr/samples#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/samples.git` when using the edge version of dapr runtime.
> **Note**: See https://github.com/dapr/quickstarts#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/quickstarts.git` when using the edge version of dapr runtime.
### Run Kafka Docker Container Locally
In order to run the Kafka bindings sample locally, you will run the [Kafka broker server](https://github.com/wurstmeister/kafka-docker) in a docker container on your machine.
In order to run the Kafka bindings quickstart locally, you will run the [Kafka broker server](https://github.com/wurstmeister/kafka-docker) in a docker container on your machine.
1. Run `docker-compose -f ./docker-compose-single-kafka.yml up -d` to run the container locally
2. Run `docker ps` to see the container running locally:
@ -54,7 +54,7 @@ Now that you have Kafka running locally on your machine, we'll need to run our m
1. Navigate to Node subscriber directory in your CLI: `cd nodeapp`
2. Install dependencies: `npm install`
3. Run Node sample app with Dapr: `dapr run --app-id bindings-nodeapp --app-port 3000 node app.js --components-path ./components`
3. Run Node quickstart app with Dapr: `dapr run --app-id bindings-nodeapp --app-port 3000 node app.js --components-path ./components`
### Run Python Microservice with Output Binding
@ -62,7 +62,7 @@ Next, we'll run the Python microservice that uses output bindings
1. Open a new CLI window and navigate to Python subscriber directory in your CLI: `cd pythonapp`
2. Install dependencies: `pip3 install requests`
3. Run Python sample app with Dapr: `dapr run --app-id bindings-pythonapp python3 app.py --components-path ./components`
3. Run Python quickstart app with Dapr: `dapr run --app-id bindings-pythonapp python3 app.py --components-path ./components`
### Observe Logs
@ -90,7 +90,7 @@ Next, we'll run the Python microservice that uses output bindings
### Cleanup
Once you're done using the sample locally, you can spin down your local Kafka Docker Container by running:
Once you're done, you can spin down your local Kafka Docker Container by running:
```bash
docker-compose -f ./docker-compose-single-kafka.yml down
@ -175,7 +175,7 @@ Hello from Kafka!
### Cleanup
Once you're done using the sample, you can spin down your Kubernetes resources by navigating to the `./deploy` directory and running:
Once you're done, you can spin down your Kubernetes resources by navigating to the `./deploy` directory and running:
```bash
cd ./deploy
@ -184,7 +184,7 @@ kubectl delete -f .
This will spin down each resource defined by the .yaml files in the `deploy` directory, including the kafka component.
Once you delete all samples apps, delete Kafka in the cluster.
Once you delete all quickstart apps, delete Kafka in the cluster.
```bash
# clean up kafka cluster
@ -193,7 +193,7 @@ helm uninstall dapr-kafka --namespace kafka
## How it Works
Now that you've run the sample locally and/or in Kubernetes, let's unpack how this all works. Our app is broken up into input binding app and output binding app:
Now that you've run the quickstart locally and/or in Kubernetes, let's unpack how this all works. Our app is broken up into input binding app and output binding app:
### Kafka Bindings yaml

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -1,6 +1,6 @@
# Distributed Calculator
This sample shows method invocation and state persistent capabilities of Dapr through a distributed calculator where each operation is powered by a different service written in a different language/framework:
This quickstart shows method invocation and state persistent capabilities of Dapr through a distributed calculator where each operation is powered by a different service written in a different language/framework:
- **Addition**: Go [mux](https://github.com/gorilla/mux) application
- **Multiplication**: Python [flask](https://flask.palletsprojects.com/en/1.0.x/) application
@ -11,16 +11,16 @@ The front-end application consists of a server and a client written in [React](h
Kudos to [ahfarmer](https://github.com/ahfarmer) whose [React calculator](https://github.com/ahfarmer/calculator)
The following architecture diagram illustrates the components that make up this sample:
The following architecture diagram illustrates the components that make up this quickstart:
![Architecture Diagram](./img/Architecture_Diagram.png)
## Prerequisites for running the sample
Clone the sample repository
## Prerequisites for running the quickstart
Clone the quickstarts repository
```bash
git clone [-b <dapr_version_tag>] https://github.com/dapr/samples.git
git clone [-b <dapr_version_tag>] https://github.com/dapr/quickstarts.git
```
> **Note**: See https://github.com/dapr/samples#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/samples.git` when using the edge version of dapr runtime.
> **Note**: See https://github.com/dapr/quickstarts#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/quickstarts.git` when using the edge version of dapr runtime.
### - Run locally
1. Install [Docker](https://www.docker.com/products/docker-desktop)
@ -35,7 +35,7 @@ Clone the sample repository
1. Dapr-enabled Kubernetes cluster. Follow [these instructions](https://github.com/dapr/docs/blob/master/getting-started/environment-setup.md#installing-dapr-on-a-kubernetes-cluster) to set this up.
## Running the sample locally
## Running the quickstart locally
These instructions start the four calculator operator apps (add, subtract, multiply and divide) along with the dapr sidecar locally and then run the front end app which persists the state in a local redis state store.
@ -114,8 +114,8 @@ These instructions start the four calculator operator apps (add, subtract, multi
## Running the sample Kubernetes environment
1. Navigate to the deploy directory in this sample directory: `cd deploy`
## Running the quickstart in a Kubernetes environment
1. Navigate to the deploy directory in this quickstart directory: `cd deploy`
2. Follow [these instructions](https://github.com/dapr/docs/blob/master/howto/setup-state-store/setup-redis.md) to create and configure a Redis store
3. Deploy all of your resources: `kubectl apply -f .`.
> **Note**: Services could also be deployed one-by-one by specifying the .yaml file: `kubectl apply -f go-adder.yaml`.
@ -197,7 +197,7 @@ Our client code calls to an Express server, which routes our calls through Dapr
```
### Kubernetes environment cleanup
- Once you're done using the sample, you can spin down your Kubernetes resources by navigating to the `./deploy` directory and running:
- Once you're done, you can spin down your Kubernetes resources by navigating to the `./deploy` directory and running:
```bash
kubectl delete -f .
@ -207,11 +207,11 @@ This will spin down each resource defined by the .yaml files in the `deploy` dir
## The Role of Dapr
This sample demonstrates how we use Dapr as a programming model for simplifying the development of distributed systems. In this sample, Dapr is enabling polyglot programming, service discovery and simplified state management.
This quickstart demonstrates how we use Dapr as a programming model for simplifying the development of distributed systems. In this quickstart, Dapr is enabling polyglot programming, service discovery and simplified state management.
### Polyglot Programming
Each service in this sample is written in a different programming language, but they're used together in the same larger application. Dapr itself is language agnostic - none of our services have to include any dependency in order to work with Dapr. This empowers developers to build each service however they want, using the best language for the job or for a particular dev team.
Each service in this quickstart is written in a different programming language, but they're used together in the same larger application. Dapr itself is language agnostic - none of our services have to include any dependency in order to work with Dapr. This empowers developers to build each service however they want, using the best language for the job or for a particular dev team.
### Service Invocation
@ -237,7 +237,7 @@ Microservice applications are dynamic with scaling, updates and failures causing
### Simplified State Management
Dapr sidecars provide state management. In this sample, we persist our calculator's state each time we click a new button. This means we can refresh the page, close the page or even take down our `calculator-front-end` pod, and still retain the same state when we next open it. Dapr adds a layer of indirection so that our app doesn't need to know where it's persisting state. It doesn't have to keep track of keys, handle retry logic or worry about state provider specific configuration. All it has to do is GET or POST against its Dapr sidecar's state endpoint: `http://localhost:3500/v1.0/state/${stateStoreName}`.
Dapr sidecars provide state management. In this quickstart, we persist our calculator's state each time we click a new button. This means we can refresh the page, close the page or even take down our `calculator-front-end` pod, and still retain the same state when we next open it. Dapr adds a layer of indirection so that our app doesn't need to know where it's persisting state. It doesn't have to keep track of keys, handle retry logic or worry about state provider specific configuration. All it has to do is GET or POST against its Dapr sidecar's state endpoint: `http://localhost:3500/v1.0/state/${stateStoreName}`.
Take a look at `server.js` in the `react-calculator` directory. Note that it exposes two state endpoints for our React client to get and set state: the GET `/state` endpoint and the POST `/persist` endpoint. Both forward client calls to the Dapr state endpoint:

View File

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -10,7 +10,7 @@ const daprPort = process.env.DAPR_HTTP_PORT || 3500;
const daprUrl = `http://localhost:${daprPort}/v1.0/invoke`;
// The name of the state store is specified in the components yaml file.
// For this sample, state store name is specified in the file at: https://github.com/dapr/samples/blob/master/2.hello-kubernetes/deploy/redis.yaml#L4
// For this sample, state store name is specified in the file at: https://github.com/dapr/quickstarts/blob/master/hello-kubernetes/deploy/redis.yaml#L4
const stateStoreName = `statestore`;
const stateUrl = `http://localhost:${daprPort}/v1.0/state/${stateStoreName}`;

Some files were not shown because too many files have changed in this diff Show More