Skip to content

Commit

Permalink
Merge branch 'master' into grpc-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ItalyPaleAle authored Nov 15, 2022
2 parents 70391ce + 0aab2ca commit 3626a93
Show file tree
Hide file tree
Showing 59 changed files with 934 additions and 470 deletions.
2 changes: 1 addition & 1 deletion .build-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The CLI is written in Go and based on the [cobra](https://github.com/spf13/cobra

You have two ways to run the CLI:

1. Within the `build-tools` directly, you can run the CLI with `go run .` directly. For example `go run . help` shows the help page.
1. Within the `build-tools` directly, you can run the CLI with `go run .` directly. For example `go run . help` shows the help page. Make sure that `GOOS` and `GOARCH` are set to the correct values for your system.
2. You can build a pre-compiled binary by running `make compile-build-tools` in the root folder of this repository. This will build an executable called `build-tools` (or `build-tools.exe` on Windows) in the `build-tools` folder. You can then run the command directly, for example `./build-tools help`

## Available commands
Expand Down
4 changes: 2 additions & 2 deletions .build-tools/cmd/zz-e2e-perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func getCmdE2EPerf(cmdType string) *cobra.Command {

// Base command
cmd := &cobra.Command{
Use: fmt.Sprintf("%s", cmdType),
Use: cmdType,
Short: fmt.Sprintf("Build and push %s test apps", cmdType),
Long: fmt.Sprintf(`Tools to build %s test apps, including building and pushing Docker containers.`, cmdType),
}
Expand Down Expand Up @@ -411,7 +411,7 @@ func (c *cmdE2EPerf) getIncludes() []string {
func hashFilesInDir(basePath string, ignores *gitignore.GitIgnore) ([]string, error) {
files := []string{}

err := filepath.WalkDir(basePath, func(path string, d fs.DirEntry, err error) error {
err := filepath.WalkDir(basePath, func(path string, d fs.DirEntry, _ error) error {
// Check if the file is ignored
relPath, err := filepath.Rel(basePath, path)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dapr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
GOVER: "^1.19.2"
GOLANGCILINT_VER: v1.48.0
GOLANGCILINT_VER: v1.50.1
PROTOC_VERSION: "21.1"
GOOS: ${{ matrix.target_os }}
GOARCH: ${{ matrix.target_arch }}
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ linters:
enable-all: true
disable:
# TODO Enforce the below linters later
- nosnakecase
- dupl
- errcheck
- funlen
Expand Down Expand Up @@ -281,3 +282,5 @@ linters:
- rowserrcheck
- sqlclosecheck
- structcheck
- varcheck
- deadcode
16 changes: 3 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,7 @@ ifeq ($(TARGET_OS_LOCAL),windows)
else
BUILD_TOOLS_BIN ?= build-tools
BUILD_TOOLS ?= ./.build-tools/$(BUILD_TOOLS_BIN)
RUN_BUILD_TOOLS ?= cd .build-tools; go run .
endif

ifeq ($(TARGET_OS_LOCAL),windows)
BUILD_TOOLS_BIN ?= build-tools.exe
BUILD_TOOLS ?= ./.build-tools/$(BUILD_TOOLS_BIN)
RUN_BUILD_TOOLS ?= cd .build-tools; go.exe run .
else
BUILD_TOOLS_BIN ?= build-tools
BUILD_TOOLS ?= ./.build-tools/$(BUILD_TOOLS_BIN)
RUN_BUILD_TOOLS ?= cd .build-tools; go run .
RUN_BUILD_TOOLS ?= cd .build-tools; GOOS=$(TARGET_OS_LOCAL) GOARCH=$(TARGET_ARCH_LOCAL) go run .
endif

# Default docker container and e2e test targst.
Expand Down Expand Up @@ -328,8 +318,8 @@ test-race:
################################################################################
# Target: lint #
################################################################################
# Please use golangci-lint version v1.48.0 , otherwise you might encounter errors.
# You can download version v1.48.0 at https://github.com/golangci/golangci-lint/releases/tag/v1.48.0
# Please use golangci-lint version v1.50.1 , otherwise you might encounter errors.
# You can download version v1.50.1 at https://github.com/golangci/golangci-lint/releases/tag/v1.50.1
.PHONY: lint
lint:
$(GOLANGCI_LINT) run --timeout=20m
Expand Down
3 changes: 2 additions & 1 deletion charts/dapr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ The Helm chart has the follow configuration options that can be supplied:
| `global.daprControlPlaneArch` | CPU Architecture for Dapr control plane | `amd64` |
| `global.nodeSelector` | Pods will be scheduled onto a node node whose labels match the nodeSelector | `{}` |
| `global.tolerations` | Pods will be allowed to schedule onto a node whose taints match the tolerations | `{}` |
| `global.labels` | Custom pod levels | `{}` |
| `global.labels` | Custom pod labels | `{}` |
| `global.k8sLabels` | Custom metadata labels | `{}` |

### Dapr Dashboard options:
| Parameter | Description | Default |
Expand Down
30 changes: 30 additions & 0 deletions cmd/daprd/components/binding_kubemq.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
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.
*/

package components

import (
"github.com/dapr/components-contrib/bindings"
"github.com/dapr/components-contrib/bindings/kubemq"
bindingsLoader "github.com/dapr/dapr/pkg/components/bindings"
"github.com/dapr/kit/logger"
)

func init() {
bindingsLoader.DefaultRegistry.RegisterInputBinding(func(l logger.Logger) bindings.InputBinding {
return kubemq.NewKubeMQ(l)
}, "kubemq")
bindingsLoader.DefaultRegistry.RegisterOutputBinding(func(l logger.Logger) bindings.OutputBinding {
return kubemq.NewKubeMQ(l)
}, "kubemq")
}
23 changes: 23 additions & 0 deletions cmd/daprd/components/pubsub_kubemq.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
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.
*/

package components

import (
"github.com/dapr/components-contrib/pubsub/kubemq"
pubsubLoader "github.com/dapr/dapr/pkg/components/pubsub"
)

func init() {
pubsubLoader.DefaultRegistry.RegisterComponent(kubemq.NewKubeMQ, "kubemq")
}
4 changes: 4 additions & 0 deletions dapr/proto/runtime/v1/appcallback.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package dapr.proto.runtime.v1;

import "google/protobuf/empty.proto";
import "dapr/proto/common/v1/common.proto";
import "google/protobuf/struct.proto";

option csharp_namespace = "Dapr.AppCallback.Autogen.Grpc.v1";
option java_outer_classname = "DaprAppCallbackProtos";
Expand Down Expand Up @@ -96,6 +97,9 @@ message TopicEventRequest {
// The matching path from TopicSubscription/routes (if specified) for this event.
// This value is used by OnTopicEvent to "switch" inside the handler.
string path = 9;

// The map of additional custom properties to be sent to the app. These are considered to be cloud event extensions.
google.protobuf.Struct extensions = 10;
}

// TopicEventResponse is response from app on published message
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/go/.devcontainer/base.Dockerfile

# [Choice] Go version: 1, 1.18, etc
ARG GOVERSION=1.18
# [Choice] Go version: 1, 1.19, etc
ARG GOVERSION=1.19
FROM golang:${GOVERSION}-bullseye

# [Option] Install zsh
Expand All @@ -15,7 +15,7 @@ ARG DAPR_CLI_VERSION="latest"
ARG PROTOC_VERSION="21.1"
ARG PROTOC_GEN_GO_VERSION="1.28"
ARG PROTOC_GEN_GO_GRPC_VERSION="1.2"
ARG GOLANGCI_LINT_VERSION="1.45.2"
ARG GOLANGCI_LINT_VERSION="1.50.1"

# This Dockerfile adds a non-root 'dapr' user with sudo access. However, for Linux,
# this user's GID/UID must match your local user UID/GID to avoid permission issues
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This includes dockerfiles to build Dapr release and debug images and development

The Dev Container can be rebuilt with custom options. Relevant args (and their default values) include:

* `GOVERSION` (default: `1.18`)
* `GOVERSION` (default: `1.19`)
* `INSTALL_ZSH` (default: `true`)
* `KUBECTL_VERSION` (default: `latest`)
* `HELM_VERSION` (default: `latest`)
Expand Down
2 changes: 1 addition & 1 deletion docs/development/developing-dapr.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This command will:
- format, test and lint all the code
- check if you forgot to `git commit` something

Note: To run linter locally, please use golangci-lint version v1.45.2, otherwise you might encounter errors. You can download version v1.45.2 [here](https://github.com/golangci/golangci-lint/releases/tag/v1.45.2).
Note: To run linter locally, please use golangci-lint version v1.50.1, otherwise you might encounter errors. You can download version v1.50.1 [here](https://github.com/golangci/golangci-lint/releases/tag/v1.50.1).

## Debug Dapr

Expand Down
4 changes: 2 additions & 2 deletions docs/development/setup-dapr-development-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ This document helps you get started developing Dapr. If you find any problems wh
## Go (Golang)
1. Download and install [Go 1.18 or later](https://golang.org/doc/install#tarball).
1. Download and install [Go 1.19 or later](https://golang.org/doc/install#tarball).
2. Install [Delve](https://github.com/go-delve/delve/tree/master/Documentation/installation) for Go debugging, if desired.
3. Install [golangci-lint](https://golangci-lint.run/usage/install) version 1.45.2.
3. Install [golangci-lint](https://golangci-lint.run/usage/install) version 1.50.1.
## Setup a Kubernetes development environment
Expand Down
18 changes: 10 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/PuerkitoBio/purell v1.2.0
github.com/benbjohnson/clock v1.3.0
github.com/cenkalti/backoff/v4 v4.1.3
github.com/dapr/components-contrib v1.9.1-0.20221104030348-f96873428ed5
github.com/dapr/components-contrib v1.9.1-0.20221111215803-c92827c3defc
github.com/dapr/kit v0.0.3-0.20221102045011-c213121f0b4f
github.com/fasthttp/router v1.4.12
github.com/ghodss/yaml v1.0.0
Expand Down Expand Up @@ -66,6 +66,7 @@ require (
k8s.io/code-generator v0.25.3
k8s.io/klog v1.0.0
k8s.io/metrics v0.25.3
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85
sigs.k8s.io/controller-runtime v0.13.0
)

Expand Down Expand Up @@ -117,7 +118,6 @@ require (
github.com/aerospike/aerospike-client-go v4.5.2+incompatible // indirect
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/agrea/ptr v0.0.0-20180711073057-77a518d99b7b // indirect
github.com/alibaba/sentinel-golang v1.0.4 // indirect
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
github.com/alibabacloud-go/darabonba-openapi v0.2.1 // indirect
Expand Down Expand Up @@ -196,6 +196,7 @@ require (
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.11.0 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gocql/gocql v1.2.1 // indirect
Expand All @@ -216,15 +217,15 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
github.com/googleapis/gax-go/v2 v2.6.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grandcat/zeroconf v1.0.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/consul/api v1.13.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
Expand Down Expand Up @@ -254,6 +255,8 @@ require (
github.com/k0kubun/pp v3.0.1+incompatible // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/knadh/koanf v1.4.1 // indirect
github.com/kubemq-io/kubemq-go v1.7.6 // indirect
github.com/kubemq-io/protobuf v1.3.1 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/labd/commercetools-go-sdk v1.1.0 // indirect
github.com/labstack/echo/v4 v4.9.0 // indirect
Expand Down Expand Up @@ -283,7 +286,7 @@ require (
github.com/mtibben/percent v0.2.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/nats-io/nats.go v1.19.0 // indirect
github.com/nats-io/nats.go v1.19.1 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nats-io/stan.go v0.10.3 // indirect
Expand All @@ -292,7 +295,7 @@ require (
github.com/openzipkin/zipkin-go v0.4.1 // indirect
github.com/oracle/oci-go-sdk/v54 v54.0.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
Expand All @@ -315,7 +318,7 @@ require (
github.com/sijms/go-ora/v2 v2.5.3 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cobra v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stathat/consistent v1.0.0 // indirect
Expand Down Expand Up @@ -379,7 +382,6 @@ require (
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
Expand Down
Loading

0 comments on commit 3626a93

Please sign in to comment.