forked from v6d-io/v6d
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ye Cao <[email protected]>
- Loading branch information
Showing
7 changed files
with
188 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2020-2023 Alibaba Group Holding Limited. | ||
# | ||
# 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: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: consumer | ||
namespace: vineyard-job | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: consumer | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: consumer | ||
spec: | ||
containers: | ||
- name: consumer | ||
image: python:3.10 | ||
command: | ||
- bash | ||
- -c | ||
- | | ||
pip install vineyard numpy pandas; | ||
cat << EOF >> consumer.py | ||
import vineyard | ||
client = vineyard.connect() | ||
unit_obj = client.get_name("test_basic_data_unit") | ||
print(client.get(unit_obj,fetch=True)) | ||
client.close() | ||
EOF | ||
python consumer.py; | ||
sleep infinity; |
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,48 @@ | ||
# Copyright 2020-2023 Alibaba Group Holding Limited. | ||
# | ||
# 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: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: producer | ||
namespace: vineyard-job | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: producer | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: producer | ||
spec: | ||
containers: | ||
- name: producer | ||
image: python:3.10 | ||
command: | ||
- bash | ||
- -c | ||
- | | ||
pip install vineyard numpy pandas; | ||
cat << EOF >> producer.py | ||
import vineyard | ||
import numpy as np | ||
import pandas as pd | ||
client = vineyard.connect() | ||
client.put((1, 1.2345, 'xxxxabcd'), persist=True, name="test_basic_data_unit"); | ||
client.close() | ||
EOF | ||
python producer.py; | ||
sleep infinity; |
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,55 @@ | ||
# Copyright 2020-2023 Alibaba Group Holding Limited. | ||
# | ||
# 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. | ||
# | ||
|
||
setup: | ||
env: kind | ||
kubeconfig: /tmp/e2e-k8s.config | ||
steps: | ||
- name: deploy the vineyard deployment | ||
command: | | ||
go run k8s/cmd/main.go deploy vineyard-deployment --vineyardd.image="localhost:5001/vineyardd:alpine-latest" --create-namespace | ||
- name: schedule the produce workload | ||
command: | | ||
kubectl create ns vineyard-job | ||
go run k8s/cmd/main.go schedule workload -f k8s/test/e2e/schedule-workload-demo/producer.yaml | kubectl apply -f - | ||
wait: | ||
- namespace: vineyard-job | ||
resource: deployment/producer | ||
for: condition=Available | ||
- name: schedule the consume workload | ||
command: | | ||
go run k8s/cmd/main.go schedule workload -f k8s/test/e2e/schedule-workload-demo/consumer.yaml | kubectl apply -f - | ||
wait: | ||
- namespace: vineyard-job | ||
resource: deployment/consumer | ||
for: condition=Available | ||
timeout: 20m | ||
|
||
cleanup: | ||
# always never success failure | ||
on: success | ||
|
||
verify: | ||
# verify with retry strategy | ||
retry: | ||
# max retry count | ||
count: 10 | ||
# the interval between two attempts, e.g. 10s, 1m. | ||
interval: 10s | ||
cases: | ||
- query: | | ||
kubectl logs --tail 1 $(kubectl get pod -lapp=consumer -n vineyard-job -o jsonpath='{.items[0].metadata.name}') \ | ||
-n vineyard-job | ||
expected: ../verify/basic-types-unit.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,16 @@ | ||
# Copyright 2020-2023 Alibaba Group Holding Limited. | ||
# | ||
# 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. | ||
# | ||
|
||
(1, 1.2345000505447388, 'xxxxabcd') |