Skip to content

Commit 54fd235

Browse files
Install gcompat in java runner images (#761)
* Install gcompat in java runner images * Bump go to 1.22.4 * Fix oauth2 * Fix oauth2 settings * Disable legacy oauth2 params test case * Add testcase for google pubsub io * Set gsa credential * Set GSA credential * fix ci * print expected result
1 parent b7e21f1 commit 54fd235

File tree

26 files changed

+189
-52
lines changed

26 files changed

+189
-52
lines changed

.ci/clusters/values_skywalking_e2e_cluster_with_oauth.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ auth:
135135
enabled: true
136136
provider: "oauth2"
137137
oauth2:
138-
issuerUrl: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/
139-
issuerUrlParam: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0
140-
audience: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e
141-
audienceParam: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
142-
brokerClientCredential: '{"client_id":"CLIENT_ID","client_secret":"CLIENT_SECRET","issuer_url":"https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0"}'
143-
subjectClaim: appid
144-
adminScope: appid
145-
adminScopeParam: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
138+
issuerUrl: https://auth.sncloud-stg.dev/
139+
issuerUrlParam: https://auth.sncloud-stg.dev/
140+
audience: "urn:sn:pulsar:sndev:test"
141+
audienceParam: "urn:sn:pulsar:sndev:test"
142+
brokerClientCredential: '{"client_id":"CLIENT_ID","client_secret":"CLIENT_SECRET","issuer_url":"https://auth.sncloud-stg.dev/"}'
143+
subjectClaim: https://streamnative.io/username
144+
adminScope: https://streamnative.io/username
145+
adminScopeParam: ""
146146
authenticationProviders: io.streamnative.pulsar.broker.authentication.AuthenticationProviderOAuth

.ci/examples/connect/pubsub.nar

28 MB
Binary file not shown.

.ci/helm.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,4 +608,15 @@ function ci::verify_env() {
608608
return 0
609609
fi
610610
return 1
611+
}
612+
613+
function ci::verify_pod_log() {
614+
pod=$1
615+
log=$2
616+
sleep 30
617+
kubectl logs --tail=-1 $pod | grep "$log"
618+
while [[ $? -ne 0 ]]; do
619+
sleep 5
620+
kubectl logs --tail=-1 $pod | grep "$log"
621+
done
611622
}

.ci/tests/integration-oauth2/cases/batch-source/manifests.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ spec:
3737
certSecretKey: ""
3838
authConfig:
3939
oauth2Config:
40-
audience: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
41-
issuerUrl: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0
42-
scope: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
40+
audience: urn:sn:pulsar:sndev:test
41+
issuerUrl: https://auth.sncloud-stg.dev/
4342
keySecretName: sn-platform-oauth2-private-key
4443
keySecretKey: auth.json
4544
cleanupAuthConfig:
4645
oauth2Config:
47-
audience: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
48-
issuerUrl: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0
49-
scope: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
46+
audience: urn:sn:pulsar:sndev:test
47+
issuerUrl: https://auth.sncloud-stg.dev/
5048
keySecretName: sn-platform-oauth2-private-key
5149
keySecretKey: auth.json
5250
image: streamnative/pulsar-io-batch-data-generator:3.2.2.1
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: compute.functionmesh.io/v1alpha1
2+
kind: Source
3+
metadata:
4+
name: pubsub-source
5+
namespace: default
6+
spec:
7+
className: org.apache.pulsar.ecosystem.io.pubsub.PubsubSource
8+
clusterName: test-pulsar
9+
forwardSourceMessageProperty: true
10+
image: streamnative/pulsar-functions-pulsarctl-java-runner:3.2.2.1
11+
java:
12+
jar: /tmp/pulsar-io-google-pubsub.nar
13+
jarLocation: function://public/default/pubsub
14+
minReplicas: 1
15+
name: test
16+
namespace: default
17+
output:
18+
producerConf: {}
19+
topic: persistent://public/default/test-pubsub-output
20+
typeClassName: '[B'
21+
processingGuarantee: atleast_once
22+
pulsar:
23+
pulsarConfig: test-pulsar
24+
authConfig:
25+
oauth2Config:
26+
audience: urn:sn:pulsar:sndev:test
27+
issuerUrl: https://auth.sncloud-stg.dev/
28+
keySecretName: sn-platform-oauth2-private-key
29+
keySecretKey: auth.json
30+
replicas: 1
31+
resources:
32+
limits:
33+
cpu: "0.2"
34+
memory: 1.1G
35+
requests:
36+
cpu: "0.1"
37+
memory: 1G
38+
secretsMap:
39+
pubsubCredential:
40+
key: GCP_KEY
41+
path: gcp-account
42+
sourceConfig:
43+
pubsubProjectId: sncloud-dev-pengcheng
44+
pubsubTopicId: test-input
45+
tenant: public
46+
---
47+
apiVersion: v1
48+
kind: ConfigMap
49+
metadata:
50+
name: test-pulsar
51+
data:
52+
webServiceURL: http://sn-platform-pulsar-broker.default.svc.cluster.local:8080
53+
brokerServiceURL: pulsar://sn-platform-pulsar-broker.default.svc.cluster.local:6650
54+
---
55+
apiVersion: v1
56+
data:
57+
GCP_KEY: GCP_KEY_DATA
58+
kind: Secret
59+
metadata:
60+
name: gcp-account
61+
namespace: default
62+
type: Opaque
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
21+
set -e
22+
23+
E2E_DIR=$(dirname "$0")
24+
BASE_DIR=$(cd "${E2E_DIR}"/../../../../..;pwd)
25+
PULSAR_NAMESPACE=${PULSAR_NAMESPACE:-"default"}
26+
PULSAR_RELEASE_NAME=${PULSAR_RELEASE_NAME:-"sn-platform"}
27+
E2E_KUBECONFIG=${E2E_KUBECONFIG:-"/tmp/e2e-k8s.config"}
28+
29+
source "${BASE_DIR}"/.ci/helm.sh
30+
31+
if [ ! "$KUBECONFIG" ]; then
32+
export KUBECONFIG=${E2E_KUBECONFIG}
33+
fi
34+
35+
kubectl apply -f "${BASE_DIR}"/.ci/tests/integration-oauth2/cases/google-pubsub-source/manifests.yaml > /dev/null 2>&1
36+
37+
verify_fm_result=$(ci::verify_function_mesh pubsub-source 2>&1)
38+
if [ $? -ne 0 ]; then
39+
echo "$verify_fm_result"
40+
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration-oauth2/cases/google-pubsub-source/manifests.yaml > /dev/null 2>&1 || true
41+
exit 1
42+
fi
43+
44+
verify_pod_log_result=$(NAMESPACE=${PULSAR_NAMESPACE} ci::verify_pod_log pubsub-source-source-0 "listening for messages on projects/sncloud-dev-pengcheng/subscriptions/test-input" 2>&1)
45+
if [ $? -ne 0 ]; then
46+
echo "$verify_pod_log_result"
47+
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration-oauth2/cases/google-pubsub-source/manifests.yaml > /dev/null 2>&1 || true
48+
exit 1
49+
fi
50+
51+
echo "e2e-test: ok" | yq eval -
52+
kubectl delete -f "${BASE_DIR}"/.ci/tests/integration-oauth2/cases/google-pubsub-source/manifests.yaml > /dev/null 2>&1 || true

.ci/tests/integration-oauth2/cases/java-download-function-generic-auth/manifests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
certSecretKey: ""
4343
authConfig:
4444
genericAuth:
45-
clientAuthenticationParameters: '{"audience":"api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default","issuerUrl":"https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0","privateKey":"/mnt/secrets/auth.json","type":"client_credentials","scope":"api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default","issuer_url":"https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0","private_key":"/mnt/secrets/auth.json"}'
45+
clientAuthenticationParameters: '{"audience":"urn:sn:pulsar:sndev:test","issuerUrl":"https://auth.sncloud-stg.dev/","privateKey":"/mnt/secrets/auth.json","type":"client_credentials","issuer_url":"https://auth.sncloud-stg.dev/","private_key":"/mnt/secrets/auth.json"}'
4646
clientAuthenticationPlugin: org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2
4747
java:
4848
jar: pulsar-functions-api-examples.jar

.ci/tests/integration-oauth2/cases/java-download-function/manifests.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ spec:
4545
certSecretKey: ""
4646
authConfig:
4747
oauth2Config:
48-
audience: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
49-
issuerUrl: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0
50-
scope: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
48+
audience: urn:sn:pulsar:sndev:test
49+
issuerUrl: https://auth.sncloud-stg.dev/
5150
keySecretName: sn-platform-oauth2-private-key
5251
keySecretKey: auth.json
5352
java:

.ci/tests/integration-oauth2/cases/java-function/manifests.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ spec:
4242
certSecretKey: ""
4343
authConfig:
4444
oauth2Config:
45-
audience: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
46-
issuerUrl: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0
47-
scope: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
45+
audience: urn:sn:pulsar:sndev:test
46+
issuerUrl: https://auth.sncloud-stg.dev/
4847
keySecretName: sn-platform-oauth2-private-key
4948
keySecretKey: auth.json
5049
java:

.ci/tests/integration-oauth2/cases/py-download-from-http-function/manifests.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ spec:
3939
hostnameVerification: true
4040
authConfig:
4141
oauth2Config:
42-
audience: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
43-
issuerUrl: https://sts.windows.net/06a8a086-ae6e-45b5-a22e-ad90de23013e/v2.0
44-
scope: api://56c1bd14-3ba7-4804-b47b-d46de6dce33e/.default
42+
audience: urn:sn:pulsar:sndev:test
43+
issuerUrl: https://auth.sncloud-stg.dev/
4544
keySecretName: sn-platform-oauth2-private-key
4645
keySecretKey: auth.json
4746
python:

0 commit comments

Comments
 (0)