Skip to content

Commit a85b813

Browse files
authored
Merge branch 'master' into fix-perfsprint-linter-error
2 parents 42b93ea + 29f8962 commit a85b813

File tree

23 files changed

+678
-206
lines changed

23 files changed

+678
-206
lines changed

.github/workflows/kind_e2e.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
name: E2E tests for K8s (KinD)
5151
runs-on: ubuntu-latest
5252
env:
53-
DAPR_RUNTIME_PINNED_VERSION: 1.13.5
53+
DAPR_RUNTIME_PINNED_VERSION: 1.14.4
5454
DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
5555
DAPR_RUNTIME_LATEST_STABLE_VERSION:
5656
DAPR_DASHBOARD_LATEST_STABLE_VERSION:
@@ -173,6 +173,7 @@ jobs:
173173
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-kind.json
174174
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
175175
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
176+
export TEST_DAPR_HA_MODE=${{ matrix.mode }}
176177
make e2e-build-run-k8s
177178
shell: bash
178179
- name: Run tests with Docker hub
@@ -181,6 +182,7 @@ jobs:
181182
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-kind.json
182183
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
183184
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
185+
export TEST_DAPR_HA_MODE=${{ matrix.mode }}
184186
make e2e-build-run-k8s
185187
shell: bash
186188
- name: Upload test results

.github/workflows/self_hosted_e2e.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838
GOARCH: ${{ matrix.target_arch }}
3939
GOPROXY: https://proxy.golang.org
4040
ARCHIVE_OUTDIR: dist/archives
41-
DAPR_RUNTIME_PINNED_VERSION: "1.13.5"
41+
DAPR_RUNTIME_PINNED_VERSION: "1.14.4"
4242
DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
4343
DAPR_RUNTIME_LATEST_STABLE_VERSION: ""
4444
DAPR_DASHBOARD_LATEST_STABLE_VERSION: ""
4545
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: warn
46-
PODMAN_VERSION: 4.9.3
46+
PODMAN_VERSION: 5.4.0
4747
strategy:
4848
# TODO: Remove this when our E2E tests are stable for podman on MacOS.
4949
fail-fast: false # Keep running if one leg fails.
@@ -90,9 +90,10 @@ jobs:
9090
9191
# Start podman machine
9292
sudo podman-mac-helper install
93-
podman machine init -v $HOME:$HOME
93+
podman machine init -v $HOME:$HOME --memory 16384 --cpus 12
9494
podman machine start --log-level debug
9595
podman machine ssh sudo sysctl -w kernel.keys.maxkeys=20000
96+
podman info
9697
echo "CONTAINER_RUNTIME=podman" >> $GITHUB_ENV
9798
- name: Determine latest Dapr Runtime version including Pre-releases
9899
if: github.base_ref == 'master'

.github/workflows/upgrade_e2e.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ jobs:
137137
run: |
138138
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-upgrade-kind.json
139139
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
140+
export TEST_DAPR_HA_MODE=${{ matrix.mode }}
140141
make e2e-build-run-upgrade
141142
142143
- name: Run tests with Docker hub
143144
if: github.event.schedule != '0 */6 * * *'
144145
run: |
145146
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-upgrade-kind.json
146147
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
148+
export TEST_DAPR_HA_MODE=${{ matrix.mode }}
147149
make e2e-build-run-upgrade
148150
149151
- name: Upload test results

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ e2e-build-run-k8s: build test-e2e-k8s
174174
################################################################################
175175
.PHONY: test-e2e-upgrade
176176
test-e2e-upgrade: test-deps
177-
gotestsum --jsonfile $(TEST_OUTPUT_FILE) --format standard-verbose -- -timeout 40m -count=1 -tags=e2e ./tests/e2e/upgrade/...
177+
gotestsum --jsonfile $(TEST_OUTPUT_FILE) --format standard-verbose -- -timeout 60m -count=1 -tags=e2e ./tests/e2e/upgrade/...
178178

179179
################################################################################
180180
# Build, E2E Tests for Kubernetes Upgrade #

