Skip to content

Commit

Permalink
chore(test): update ci script (#1329)
Browse files Browse the repository at this point in the history
* update ci script

* update pipelineloop test for ci
  • Loading branch information
Tomcli authored Aug 17, 2023
1 parent f874180 commit 73fb66a
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .tekton/listener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ spec:
- name: images
description: a image list for publishing
default: "api-server persistenceagent metadata-writer scheduledworkflow cache-server frontend pipelineloop-controller pipelineloop-webhook kubeclient"
- name: many-edge-duration
description: duration threshold for many edge pipeline
value: "7"
resourcetemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand Down Expand Up @@ -147,6 +150,8 @@ spec:
value: $(params.skip-pipeline-loop)
- name: images
value: $(params.images)
- name: many-edge-duration
value: $(params.many-edge-duration)
---
apiVersion: tekton.dev/v1beta1
kind: TriggerBinding
Expand Down
5 changes: 5 additions & 0 deletions .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
- name: images
description: a image list for publishing
default: "api-server persistenceagent metadata-writer scheduledworkflow cache-server frontend pipelineloop-controller pipelineloop-webhook kubeclient"
- name: many-edge-duration
description: duration threshold for many edge pipeline
value: "7"
workspaces:
- name: pipeline-pvc
tasks:
Expand Down Expand Up @@ -678,6 +681,8 @@ spec:
value: $(params.slack-channel)
- name: test-script
value: "scripts/deploy/iks/test-many-edges.sh"
- name: many-edge-duration
value: $(params.many-edge-duration)
workspaces:
- name: task-pvc
workspace: pipeline-pvc
Expand Down
5 changes: 5 additions & 0 deletions .tekton/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ spec:
- name: test-script
description: a shell script to run the test case
default: ""
- name: many-edge-duration
description: duration threshold for pipeline
default: "5"
workspaces:
- name: task-pvc
mountPath: /artifacts
Expand Down Expand Up @@ -429,6 +432,8 @@ spec:
fieldPath: metadata.annotations['devops.cloud.ibm.com/build-number']
- name: TEST_SCRIPT
value: $(params.test-script)
- name: MANY_EDGE_DURATION
value: $(params.many-edge-duration)
command: ["/bin/bash", "-c"]
args:
- set -ex;
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy/iks/test-many-edges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ run_many_edges() {
local RUN_NAME="${PIPELINE_NAME}-run"
local ENDTIME

ENDTIME=$(date -ud "5 second" +%s)
ENDTIME=$(date -ud "$DURATION second" +%s)
retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e exp-many-edges -r "$RUN_NAME" -p "$PIPELINE_ID" || :
RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}')
if [[ -z "$RUN_ID" ]]; then
Expand All @@ -45,7 +45,7 @@ run_many_edges() {
fi

if [[ "$(date -u +%s)" -gt "$ENDTIME" ]]; then
echo "validation duration is longer then 5 seconds"
echo "validation duration is longer than $DURATION seconds"
return "$REV"
fi

Expand All @@ -56,7 +56,7 @@ run_many_edges() {
}

RESULT=0
run_many_edges 20 || RESULT=$?
run_many_edges ${MANY_EDGE_DURATION} || RESULT=$?

STATUS_MSG=PASSED
if [[ "$RESULT" -ne 0 ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: pipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
echo "$(params.message)" && exit 1;
iterateParam: message
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
echo "$(params.message)"
iterateParam: message
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: pr-loop-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
#!/usr/bin/env bash
echo "$(params.message-index)) $(params.message)"
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
iterateParam: message
parallelism: 2
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
accessModes:
- ReadWriteOnce
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: print-data
Expand All @@ -38,7 +38,7 @@ spec:
image: ubuntu
script: cat $(workspaces.storage.path)/$(params.filename)
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: fetch-store-data
Expand All @@ -55,7 +55,7 @@ spec:
script: |
cp $(workspaces.recipe-ws.path)/$(params.src-filename) $(workspaces.storage.path)/$(params.dst-filename)
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: fetch-and-print-recipe
Expand Down Expand Up @@ -111,7 +111,7 @@ spec:
claimName: shared-task-storage
iterateParam: dst-filename
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: pr-ws-loop-example
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: pr-loop-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
name: pipelineloop-inner
iterateParam: message
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: simpletask
Expand All @@ -15,7 +15,7 @@ spec:
#!/usr/bin/env bash
echo "$(params.word)$(params.suffix)"
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: demo-pipeline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: simpletask
Expand All @@ -15,7 +15,7 @@ spec:
#!/usr/bin/env bash
echo "$(params.word)$(params.suffix)"
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: demo-pipeline
Expand Down

0 comments on commit 73fb66a

Please sign in to comment.