add new validaters for new quickstarts - pubsub (#606)

* add new validaters for clean test runs

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix the path

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* clean apps and make validation more accurate in sequence

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix the java sdk test

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* combine pubsub runs to single validator

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix license

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix version issues

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* remove java triggers due to flakiness

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* remove individual validator per lang

Signed-off-by: tanvigour <tanvi.gour@gmail.com>
This commit is contained in:
tanvigour 2022-03-16 21:00:33 -04:00 committed by GitHub
parent d80967408b
commit e6e11411e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 275 additions and 40 deletions

View File

@ -0,0 +1,171 @@
#
# Copyright 2021 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Auto Validate New Quickstarts
on:
workflow_dispatch:
push:
branches:
- master
- feature/new_quickstarts
- release-*
tags:
- v*
pull_request:
branches:
- master
- feature/new_quickstarts
- release-*
jobs:
deploy:
name: Validate quickstarts on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
GOVER: 1.17
KUBERNETES_VERSION: v1.21.1
KIND_VERSION: v0.11.0
KIND_IMAGE_SHA: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
strategy:
matrix:
os: [ubuntu-latest, macos-10.15]
steps:
- name: Install docker - MacOS
if: matrix.os == 'macos-10.15'
uses: docker-practice/actions-setup-docker@v1
with:
docker_buildx: false
docker_version: 20.10
- name: Configure KinD
if: matrix.os == 'ubuntu-latest'
# Generate a KinD configuration file that uses:
# A couple of worker nodes: this is needed to run both
# ZooKeeper + Kakfa
working-directory: ./
run: |
cat > kind.yaml <<EOF
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
image: kindest/node:${{ env.KUBERNETES_VERSION }}@${{ env.KIND_IMAGE_SHA }}
- role: worker
image: kindest/node:${{ env.KUBERNETES_VERSION }}@${{ env.KIND_IMAGE_SHA }}
- role: worker
image: kindest/node:${{ env.KUBERNETES_VERSION }}@${{ env.KIND_IMAGE_SHA }}
- role: worker
image: kindest/node:${{ env.KUBERNETES_VERSION }}@${{ env.KIND_IMAGE_SHA }}
- role: worker
image: kindest/node:${{ env.KUBERNETES_VERSION }}@${{ env.KIND_IMAGE_SHA }}
EOF
# Log the generated kind.yaml for easy reference.
cat kind.yaml
- name: Create KinD Cluster - Linux
if: matrix.os == 'ubuntu-latest'
uses: helm/kind-action@v1.0.0
with:
config: kind.yaml
cluster_name: kind
version: ${{ env.KIND_VERSION }}
- name: Install minikube - MacOS
if: matrix.os == 'macos-10.15'
run: |
brew install kubernetes-cli || brew link --overwrite kubernetes-cli
brew install minikube
minikube start --driver=virtualbox --memory 4096 --host-only-cidr "192.168.59.1/24"
- name: Get KinD info
if: matrix.os == 'ubuntu-latest'
run: |
kubectl cluster-info --context kind-kind
NODE_IP=$(kubectl get nodes \
-lkubernetes.io/hostname!=kind-control-plane \
-ojsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
echo "SERVICE_IP=$NODE_IP" >> $GITHUB_ENV
- name: Set up Go ${{ env.GOVER }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Determine latest Dapr Runtime version including Pre-releases
run: |
helm repo add dapr https://dapr.github.io/helm-charts/ && helm repo update && export RUNTIME_VERSION=$(helm search repo dapr/dapr --devel --versions | awk '/dapr\/dapr/ {print $3; exit}' )
echo "DAPR_RUNTIME_VERSION=$RUNTIME_VERSION" >> $GITHUB_ENV
echo "Found $RUNTIME_VERSION"
shell: bash
- name: Determine latest Dapr Cli version including Pre-releases
run: |
export CLI_VERSION=$(curl "https://api.github.com/repos/dapr/cli/releases?per_page=1&page=1" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | jq '.[0].tag_name'| tr -d '",v')
echo "DAPR_CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
echo "Found $CLI_VERSION"
shell: bash
- name: Set up Dapr CLI - Mac/Linux
if: matrix.os != 'windows-latest'
run: wget -q ${{ env.DAPR_INSTALL_URL }}/install.sh -O - | /bin/bash -s ${{ env.DAPR_CLI_VERSION }}
- name: Set up Dapr CLI - Windows
if: matrix.os == 'windows-latest'
run: powershell -Command "\$$script=iwr -useb ${{ env.DAPR_INSTALL_URL }}/install.ps1; \$$block=[ScriptBlock]::Create(\$$script); invoke-command -ScriptBlock \$$block -ArgumentList ${{ env.DAPR_CLI_VERSION }}"
- name: Install Dapr
run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
dapr init --runtime-version=${{ env.DAPR_RUNTIME_VERSION }}
dapr --version
- name: Install Dapr - Kubernetes
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install redis bitnami/redis
dapr init -k --runtime-version=${{ env.DAPR_RUNTIME_VERSION }} --wait || kubectl get pods --all-namespaces
kubectl get nodes -o wide
for pod in `dapr status -k | awk '/dapr/ {print $1}'`; do kubectl describe pod -l app=$pod -n dapr-system ; kubectl logs -l app=$pod -n dapr-system; done
- name: Check out code
uses: actions/checkout@v2
- name: Install utilities dependencies
run: |
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
pip3 install setuptools wheel
pip3 install mechanical-markdown
- name: Validate Go http pubsub
run: |
pushd pub_sub/go/http
make validate
popd
- name: Validate Go sdk pubsub
run: |
pushd pub_sub/go/sdk
make validate
popd
- name: Validate JS http pubsub
run: |
pushd pub_sub/javascript/http
make validate
popd
- name: Validate JS sdk pubsub
run: |
pushd pub_sub/javascript/sdk
make validate
popd
- name: Validate python http pubsub
run: |
pushd pub_sub/python/http
make validate
popd
- name: Validate python sdk pubsub
run: |
pushd pub_sub/python/sdk
make validate
popd
- name: Linkcheck README.md
run: |
make validate

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=csharp-http-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=csharp-sdk-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -32,11 +32,9 @@ go build app.go
<!-- STEP
name: Run Go publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Published data: {"orderId":1}'
- '== APP == Published data: {"orderId":2}'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
output_match_mode: substring
background: true
@ -68,9 +66,7 @@ go build app.go
<!-- STEP
name: Run Go subscriber
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Subscriber received: {"orderId":10}'
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
output_match_mode: substring
@ -84,4 +80,9 @@ cd ./order-processor
dapr run --app-port 6001 --app-id order-processor --app-protocol http --dapr-http-port 3501 --components-path ../../../components -- go run app.go
```
<!-- END_STEP -->
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

5
pub_sub/go/http/makefile Normal file
View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=go-http-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -32,11 +32,9 @@ go build app.go
<!-- STEP
name: Run Go publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Published data: {"orderId":1}'
- '== APP == Published data: {"orderId":2}'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
output_match_mode: substring
background: true
@ -69,9 +67,7 @@ go build app.go
<!-- STEP
name: Run Go subscriber
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Subscriber received: {"orderId":10}'
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
output_match_mode: substring
@ -85,3 +81,8 @@ dapr run --app-port 6001 --app-id order-processor --app-protocol http --dapr-htt
```
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

5
pub_sub/go/sdk/makefile Normal file
View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=go-sdk-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -42,11 +42,9 @@ mvn clean install
<!-- STEP
name: Run Java publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- 'Published data: 1'
- 'Published data: 2'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
working_dir: ./checkout
output_match_mode: substring
@ -77,9 +75,7 @@ mvn clean install
<!-- STEP
name: Run Java publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- 'Subscriber received: 2'
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
working_dir: ./order-processor
@ -90,4 +86,9 @@ sleep: 10
```bash
dapr run --app-port 8080 --app-id order-processor --components-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
```
<!-- END_STEP -->
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

View File

@ -34,6 +34,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.4</version>
<executions>
<execution>
<goals>

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=java-http-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -24,6 +24,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<optional>true</optional>
</dependency>
</dependencies>
@ -32,6 +33,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.4</version>
</plugin>
</plugins>
</build>

View File

@ -43,11 +43,9 @@ mvn clean install
name: Run Java publisher
working_dir: ./checkout
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- 'Published data: 1'
- 'Published data: 2'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
output_match_mode: substring
background: true
@ -55,7 +53,7 @@ sleep: 10
-->
```bash
dapr run --app-id checkout --components-path ../../components -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar
dapr run --app-id checkout --components-path ../../../components -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar
```
<!-- END_STEP -->
@ -78,9 +76,7 @@ mvn clean install
name: Run Java publisher
working_dir: ./order-processor
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- 'Subscriber received: 2'
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
output_match_mode: substring
@ -88,6 +84,11 @@ background: true
sleep: 10
-->
```bash
dapr run --app-port 8080 --app-id order-processor --components-path ../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
dapr run --app-port 8080 --app-id order-processor --components-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
```
<!-- END_STEP -->
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

View File

@ -36,7 +36,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<version>1.18.22</version>
<optional>true</optional>
</dependency>
</dependencies>
@ -46,6 +46,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.4</version>
<executions>
<execution>
<goals>

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=java-sdk-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -34,6 +34,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<optional>true</optional>
</dependency>
</dependencies>
@ -43,6 +44,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -32,11 +32,9 @@ npm install
<!-- STEP
name: Run Node publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Published data: {"orderId":2}'
- '== APP == Published data: {"orderId":3}'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
working_dir: ./checkout
output_match_mode: substring
@ -67,9 +65,7 @@ npm install
<!-- STEP
name: Run Node publisher
expected_stdout_lines:
- '== APP == Subscriber received: { orderId: 2 }'
- "You're up and running! Both Dapr and your app logs will appear here."
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
working_dir: ./order-processor
@ -82,4 +78,9 @@ sleep: 10
dapr run --app-id checkout --components-path ../../../components/ --app-port 5001 -- node .
```
<!-- END_STEP -->
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=javascript-http-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -32,11 +32,9 @@ npm install
<!-- STEP
name: Run Node publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == Published data: {"orderId":2}'
- '== APP == Published data: {"orderId":3}'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
working_dir: ./checkout
output_match_mode: substring
@ -68,8 +66,6 @@ npm install
name: Run Node publisher
expected_stdout_lines:
- '== APP == Subscriber received: {"orderId":2}'
- "You're up and running! Both Dapr and your app logs will appear here."
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
working_dir: ./order-processor
@ -82,4 +78,9 @@ sleep: 10
dapr run --app-id checkout --components-path ../../../components/ --app-port 5001 -- node .
```
<!-- END_STEP -->
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=javascript-sdk-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -32,11 +32,9 @@ pip3 install -r requirements.txt
<!-- STEP
name: Run python publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == INFO:root:Published data: {"orderId": 1}'
- '== APP == INFO:root:Published data: {"orderId": 2}'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
output_match_mode: substring
working_dir: ./checkout
@ -68,8 +66,6 @@ pip3 install -r requirements.txt
name: Run python subscriber
expected_stdout_lines:
- '== APP == Subscriber received : 2'
- "You're up and running! Both Dapr and your app logs will appear here."
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
output_match_mode: substring
@ -84,3 +80,8 @@ dapr run --app-id order-processor --components-path ../../../components/ --app-p
```
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=python-http-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk

View File

@ -33,11 +33,9 @@ pip3 install -r requirements.txt
<!-- STEP
name: Run python publisher
expected_stdout_lines:
- "You're up and running! Both Dapr and your app logs will appear here."
- '== APP == INFO:root:Published data: {"orderId": 1}'
- '== APP == INFO:root:Published data: {"orderId": 2}'
- "Exited App successfully"
- "Exited Dapr successfully"
expected_stderr_lines:
output_match_mode: substring
working_dir: ./checkout
@ -69,8 +67,6 @@ pip3 install -r requirements.txt
name: Run python subscriber
expected_stdout_lines:
- '== APP == Subscriber received : 4'
- "You're up and running! Both Dapr and your app logs will appear here."
- "Exited Dapr successfully"
- "Exited App successfully"
expected_stderr_lines:
output_match_mode: substring
@ -85,3 +81,8 @@ dapr run --app-id order-processor --components-path ../../../components/ --app-p
```
<!-- END_STEP -->
```bash
dapr stop --app-id checkout
dapr stop --app-id order-processor
```

View File

@ -0,0 +1,5 @@
DOCKER_IMAGE_PREFIX ?=python-sdk-
APPS ?=checkout order-processor
include ../../../docker.mk
include ../../../validate.mk