cmd/annotate.go

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import (
2121
"net/url"
2222
"os"
2323
"path/filepath"
24+
"strconv"
25+
26+
"github.com/dapr/dapr/pkg/runtime"
27+
28+
"k8s.io/apimachinery/pkg/api/resource"
2429

2530
"github.com/spf13/cobra"
2631

@@ -60,8 +65,8 @@ var (
6065
annotateReadinessProbeThreshold int
6166
annotateDaprImage string
6267
annotateAppSSL bool
63-
annotateMaxRequestBodySize int
64-
annotateReadBufferSize int
68+
annotateMaxRequestBodySize string
69+
annotateReadBufferSize string
6570
annotateHTTPStreamRequestBody bool
6671
annotateGracefulShutdownSeconds int
6772
annotateEnableAPILogging bool
@@ -318,12 +323,23 @@ func getOptionsFromFlags() kubernetes.AnnotateOptions {
318323
if annotateAppSSL {
319324
o = append(o, kubernetes.WithAppSSL())
320325
}
321-
if annotateMaxRequestBodySize != -1 {
322-
o = append(o, kubernetes.WithMaxRequestBodySize(annotateMaxRequestBodySize))
326+
if annotateMaxRequestBodySize != "-1" {
327+
if q, err := resource.ParseQuantity(annotateMaxRequestBodySize); err != nil {
328+
print.FailureStatusEvent(os.Stderr, "error parsing value of max-body-size: %s, error: %s", annotateMaxRequestBodySize, err.Error())
329+
os.Exit(1)
330+
} else {
331+
o = append(o, kubernetes.WithMaxRequestBodySize(int(q.Value())))
332+
}
323333
}
324-
if annotateReadBufferSize != -1 {
325-
o = append(o, kubernetes.WithReadBufferSize(annotateReadBufferSize))
334+
if annotateReadBufferSize != "-1" {
335+
if q, err := resource.ParseQuantity(annotateReadBufferSize); err != nil {
336+
print.FailureStatusEvent(os.Stderr, "error parsing value of read-buffer-size: %s, error: %s", annotateMaxRequestBodySize, err.Error())
337+
os.Exit(1)
338+
} else {
339+
o = append(o, kubernetes.WithReadBufferSize(int(q.Value())))
340+
}
326341
}
342+
327343
if annotateHTTPStreamRequestBody {
328344
o = append(o, kubernetes.WithHTTPStreamRequestBody())
329345
}
@@ -385,8 +401,8 @@ func init() {
385401
AnnotateCmd.Flags().StringVar(&annotateDaprImage, "dapr-image", "", "The image to use for the dapr sidecar container")
386402
AnnotateCmd.Flags().BoolVar(&annotateAppSSL, "app-ssl", false, "Enable SSL for the app")
387403
AnnotateCmd.Flags().MarkDeprecated("app-ssl", "This flag is deprecated and will be removed in a future release. Use \"app-protocol\" flag with https or grpcs instead")
388-
AnnotateCmd.Flags().IntVar(&annotateMaxRequestBodySize, "max-request-body-size", -1, "The maximum request body size to use")
389-
AnnotateCmd.Flags().IntVar(&annotateReadBufferSize, "http-read-buffer-size", -1, "The maximum size of HTTP header read buffer in kilobytes")
404+
AnnotateCmd.Flags().StringVar(&annotateMaxRequestBodySize, "max-body-size", strconv.Itoa(runtime.DefaultMaxRequestBodySize>>20)+"Mi", "The maximum request body size to use")
405+
AnnotateCmd.Flags().StringVar(&annotateReadBufferSize, "read-buffer-size", strconv.Itoa(runtime.DefaultReadBufferSize>>10)+"Ki", "The maximum size of HTTP header read buffer in kilobytes")
390406
AnnotateCmd.Flags().BoolVar(&annotateHTTPStreamRequestBody, "http-stream-request-body", false, "Enable streaming request body for HTTP")
391407
AnnotateCmd.Flags().IntVar(&annotateGracefulShutdownSeconds, "graceful-shutdown-seconds", -1, "The number of seconds to wait for the app to shutdown")
392408
AnnotateCmd.Flags().BoolVar(&annotateEnableAPILogging, "enable-api-logging", false, "Enable API logging for the Dapr sidecar")

cmd/run.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929
"github.com/spf13/cobra"
3030
"github.com/spf13/viper"
3131

32+
daprRuntime "github.com/dapr/dapr/pkg/runtime"
33+
3234
"github.com/dapr/cli/pkg/kubernetes"
3335
"github.com/dapr/cli/pkg/metadata"
3436
"github.com/dapr/cli/pkg/print"
@@ -55,8 +57,8 @@ var (
5557
resourcesPaths []string
5658
appSSL bool
5759
metricsPort int
58-
maxRequestBodySize int
59-
readBufferSize int
60+
maxRequestBodySize string
61+
readBufferSize string
6062
unixDomainSocket string
6163
enableAppHealth bool
6264
appHealthPath string
@@ -473,8 +475,8 @@ func init() {
473475
RunCmd.Flags().MarkDeprecated("app-ssl", "This flag is deprecated and will be removed in the future releases. Use \"app-protocol\" flag with https or grpcs values instead")
474476
RunCmd.Flags().IntVarP(&metricsPort, "metrics-port", "M", -1, "The port of metrics on dapr")
475477
RunCmd.Flags().BoolP("help", "h", false, "Print this help message")
476-
RunCmd.Flags().IntVarP(&maxRequestBodySize, "dapr-http-max-request-size", "", -1, "Max size of request body in MB")
477-
RunCmd.Flags().IntVarP(&readBufferSize, "dapr-http-read-buffer-size", "", -1, "HTTP header read buffer in KB")
478+
RunCmd.Flags().StringVarP(&maxRequestBodySize, "max-body-size", "", strconv.Itoa(daprRuntime.DefaultMaxRequestBodySize>>20)+"Mi", "Max size of request body in MB")
479+
RunCmd.Flags().StringVarP(&readBufferSize, "read-buffer-size", "", strconv.Itoa(daprRuntime.DefaultReadBufferSize>>10)+"Ki", "HTTP header read buffer in KB")
478480
RunCmd.Flags().StringVarP(&unixDomainSocket, "unix-domain-socket", "u", "", "Path to a unix domain socket dir. If specified, Dapr API servers will use Unix Domain Sockets")
479481
RunCmd.Flags().BoolVar(&enableAppHealth, "enable-app-health-check", false, "Enable health checks for the application using the protocol defined with app-protocol")
480482
RunCmd.Flags().StringVar(&appHealthPath, "app-health-check-path", "", "Path used for health checks; HTTP only")
@@ -508,6 +510,8 @@ func executeRun(runTemplateName, runFilePath string, apps []runfileconfig.App) (
508510
// Set defaults if zero value provided in config yaml.
509511
app.RunConfig.SetDefaultFromSchema()
510512

513+
app.RunConfig.SchedulerHostAddress = validateSchedulerHostAddress(daprVer.RuntimeVersion, app.RunConfig.SchedulerHostAddress)
514+
511515
// Validate validates the configs and modifies the ports to free ports, appId etc.
512516
err := app.RunConfig.Validate()
513517
if err != nil {
@@ -525,8 +529,6 @@ func executeRun(runTemplateName, runFilePath string, apps []runfileconfig.App) (
525529
break
526530
}
527531

528-
runConfig.SchedulerHostAddress = validateSchedulerHostAddress(daprVer.RuntimeVersion, runConfig.SchedulerHostAddress)
529-
530532
// Combined multiwriter for logs.
531533
var appDaprdWriter io.Writer
532534
// appLogWriter is used when app command is present.
@@ -672,7 +674,7 @@ func validateSchedulerHostAddress(version, address string) string {
672674
// If no SchedulerHostAddress is supplied, set it to default value.
673675
if semver.Compare(fmt.Sprintf("v%v", version), "v1.15.0-rc.0") == 1 {
674676
if address == "" {
675-
return "localhost:50006"
677+
return "localhost"
676678
}
677679
}
678680
return address

go.mod

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,27 @@ require (
2525
github.com/shirou/gopsutil v3.21.11+incompatible
2626
github.com/spf13/cobra v1.8.1
2727
github.com/spf13/viper v1.13.0
28-
github.com/stretchr/testify v1.9.0
28+
github.com/stretchr/testify v1.10.0
2929
golang.org/x/mod v0.22.0
3030
golang.org/x/sys v0.28.0
3131
gopkg.in/yaml.v2 v2.4.0
32-
helm.sh/helm/v3 v3.16.4
33-
k8s.io/api v0.31.3
34-
k8s.io/apiextensions-apiserver v0.31.3
35-
k8s.io/apimachinery v0.31.3
36-
k8s.io/cli-runtime v0.31.3
37-
k8s.io/client-go v0.31.3
32+
helm.sh/helm/v3 v3.17.1
33+
k8s.io/api v0.32.1
34+
k8s.io/apiextensions-apiserver v0.32.1
35+
k8s.io/apimachinery v0.32.1
36+
k8s.io/cli-runtime v0.32.1
37+
k8s.io/client-go v0.32.1
3838
k8s.io/helm v2.16.10+incompatible
3939
sigs.k8s.io/yaml v1.4.0
4040
)
4141

4242
require (
43+
cel.dev/expr v0.18.0 // indirect
4344
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
4445
dario.cat/mergo v1.0.1 // indirect
4546
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
4647
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
47-
github.com/BurntSushi/toml v1.3.2 // indirect
48+
github.com/BurntSushi/toml v1.4.0 // indirect
4849
github.com/Code-Hex/go-generics-cache v1.3.1 // indirect
4950
github.com/MakeNowJust/heredoc v1.0.0 // indirect
5051
github.com/Masterminds/goutils v1.1.1 // indirect
@@ -66,11 +67,11 @@ require (
6667
github.com/chebyrash/promise v0.0.0-20230709133807-42ec49ba1459 // indirect
6768
github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0 // indirect
6869
github.com/cloudevents/sdk-go/v2 v2.15.2 // indirect
69-
github.com/containerd/containerd v1.7.23 // indirect
70+
github.com/containerd/containerd v1.7.24 // indirect
7071
github.com/containerd/errdefs v0.3.0 // indirect
7172
github.com/containerd/log v0.1.0 // indirect
7273
github.com/containerd/platforms v0.2.1 // indirect
73-
github.com/cyphar/filepath-securejoin v0.3.4 // indirect
74+
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
7475
github.com/dapr/components-contrib v1.15.0-rc.1.0.20241216170750-aca5116d95c9 // indirect
7576
github.com/dapr/durabletask-go v0.5.1-0.20241216172832-16da3e7c3530 // indirect
7677
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@@ -85,7 +86,7 @@ require (
8586
github.com/docker/go-units v0.5.0 // indirect
8687
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
8788
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
88-
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
89+
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
8990
github.com/felixge/httpsnoop v1.0.4 // indirect
9091
github.com/fsnotify/fsnotify v1.7.0 // indirect
9192
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
@@ -99,16 +100,16 @@ require (
99100
github.com/go-logr/logr v1.4.2 // indirect
100101
github.com/go-logr/stdr v1.2.2 // indirect
101102
github.com/go-ole/go-ole v1.2.6 // indirect
102-
github.com/go-openapi/jsonpointer v0.20.0 // indirect
103+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
103104
github.com/go-openapi/jsonreference v0.20.2 // indirect
104-
github.com/go-openapi/swag v0.22.4 // indirect
105+
github.com/go-openapi/swag v0.23.0 // indirect
105106
github.com/gobwas/glob v0.2.3 // indirect
106107
github.com/goccy/go-json v0.10.2 // indirect
107108
github.com/gogo/protobuf v1.3.2 // indirect
108109
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
109110
github.com/golang/protobuf v1.5.4 // indirect
110111
github.com/google/btree v1.1.3 // indirect
111-
github.com/google/cel-go v0.20.1 // indirect
112+
github.com/google/cel-go v0.22.0 // indirect
112113
github.com/google/gnostic-models v0.6.8 // indirect
113114
github.com/google/go-cmp v0.6.0 // indirect
114115
github.com/google/gofuzz v1.2.0 // indirect
@@ -126,7 +127,6 @@ require (
126127
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
127128
github.com/hashicorp/hcl v1.0.0 // indirect
128129
github.com/huandu/xstrings v1.5.0 // indirect
129-
github.com/imdario/mergo v0.3.16 // indirect
130130
github.com/inconshreveable/mousetrap v1.1.0 // indirect
131131
github.com/jhump/protoreflect v1.15.3 // indirect
132132
github.com/jmoiron/sqlx v1.4.0 // indirect
@@ -154,7 +154,7 @@ require (
154154
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
155155
github.com/mitchellh/reflectwalk v1.0.2 // indirect
156156
github.com/moby/locker v1.0.1 // indirect
157-
github.com/moby/spdystream v0.4.0 // indirect
157+
github.com/moby/spdystream v0.5.0 // indirect
158158
github.com/moby/term v0.5.0 // indirect
159159
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
160160
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -176,7 +176,7 @@ require (
176176
github.com/prometheus/common v0.59.1 // indirect
177177
github.com/prometheus/procfs v0.15.1 // indirect
178178
github.com/prometheus/statsd_exporter v0.22.7 // indirect
179-
github.com/rubenv/sql-migrate v1.7.0 // indirect
179+
github.com/rubenv/sql-migrate v1.7.1 // indirect
180180
github.com/russross/blackfriday/v2 v2.1.0 // indirect
181181
github.com/segmentio/asm v1.2.0 // indirect
182182
github.com/shopspring/decimal v1.4.0 // indirect
@@ -188,7 +188,7 @@ require (
188188
github.com/spf13/jwalterweatherman v1.1.0 // indirect
189189
github.com/spf13/pflag v1.0.5 // indirect
190190
github.com/spiffe/go-spiffe/v2 v2.1.7 // indirect
191-
github.com/stoewer/go-strcase v1.2.0 // indirect
191+
github.com/stoewer/go-strcase v1.3.0 // indirect
192192
github.com/subosito/gotenv v1.4.1 // indirect
193193
github.com/tidwall/transform v0.0.0-20201103190739-32f242e2dbde // indirect
194194
github.com/tklauser/go-sysconf v0.3.12 // indirect
@@ -213,7 +213,6 @@ require (
213213
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
214214
go.opentelemetry.io/otel/trace v1.32.0 // indirect
215215
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
216-
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
217216
go.uber.org/multierr v1.11.0 // indirect
218217
golang.org/x/crypto v0.31.0 // indirect
219218
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d // indirect
@@ -222,7 +221,7 @@ require (
222221
golang.org/x/sync v0.10.0 // indirect
223222
golang.org/x/term v0.27.0 // indirect
224223
golang.org/x/text v0.21.0 // indirect
225-
golang.org/x/time v0.6.0 // indirect
224+
golang.org/x/time v0.7.0 // indirect
226225
google.golang.org/genproto/googleapis/api v0.0.0-20240924160255-9d4c2d233b61 // indirect
227226
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
228227
google.golang.org/grpc v1.68.1 // indirect
@@ -231,16 +230,16 @@ require (
231230
gopkg.in/inf.v0 v0.9.1 // indirect
232231
gopkg.in/ini.v1 v1.67.0 // indirect
233232
gopkg.in/yaml.v3 v3.0.1 // indirect
234-
k8s.io/apiserver v0.31.3 // indirect
235-
k8s.io/component-base v0.31.3 // indirect
233+
k8s.io/apiserver v0.32.1 // indirect
234+
k8s.io/component-base v0.32.1 // indirect
236235
k8s.io/klog/v2 v2.130.1 // indirect
237-
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
238-
k8s.io/kubectl v0.31.3 // indirect
239-
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 // indirect
236+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
237+
k8s.io/kubectl v0.32.1 // indirect
238+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
240239
oras.land/oras-go v1.2.5 // indirect
241240
sigs.k8s.io/controller-runtime v0.19.0 // indirect
242-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
243-
sigs.k8s.io/kustomize/api v0.17.2 // indirect
244-
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
245-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
241+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
242+
sigs.k8s.io/kustomize/api v0.18.0 // indirect
243+
sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
244+
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
246245
)

0 commit comments

Comments
 (0)