Skip to content

Commit 68872d4

Browse files
authored
Changes to canary tutorial (#664)
* Changes to canary tutorial * Updated mkdocs * image link * conformance testing is yet to come
1 parent e209d89 commit 68872d4

File tree

14 files changed

+296
-4
lines changed

14 files changed

+296
-4
lines changed

.github/workflows/knative-e2e-tests.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,53 @@ jobs:
6262
export ITER8=$(pwd)
6363
source $ITER8/samples/knative/quickstart/check.sh
6464
65+
canary:
66+
name: canary experiment
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v2
71+
72+
- uses: engineerd/[email protected]
73+
- name: platform setup
74+
run: |
75+
export ITER8=$(pwd)
76+
$ITER8/samples/knative/quickstart/platformsetup.sh contour
77+
78+
- name: create Knative service and readiness check
79+
run: |
80+
export ITER8=$(pwd)
81+
kubectl apply -f $ITER8/samples/knative/quickstart/baseline.yaml
82+
kubectl apply -f $ITER8/samples/knative/quickstart/experimentalservice.yaml
83+
kubectl wait --for=condition=Ready ksvc/sample-app --timeout=240s
84+
85+
- name: create Fortio job and create experiment
86+
run: |
87+
export ITER8=$(pwd)
88+
sed -i "s/6000s/120s/g" $ITER8/samples/knative/quickstart/fortio.yaml
89+
URL_VALUE=$(kubectl get ksvc sample-app -o json | jq .status.address.url)
90+
sed "s+URL_VALUE+${URL_VALUE}+g" $ITER8/samples/knative/quickstart/fortio.yaml | kubectl apply -f -
91+
92+
# Wait for Fortio to be ready
93+
pod_name=$(kubectl get pods --selector=job-name=fortio -o jsonpath='{.items[*].metadata.name}')
94+
kubectl wait --for=condition=Ready pods/"$pod_name" --timeout=240s
95+
96+
# Define metrics
97+
kubectl apply -f $ITER8/samples/knative/quickstart/metrics.yaml
98+
99+
# Starting the experiment
100+
kubectl apply -f $ITER8/samples/knative/canary/experiment.yaml
101+
102+
- name: Sleep until end of experiment
103+
run: |
104+
sleep 150.0
105+
kubectl get experiment canary-exp -o yaml
106+
107+
- name: Check if experiment is complete and successful
108+
run: |
109+
export ITER8=$(pwd)
110+
source $ITER8/samples/knative/canary/check.sh
111+
65112
canary-progressive-helm:
66113
name: progressive canary experiment using helm
67114
runs-on: ubuntu-latest

mkdocs/docs/getting-started/quick-start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ template: main.html
2020
1. The [kubectl CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
2121
2. [Go 1.13+](https://golang.org/doc/install).
2222

23+
> **Note:** Please choose the same K8s stack (for example, Istio, KFServing, or Knative) consistently throughout this tutorial. If you wish to switch K8s stacks between tutorials, start from a clean K8s cluster (step 1 below), so that your cluster is correctly setup.
24+
2325
## 1. Create Kubernetes cluster
2426

2527
Create a local cluster using Kind or Minikube as follows, or use a managed Kubernetes cluster. Ensure that the cluster has sufficient resources, for example, 8 CPUs and 12GB of memory.
@@ -52,8 +54,6 @@ export ITER8=$(pwd)
5254
## 3. Install K8s stack and Iter8
5355
Choose the K8s stack over which you are performing the A/B testing experiment.
5456

55-
> **Note:** Please choose the same K8s stack consistently throughout the tutorial. If you finished running the tutorial for a specific stack, and wish to try it on another stack, start from Step 1 (i.e., a clean K8s cluster), so that your cluster is correctly setup.
56-
5757
=== "Istio"
5858
Setup Istio, Iter8, a mock New Relic service, and Prometheus add-on within your cluster.
5959

@@ -1183,7 +1183,7 @@ When the experiment completes, you will see the experiment stage change from `Ru
11831183
???+ info "Understanding what happened"
11841184
1. You created two versions of your app/ML model.
11851185
2. You generated requests for your app/ML model versions. At the start of the experiment, 100% of the requests are sent to the baseline and 0% to the candidate.
1186-
3. You created an Iter8 experiment with A/B testing pattern and progressive deployment pattern. In each iteration, Iter8 observed the latency and error-rate metrics collected by Prometheus, and the user-engagement metric from New Relic, verified that the candidate satisfied all objectives, verified that the candidate improved over the baseline in terms of user-engagement, identified candidate as the winner, progressively shifted traffic from the baseline to the candidate, and promoted the candidate.
1186+
3. You created an Iter8 experiment with A/B testing pattern and progressive deployment pattern. In each iteration, Iter8 observed the latency and error-rate metrics collected by Prometheus, and the user-engagement metric from New Relic; Iter8 verified that the candidate satisfied all objectives, verified that the candidate improved over the baseline in terms of user-engagement, identified candidate as the winner, progressively shifted traffic from the baseline to the candidate, and promoted the candidate.
11871187

11881188
## 9. Cleanup
11891189
=== "Istio"

mkdocs/docs/images/canary-exp.png

144 KB
Loading
151 KB
Loading
-17 Bytes
Loading
285 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
template: main.html
3+
---
4+
5+
# A/B Testing
6+
7+
A/B testing pattern is documented as part of [quick start](../../../../getting-started/quick-start/).

0 commit comments

Comments
 (0)