Skip to content
This repository was archived by the owner on Jun 19, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/201-channelable-manipulator-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: events-channel-addressable-resolver
name: cloud-run-events-channel-manipulator
labels:
events.cloud.run/release: devel
duck.knative.dev/channelable: "true"
Expand Down
1 change: 1 addition & 0 deletions pkg/pubsub/publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (a *Publisher) Start(ctx context.Context) error {
}

func (a *Publisher) receive(ctx context.Context, event cloudevents.Event, resp *cloudevents.EventResponse) error {

// Upgrade to supported transport version.
if event.SpecVersion() != cloudevents.VersionV03 {
event.Context = event.Context.AsV03()
Expand Down
124 changes: 124 additions & 0 deletions test/performance/channel-latency/channel-latency-setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Copyright 2019 The Knative 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.

# Copy google-cloud-key secret one-liner:
# kubectl get secret google-cloud-key --namespace=default --export -o yaml | kubectl apply --namespace=perf-pubsub -f -

# apiVersion: v1
# kind: Namespace
# metadata:
# name: perf-pubsub

---

apiVersion: v1
kind: ConfigMap
metadata:
name: config-mako
namespace: perf-pubsub
data:
environment: dev

---

apiVersion: messaging.cloud.run/v1alpha1
kind: Channel
metadata:
name: test-channel
namespace: perf-pubsub
spec: {}

---

# apiVersion: messaging.knative.dev/v1alpha1
# kind: Subscription
# metadata:
# name: test-channel
# namespace: perf-pubsub
# spec:
# channel:
# apiVersion: messaging.cloud.run/v1alpha1
# kind: Channel
# name: test-channel
# subscriber:
# ref:
# apiVersion: v1
# kind: Service
# name: latency-consumer

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: perf-pubsub
namespace: perf-pubsub

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: perf-pubsub
rules:
- apiGroups: [""]
resources: ["nodes", "pods"]
verbs: ["list"]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: perf-pubsub
subjects:
- kind: ServiceAccount
name: perf-pubsub
namespace: perf-pubsub
roleRef:
kind: ClusterRole
name: perf-pubsub
apiGroup: rbac.authorization.k8s.io

---

apiVersion: v1
kind: Service
metadata:
name: latency-consumer
namespace: perf-pubsub
spec:
selector:
role: latency-consumer
ports:
- name: http
port: 80
targetPort: cloudevents
protocol: TCP

---

apiVersion: v1
kind: Service
metadata:
name: latency-aggregator
namespace: perf-pubsub
spec:
selector:
role: latency-aggregator
ports:
- name: grpc
port: 10000
targetPort: grpc
protocol: TCP
117 changes: 117 additions & 0 deletions test/performance/channel-latency/channel-latency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright 2019 The Knative 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.

apiVersion: messaging.knative.dev/v1alpha1
kind: Subscription
metadata:
name: test-channel
namespace: perf-pubsub
spec:
channel:
apiVersion: messaging.cloud.run/v1alpha1
kind: Channel
name: test-channel
subscriber:
ref:
apiVersion: v1
kind: Service
name: latency-consumer

---

apiVersion: batch/v1
kind: Job
metadata:
name: latency-send-receive
namespace: perf-pubsub
labels:
role: latency-consumer
spec:
completions: 1
parallelism: 1
backoffLimit: 0
template:
metadata:
labels:
role: latency-consumer
spec:
serviceAccountName: perf-pubsub
restartPolicy: Never
containers:
- name: sender-receiver
image: knative.dev/eventing/test/test_images/latencymako
args:
- "--role=sender-receiver"
- "--sink=http://cre-test-channel-chan-publish.perf-pubsub.svc.cluster.local"
- "--aggregator=latency-aggregator:10000"
- "--pace=100:10,200:20,400:60"
- "--verbose"
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 1000m
memory: 2Gi
ports:
- name: cloudevents
containerPort: 8080

---

apiVersion: v1
kind: Pod
metadata:
name: latency-aggregator
namespace: perf-pubsub
labels:
role: latency-aggregator
spec:
serviceAccountName: perf-pubsub
restartPolicy: Never
containers:
- name: aggregator
image: knative.dev/eventing/test/test_images/latencymako
args:
- "--role=aggregator"
# set to the number of sender-receiver
- "--expect-records=1"
- "--verbose"
ports:
- name: grpc
containerPort: 10000
resources:
requests:
cpu: 1000m
memory: 2Gi
volumeMounts:
- name: config-mako
mountPath: /etc/config-mako
terminationMessagePolicy: FallbackToLogsOnError
- name: mako-stub
image: knative.dev/pkg/test/mako/stub-sidecar
ports:
- name: quickstore
containerPort: 9813
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- name: config-mako
configMap:
name: config-mako

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.