-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf21e85
commit 9b5c523
Showing
19 changed files
with
707 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
.ci/tests/integration/cases/vpa-with-resource-unit-sink/manifests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
apiVersion: compute.functionmesh.io/v1alpha1 | ||
kind: Sink | ||
metadata: | ||
name: vpa-sink-sample | ||
spec: | ||
className: org.apache.pulsar.io.datagenerator.DataGeneratorPrintSink | ||
replicas: 1 | ||
sinkConfig: | ||
test: test | ||
input: | ||
topics: | ||
- persistent://public/default/input-vpa-sink-topic | ||
typeClassName: org.apache.pulsar.io.datagenerator.Person | ||
forwardSourceMessageProperty: true | ||
resources: | ||
limits: | ||
cpu: "0.2" | ||
memory: 1.1G | ||
requests: | ||
cpu: "0.1" | ||
memory: 1G | ||
pod: | ||
vpa: | ||
resourceUnit: | ||
cpu: 200m | ||
memory: 800Mi | ||
updatePolicy: | ||
updateMode: "Auto" | ||
resourcePolicy: | ||
containerPolicies: | ||
- containerName: "*" | ||
minAllowed: | ||
cpu: 200m | ||
memory: 100Mi | ||
maxAllowed: | ||
cpu: 1 | ||
memory: 1000Mi | ||
pulsar: | ||
pulsarConfig: "test-sink" | ||
tlsConfig: | ||
enabled: false | ||
allowInsecure: false | ||
hostnameVerification: true | ||
certSecretName: sn-platform-tls-broker | ||
certSecretKey: "" | ||
image: streamnative/pulsar-io-data-generator:3.2.2.1 | ||
java: | ||
jar: connectors/pulsar-io-data-generator-3.2.2.1.nar | ||
clusterName: test-pulsar | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-sink | ||
data: | ||
webServiceURL: http://sn-platform-pulsar-broker.default.svc.cluster.local:8080 | ||
brokerServiceURL: pulsar://sn-platform-pulsar-broker.default.svc.cluster.local:6650 |
50 changes: 50 additions & 0 deletions
50
.ci/tests/integration/cases/vpa-with-resource-unit-sink/verify.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you 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. | ||
# | ||
|
||
set -e | ||
|
||
E2E_DIR=$(dirname "$0") | ||
BASE_DIR=$(cd "${E2E_DIR}"/../../../../..;pwd) | ||
PULSAR_NAMESPACE=${PULSAR_NAMESPACE:-"default"} | ||
PULSAR_RELEASE_NAME=${PULSAR_RELEASE_NAME:-"sn-platform"} | ||
E2E_KUBECONFIG=${E2E_KUBECONFIG:-"/tmp/e2e-k8s.config"} | ||
|
||
source "${BASE_DIR}"/.ci/helm.sh | ||
|
||
if [ ! "$KUBECONFIG" ]; then | ||
export KUBECONFIG=${E2E_KUBECONFIG} | ||
fi | ||
|
||
kubectl apply -f "${BASE_DIR}"/.ci/tests/integration/cases/vpa-with-resource-unit-sink/manifests.yaml > /dev/null 2>&1 | ||
|
||
verify_fm_result=$(ci::verify_function_mesh vpa-sink-sample 2>&1) | ||
if [ $? -ne 0 ]; then | ||
echo "$verify_fm_result" | ||
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration/cases/vpa-with-resource-unit-sink/manifests.yaml > /dev/null 2>&1 || true | ||
exit 1 | ||
fi | ||
|
||
verify_java_result=$(NAMESPACE=${PULSAR_NAMESPACE} CLUSTER=${PULSAR_RELEASE_NAME} ci::verify_vpa_with_resource_unit vpa-sink-sample sink 2>&1) | ||
if [ $? -eq 0 ]; then | ||
echo "e2e-test: ok" | yq eval - | ||
else | ||
echo "$verify_java_result" | ||
fi | ||
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration/cases/vpa-with-resource-unit-sink/manifests.yaml > /dev/null 2>&1 || true |
60 changes: 60 additions & 0 deletions
60
.ci/tests/integration/cases/vpa-with-resource-unit-source/manifests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: compute.functionmesh.io/v1alpha1 | ||
kind: Source | ||
metadata: | ||
name: vpa-source-sample | ||
spec: | ||
className: org.apache.pulsar.io.datagenerator.DataGeneratorSource | ||
replicas: 1 | ||
output: | ||
producerConf: | ||
maxPendingMessages: 1000 | ||
maxPendingMessagesAcrossPartitions: 50000 | ||
useThreadLocalProducers: true | ||
topic: persistent://public/default/output-vpa-source-topic | ||
typeClassName: org.apache.pulsar.io.datagenerator.Person | ||
forwardSourceMessageProperty: true | ||
sourceConfig: | ||
test: test | ||
resources: | ||
limits: | ||
cpu: "0.2" | ||
memory: 1.1G | ||
requests: | ||
cpu: "0.1" | ||
memory: 1G | ||
pod: | ||
vpa: | ||
resourceUnit: | ||
cpu: 200m | ||
memory: 800Mi | ||
updatePolicy: | ||
updateMode: "Auto" | ||
resourcePolicy: | ||
containerPolicies: | ||
- containerName: "*" | ||
minAllowed: | ||
cpu: 200m | ||
memory: 100Mi | ||
maxAllowed: | ||
cpu: 1 | ||
memory: 1000Mi | ||
pulsar: | ||
pulsarConfig: "test-source" | ||
tlsConfig: | ||
enabled: false | ||
allowInsecure: false | ||
hostnameVerification: true | ||
certSecretName: sn-platform-tls-broker | ||
certSecretKey: "" | ||
image: streamnative/pulsar-io-data-generator:3.2.2.1 | ||
java: | ||
jar: connectors/pulsar-io-data-generator-3.2.2.1.nar | ||
clusterName: test-pulsar | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-source | ||
data: | ||
webServiceURL: http://sn-platform-pulsar-broker.default.svc.cluster.local:8080 | ||
brokerServiceURL: pulsar://sn-platform-pulsar-broker.default.svc.cluster.local:6650 |
50 changes: 50 additions & 0 deletions
50
.ci/tests/integration/cases/vpa-with-resource-unit-source/verify.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you 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. | ||
# | ||
|
||
set -e | ||
|
||
E2E_DIR=$(dirname "$0") | ||
BASE_DIR=$(cd "${E2E_DIR}"/../../../../..;pwd) | ||
PULSAR_NAMESPACE=${PULSAR_NAMESPACE:-"default"} | ||
PULSAR_RELEASE_NAME=${PULSAR_RELEASE_NAME:-"sn-platform"} | ||
E2E_KUBECONFIG=${E2E_KUBECONFIG:-"/tmp/e2e-k8s.config"} | ||
|
||
source "${BASE_DIR}"/.ci/helm.sh | ||
|
||
if [ ! "$KUBECONFIG" ]; then | ||
export KUBECONFIG=${E2E_KUBECONFIG} | ||
fi | ||
|
||
kubectl apply -f "${BASE_DIR}"/.ci/tests/integration/cases/vpa-with-resource-unit-source/manifests.yaml > /dev/null 2>&1 | ||
|
||
verify_fm_result=$(ci::verify_function_mesh vpa-source-sample 2>&1) | ||
if [ $? -ne 0 ]; then | ||
echo "$verify_fm_result" | ||
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration/cases/vpa-with-resource-unit-source/manifests.yaml > /dev/null 2>&1 || true | ||
exit 1 | ||
fi | ||
|
||
verify_java_result=$(NAMESPACE=${PULSAR_NAMESPACE} CLUSTER=${PULSAR_RELEASE_NAME} ci::verify_vpa_with_resource_unit vpa-source-sample source 2>&1) | ||
if [ $? -eq 0 ]; then | ||
echo "e2e-test: ok" | yq eval - | ||
else | ||
echo "$verify_java_result" | ||
fi | ||
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration/cases/vpa-with-resource-unit-source/manifests.yaml > /dev/null 2>&1 || true |
Oops, something went wrong.