Skip to content

Commit

Permalink
Merge branch 'master' into add-test-for-fromflags
Browse files Browse the repository at this point in the history
  • Loading branch information
daixiang0 authored May 19, 2023
2 parents f776516 + 89a93c9 commit ddd11bc
Show file tree
Hide file tree
Showing 85 changed files with 4,456 additions and 2,658 deletions.
1 change: 1 addition & 0 deletions .github/scripts/dapr_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ async function handleIssueCommentCreate({ github, context }) {
case '/test-sdk-all':
case '/test-sdk-java':
case '/test-sdk-python':
case '/test-sdk-js':
await cmdTestSDK(
github,
issue,
Expand Down
181 changes: 162 additions & 19 deletions .github/workflows/dapr-test-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ name: dapr-test-sdk
on:
# Run every 12 hours on weekdays, and every 24 hours on weekends.
schedule:
- cron: "0 */12 * * 1-5"
- cron: "30 0 * * 0,6"
- cron: "16 */11 * * 1-5"
- cron: "41 0 * * 0,6"
# Dispatch on external events
repository_dispatch:
types: [test-sdk-all, test-sdk-python, test-sdk-java]
types:
- test-sdk-all
- test-sdk-python
- test-sdk-java
- test-sdk-js
env:
GOOS: linux
GOARCH: amd64
Expand All @@ -33,6 +37,7 @@ env:
# /test-sdk-all
# /test-sdk-python
# /test-sdk-java
# /test-sdk-js
jobs:
python-sdk:
if: |
Expand Down Expand Up @@ -72,7 +77,7 @@ jobs:
if: env.PR_NUMBER != ''
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-python
number: ${{ env.PR_NUMBER }}
hide: true
hide_classify: OUTDATED
Expand All @@ -84,7 +89,11 @@ jobs:
Commit ref: ${{ env.CHECKOUT_REF }}
- uses: actions/checkout@v3
- name: Check out code
uses: actions/checkout@v3
with:
repository: ${{ env.CHECKOUT_REPO }}
ref: ${{ env.CHECKOUT_REF }}
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
Expand All @@ -94,7 +103,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Checkout p repo to run tests.
- name: Checkout python-sdk repo to run tests.
uses: actions/checkout@v3
with:
repository: dapr/python-sdk
Expand All @@ -105,12 +114,12 @@ jobs:
run: |
dapr uninstall --all
dapr init
- name: Build and override daprd with HEAD.
- name: Build and override daprd
run: |
make
mkdir -p $HOME/.dapr/bin/
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
- name: Override placement service.
- name: Override placement service
run: |
docker stop dapr_placement
./dist/linux_amd64/release/placement --healthz-port 9091 &
Expand All @@ -127,7 +136,7 @@ jobs:
if: ${{ success() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-python
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
Expand All @@ -137,7 +146,7 @@ jobs:
if: ${{ failure() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-python
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
Expand All @@ -149,7 +158,7 @@ jobs:
if: ${{ cancelled() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-python
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
Expand Down Expand Up @@ -199,7 +208,7 @@ jobs:
if: env.PR_NUMBER != ''
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-java
number: ${{ env.PR_NUMBER }}
hide: true
hide_classify: OUTDATED
Expand All @@ -210,15 +219,19 @@ jobs:
🔗 **[Link to Action run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})**
Commit ref: ${{ env.CHECKOUT_REF }}
- uses: actions/checkout@v3
- name: Check out code
uses: actions/checkout@v3
with:
repository: ${{ env.CHECKOUT_REPO }}
ref: ${{ env.CHECKOUT_REF }}
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ env.JDK_VER }}
- name: "Set up Go"
id: setup-go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Checkout java-sdk repo to run tests.
Expand All @@ -232,12 +245,12 @@ jobs:
run: |
dapr uninstall --all
dapr init
- name: Build and override daprd with HEAD.
- name: Build and override daprd
run: |
make
mkdir -p $HOME/.dapr/bin/
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
- name: Override placement service.
- name: Override placement service
run: |
docker stop dapr_placement
./dist/linux_amd64/release/placement &
Expand Down Expand Up @@ -284,7 +297,7 @@ jobs:
if: ${{ success() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-java
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
Expand All @@ -294,7 +307,7 @@ jobs:
if: ${{ failure() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-java
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
Expand All @@ -306,11 +319,141 @@ jobs:
if: ${{ cancelled() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}
header: ${{ github.run_id }}-java
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
message: |
## ⚠️ Java SDK tests cancelled
The Action has been canceled
js-sdk:
if: |
github.event_name == 'schedule' ||
( github.event_name == 'repository_dispatch' &&
(
github.event.action == 'test-sdk-all' ||
github.event.action == 'test-sdk-js'
)
)
name: "JS SDK verification tests"
runs-on: ubuntu-latest
env:
NODE_VER: 18
steps:
- name: Set up for scheduled test
if: github.event_name != 'repository_dispatch'
run: |
echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV
echo "CHECKOUT_REF=refs/heads/master" >> $GITHUB_ENV
shell: bash
- name: Parse test payload
if: github.event_name == 'repository_dispatch'
uses: actions/[email protected]
with:
github-token: ${{secrets.DAPR_BOT_TOKEN}}
script: |
const testPayload = context.payload.client_payload;
if (testPayload) {
var fs = require('fs');
// Set environment variables
fs.appendFileSync(process.env.GITHUB_ENV,
`CHECKOUT_REPO=${testPayload.pull_head_repo}\n`+
`CHECKOUT_REF=${testPayload.pull_head_ref}\n`+
`PR_NUMBER=${testPayload.issue.number}`
);
}
- name: Create PR comment
if: env.PR_NUMBER != ''
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}-js
number: ${{ env.PR_NUMBER }}
hide: true
hide_classify: OUTDATED
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
message: |
# Dapr SDK JS test
🔗 **[Link to Action run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})**
Commit ref: ${{ env.CHECKOUT_REF }}
- name: Check out code
uses: actions/checkout@v3
with:
repository: ${{ env.CHECKOUT_REPO }}
ref: ${{ env.CHECKOUT_REF }}
- name: NodeJS - Install
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: "Set up Go"
id: setup-go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Checkout js-sdk repo to run tests.
uses: actions/checkout@v3
with:
repository: dapr/js-sdk
path: js-sdk
- name: Set up Dapr CLI
run: wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash -s
- name: Initialize Dapr runtime
run: |
dapr uninstall --all
dapr init
- name: Build and override daprd
run: |
make
mkdir -p $HOME/.dapr/bin/
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
- name: Override placement service
run: |
docker stop dapr_placement
./dist/linux_amd64/release/placement --healthz-port 9091 &
- name: Build Package
run: cd js-sdk && npm run build
- name: Run E2E tests
id: tests
run: cd js-sdk && npm run test:e2e:all
- name: Run E2E test to show successful TypeScript build
run: |
cd js-sdk test/e2e/typescript-build
npm install
dapr run --app-id typescript-build npm run start
- name: Update PR comment for success
if: ${{ success() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}-js
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
message: |
## ✅ JS SDK tests passed
- name: Update PR comment for failure
if: ${{ failure() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}-js
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
message: |
## ❌ JS SDK tests failed
Please check the logs for details on the error.
- name: Update PR comment for cancellation
if: ${{ cancelled() }}
uses: artursouza/[email protected]
with:
header: ${{ github.run_id }}-js
number: ${{ env.PR_NUMBER }}
append: true
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
message: |
## ⚠️ JS SDK tests cancelled
The Action has been canceled
27 changes: 27 additions & 0 deletions cmd/daprd/components/binding_kitex.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//go:build !(linux && arm) && all_components
// +build !linux !arm
// +build all_components

/*
Copyright 2023 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.
*/

package components

import (
"github.com/dapr/components-contrib/bindings/kitex"
bindingsLoader "github.com/dapr/dapr/pkg/components/bindings"
)

func init() {
bindingsLoader.DefaultRegistry.RegisterOutputBinding(kitex.NewKitexOutput, "kitex")
}
10 changes: 10 additions & 0 deletions dapr/proto/components/v1/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,13 @@ message SetRequest {
// reserved for future-proof extensibility
message SetResponse {}

message BulkDeleteRequestOptions {
int64 parallelism = 1;
}

message BulkDeleteRequest {
repeated DeleteRequest items = 1;
BulkDeleteRequestOptions options = 2;
}

// reserved for future-proof extensibility
Expand Down Expand Up @@ -271,8 +276,13 @@ message BulkGetResponse {
repeated BulkStateItem items = 1;
}

message BulkSetRequestOptions {
int64 parallelism = 1;
}

message BulkSetRequest {
repeated SetRequest items = 1;
BulkSetRequestOptions options = 2;
}

// reserved for future-proof extensibility
Expand Down
Loading

0 comments on commit ddd11bc

Please sign in to comment.