Change all references of app-id in bindings examples to batch-* (#699)

* Change all references of app-id in bindings examples to batch-*

Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>

* fix typo

Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>

* Add bindings test for GH e2e

Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>

* Fix name of workflow

Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>

* Fix GH e2e tests and fix GO http test

Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>
This commit is contained in:
greenie-msft 2022-06-24 12:33:24 -07:00 committed by GitHub
parent 7b202e5536
commit 622b7d95c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 178 additions and 29 deletions

View File

@ -0,0 +1,149 @@
#
# Copyright 2022 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: Validate Bindings
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-latest]
steps:
- name: Install docker - MacOS
if: matrix.os == 'macos-latest'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install --cask docker
sudo /Applications/Docker.app/Contents/MacOS/Docker --unattended --install-privileged-components
open -a /Applications/Docker.app --args --unattended --accept-license
while ! /Applications/Docker.app/Contents/Resources/bin/docker info &>/dev/null; do sleep 1; done
docker --version
- name: Set up Go ${{ env.GOVER }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Set up OpenJDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
- 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: 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: Set up Postgres
run: |
pushd bindings/db/
docker compose up -d
popd
- name: Validate Python http Bindings
run: |
pushd bindings/python/http
make validate
popd
- name: Validate Python sdk Bindings
run: |
pushd bindings/python/sdk
make validate
popd
- name: Validate Javascript http Bindings
run: |
pushd bindings/javascript/http
make validate
popd
# - name: Validate Javascript sdk Bindings
# run: |
# pushd bindings/javascript/sdk
# make validate
# popd
- name: Validate Java http Bindings
run: |
pushd bindings/java/http
make validate
popd
- name: Validate Java sdk Bindings
run: |
pushd bindings/java/sdk
make validate
popd
- name: Validate Go http Bindings
run: |
pushd bindings/go/http
make validate
popd
- name: Validate Go sdk Bindings
run: |
pushd bindings/go/sdk
make validate
popd
- name: Validate .NET http Bindings
run: |
pushd bindings/csharp/http
make validate
popd
- name: Validate .NET sdk Bindings
run: |
pushd bindings/csharp/sdk
make validate
popd
- name: Linkcheck README.md
run: |
make validate

View File

@ -47,7 +47,7 @@ dotnet restore
3. Run the C# service app with Dapr:
<!-- STEP
name: Run csharp-quickstart-binding-http service
name: Run batch-http service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -61,7 +61,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id csharp-quickstart-binding-http --app-port 7001 --components-path ../../../components -- dotnet run
dapr run --app-id batch-http --app-port 7001 --components-path ../../../components -- dotnet run
```
<!-- END_STEP -->

View File

@ -18,7 +18,7 @@ using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc;
//dapr run --app-id csharp-quickstart-binding-http --app-port 7001 --components-path ../../../components -- dotnet run
//dapr run --app-id batch-http --app-port 7001 --components-path ../../../components -- dotnet run
var cronBindingName = "cron";
var sqlBindingName = "sqldb";

View File

@ -46,7 +46,7 @@ dotnet restore
3. Run the C# service app with Dapr:
<!-- STEP
name: Run csharp-quickstart-binding-sdk service
name: Run batch-sdk service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id csharp-quickstart-binding-sdk --app-port 7002 --components-path ../../../components -- dotnet run
dapr run --app-id batch-sdk --app-port 7002 --components-path ../../../components -- dotnet run
```
<!-- END_STEP -->

View File

@ -19,7 +19,7 @@ using Microsoft.AspNetCore.Mvc;
using Dapr.Client;
// dapr run --app-id csharp-quickstart-binding-sdk --app-port 7002 --components-path ../../../components -- dotnet run
// dapr run --app-id batch-sdk --app-port 7002 --components-path ../../../components -- dotnet run
var cronBindingName = "cron";
var sqlBindingName = "sqldb";

View File

@ -46,11 +46,11 @@ go build app.go
3. Run the Go service app with Dapr:
<!-- STEP
name: Run go-input-binding-http service
name: Run batch-http service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
- '== APP == insert into orders (orderid, customer, price) values (2, ''Jane Bond'', 15.40ps)'
- '== APP == insert into orders (orderid, customer, price) values (2, ''Jane Bond'', 15.40)'
- '== APP == insert into orders (orderid, customer, price) values (3, ''Tony James'', 35.56)'
- '== APP == Finished processing batch'
expected_stderr_lines:
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id go-input-binding-http --app-port 6003 --dapr-http-port 3503 --dapr-grpc-port 60003 --components-path ../../../components -- go run app.go
dapr run --app-id batch-http --app-port 6003 --dapr-http-port 3503 --dapr-grpc-port 60003 --components-path ../../../components -- go run app.go
```
<!-- END_STEP -->

View File

@ -14,7 +14,7 @@ limitations under the License.
package main
/*
dapr run --app-id go-input-binding-http --app-port 6003 --dapr-http-port 3503 --dapr-grpc-port 60003 --components-path ../../../components -- go run app.go
dapr run --app-id batch-http --app-port 6003 --dapr-http-port 3503 --dapr-grpc-port 60003 --components-path ../../../components -- go run app.go
*/
import (

View File

@ -46,7 +46,7 @@ go build app.go
3. Run the Go service app with Dapr:
<!-- STEP
name: Run go-input-binding-sdk service
name: Run batch-sdk service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id go-input-binding-sdk --app-port 6002 --dapr-http-port 3502 --dapr-grpc-port 60002 --components-path ../../../components -- go run app.go
dapr run --app-id batch-sdk --app-port 6002 --dapr-http-port 3502 --dapr-grpc-port 60002 --components-path ../../../components -- go run app.go
```
<!-- END_STEP -->

View File

@ -14,7 +14,7 @@ limitations under the License.
package main
/*
dapr run --app-id go-input-binding-sdk --app-port 6002 --dapr-http-port 3502 --dapr-grpc-port 60002 --components-path ../../../components -- go run app.go
dapr run --app-id batch-sdk --app-port 6002 --dapr-http-port 3502 --dapr-grpc-port 60002 --components-path ../../../components -- go run app.go
*/
import (

View File

@ -46,7 +46,7 @@ mvn clean install
3. Run the Java service app with Dapr:
<!-- STEP
name: Run java-binding-quickstart-http service
name: Run batch-http service
working_dir: ./batch
expected_stdout_lines:
- 'insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id java-binding-quickstart-http --app-port 8080 --components-path ../../../components -- java -jar target/BatchProcessingService-0.0.1-SNAPSHOT.jar
dapr run --app-id batch-http --app-port 8080 --components-path ../../../components -- java -jar target/BatchProcessingService-0.0.1-SNAPSHOT.jar
```
<!-- END_STEP -->

View File

@ -46,7 +46,7 @@ mvn clean install
3. Run the java service app with Dapr:
<!-- STEP
name: Run java-binding-quickstart-sdk service
name: Run batch-sdk service
working_dir: ./batch
expected_stdout_lines:
- 'insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id java-binding-quickstart-sdk --app-port 8080 --components-path ../../../components -- java -jar target/BatchProcessingService-0.0.1-SNAPSHOT.jar
dapr run --app-id batch-sdk --app-port 8080 --components-path ../../../components -- java -jar target/BatchProcessingService-0.0.1-SNAPSHOT.jar
```
<!-- END_STEP -->

View File

@ -46,7 +46,7 @@ npm install
3. Run the Javascript service app with Dapr:
<!-- STEP
name: Run javascript-quickstart-binding-http service
name: Run batch-http service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id javascript-quickstart-binding-http --app-port 5001 --dapr-http-port 3500 --components-path ../../../components -- node index.js
dapr run --app-id batch-http --app-port 5001 --dapr-http-port 3500 --components-path ../../../components -- node index.js
```
<!-- END_STEP -->

View File

@ -12,7 +12,7 @@ limitations under the License.
*/
/*
dapr run --app-id javascript-quickstart-binding-http --app-port 5001 --dapr-http-port 3500 --components-path ../../../components -- node index.js
dapr run --app-id batch-http --app-port 5001 --dapr-http-port 3500 --components-path ../../../components -- node index.js
*/
import express from "express";

View File

@ -46,7 +46,7 @@ npm install
3. Run the Javascript service app with Dapr:
<!-- STEP
name: Run javascript-quickstart-binding-sdk service
name: Run batch-sdk service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id javascript-quickstart-binding-sdk --app-port 5002 --dapr-http-port 3500 --components-path ../../../components -- node index.js
dapr run --app-id batch-sdk --app-port 5002 --dapr-http-port 3500 --components-path ../../../components -- node index.js
```
<!-- END_STEP -->

View File

@ -12,7 +12,7 @@ limitations under the License.
*/
/*
dapr run --app-id javascript-quickstart-binding-sdk --app-port 5002 --dapr-http-port 3500 --components-path ../../../components -- node index.js
dapr run --app-id batch-sdk --app-port 5002 --dapr-http-port 3500 --components-path ../../../components -- node index.js
*/
import { DaprClient, DaprServer } from "dapr-client";

View File

@ -46,7 +46,7 @@ pip3 install -r requirements.txt
3. Run the Python service app with Dapr:
<!-- STEP
name: Run python-binding-quickstart-http service
name: Run batch-http service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id python-binding-quickstart-http --app-port 50051 --components-path ../../../components -- python3 app.py
dapr run --app-id batch-http --app-port 50051 --components-path ../../../components -- python3 app.py
```
<!-- END_STEP -->

View File

@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# dapr run --app-id python-binding-quickstart-http --app-port 50051
# dapr run --app-id batch-http --app-port 50051
# --components-path ../../../components -- python3 app.py
import json

View File

@ -46,7 +46,7 @@ pip3 install -r requirements.txt
3. Run the Python service app with Dapr:
<!-- STEP
name: Run python-binding-quickstart-sdk service
name: Run batch-sdk service
working_dir: ./batch
expected_stdout_lines:
- '== APP == insert into orders (orderid, customer, price) values (1, ''John Smith'', 100.32)'
@ -60,7 +60,7 @@ timeout_seconds: 30
-->
```bash
dapr run --app-id python-binding-quickstart-sdk --app-port 50051 --components-path ../../../components -- python3 app.py
dapr run --app-id batch-sdk --app-port 50051 --components-path ../../../components -- python3 app.py
```
<!-- END_STEP -->

View File

@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# dapr run --app-id python-quickstart-binding-sdk --app-port 50051
# dapr run --app-id batch-sdk --app-port 50051
# --components-path ../../../components -- python3 app.py
import json