Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.3.0 #566

Merged
merged 14 commits into from
Apr 1, 2021
215 changes: 29 additions & 186 deletions .github/workflows/knative-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: e2e tests

on:
push:
branches:
- master
paths:
- 'install/**'
- 'samples/knative/**'
Expand Down Expand Up @@ -31,7 +33,7 @@ jobs:
export ITER8=$(pwd)
kubectl apply -f $ITER8/samples/knative/quickstart/baseline.yaml
kubectl apply -f $ITER8/samples/knative/quickstart/experimentalservice.yaml
kubectl wait --for=condition=Ready ksvc/sample-app
kubectl wait --for=condition=Ready ksvc/sample-app --timeout=240s

- name: create Fortio job and create experiment
run: |
Expand All @@ -41,66 +43,20 @@ jobs:

# Wait for Fortio to be ready
pod_name=$(kubectl get pods --selector=job-name=fortio -o jsonpath='{.items[*].metadata.name}')
kubectl wait --for=condition=Ready pods/"$pod_name"
kubectl wait --for=condition=Ready pods/"$pod_name" --timeout=240s

# Starting the experiment
kubectl apply -f $ITER8/samples/knative/quickstart/experiment.yaml

- name: Sleep until end of experiment
run: sleep 120.0
run: |
sleep 150.0
kubectl get experiment quickstart-exp -o yaml

- name: Check if experiment is complete and successful
run: |
# Check if experiment has completed
completed="Completed"
if [[ $(kubectl get experiment quickstart-exp -ojson | jq .status.stage)=="$completed" ]]; then
echo "Experiment has Completed"
else
echo "Experiment must be Completed. It is $(kubectl get experiment quickstart-exp -ojson | jq .status.stage)"
exit 1
fi

# Check if no packets have been lost by Fortio

pod_name=$(kubectl get pods --selector=job-name=fortio -o jsonpath='{.items[*].metadata.name}')
kubectl cp default/"$pod_name":shared/fortiooutput.json /tmp/fortiooutput.json -c busybox

REQUESTSTOTAL=$(jq .DurationHistogram.Count /tmp/fortiooutput.json)
REQUESTS200=$(jq '.RetCodes."200"' /tmp/fortiooutput.json)
if [[ "REQUESTSTOTAL"=="$REQUESTS200" ]]; then
echo "Packets were not lost"
else
echo "Packets were lost"
exit 1
fi

# Check if recommended baseline is candidate
candidate="candidate"
if [[ $(kubectl get experiment quickstart-exp -ojson | jq .status.recommendedBaseline)=="$candidate" ]]; then
echo "recommendedBaseline is candidate"
else
echo "recommendedBaseline must be candidate"
exit 1
fi


# Check if latest revision is true
latestRevision=true
if [[ $(kubectl get ksvc sample-app -ojson | jq '.spec.traffic[0].latestRevision')=="$latestRevision" ]]; then
echo "latestRevision is true"
else
echo "latestRevision must be true"
exit 1
fi

#check if traffic percent is 100
percent=100
if [[ $(kubectl get ksvc sample-app -ojson | jq '.spec.traffic[0].percent')=="$percent" ]]; then
echo "percent is 100"
else
echo "percent must be 100"
exit 1
fi
export ITER8=$(pwd)
source $ITER8/samples/knative/quickstart/check.sh

canary-progressive-helm:
name: progressive canary experiment using helm
Expand All @@ -122,13 +78,13 @@ jobs:
run: |
export ITER8=$(pwd)
helm install --repo https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/canaryprogressive/helm-repo sample-app sample-app --namespace=iter8-system
kubectl wait ksvc/sample-app --for condition=Ready --timeout=120s
kubectl wait ksvc/sample-app --for condition=Ready --timeout=240s
helm upgrade --install --repo https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/canaryprogressive/helm-repo sample-app sample-app --values=https://raw.githubusercontent.com/iter8-tools/iter8/master/samples/knative/canaryprogressive/experimental-values.yaml --namespace=iter8-system

- name: Generate requests
run: |
export ITER8=$(pwd)
kubectl wait --for=condition=Ready ksvc/sample-app
kubectl wait --for=condition=Ready ksvc/sample-app --timeout=240s
URL_VALUE=$(kubectl get ksvc sample-app -o json | jq .status.address.url)
sed "s+URL_VALUE+${URL_VALUE}+g" $ITER8/samples/knative/canaryprogressive/fortio.yaml | kubectl apply -f -

Expand All @@ -137,62 +93,15 @@ jobs:
export ITER8=$(pwd)
kubectl apply -f $ITER8/samples/knative/canaryprogressive/experiment.yaml

- name: Sleep
- name: Sleep until end of experiment
run: |
sleep 150.0

kubectl get experiment canary-progressive -o yaml

- name: Check if experiment is complete and successful
run: |
# Check if experiment has completed
completed="Completed"
if [[ $(kubectl get experiment canary-progressive -ojson | jq .status.stage)=="$completed" ]]; then
echo "Experiment has Completed"
else
echo "Experiment must be Completed. It is $(kubectl get experiment canary-progressive -ojson | jq .status.stage)"
exit 1
fi

# Check if no requests have been lost during the experiment

pod_name=$(kubectl get pods --selector=job-name=fortio -o jsonpath='{.items[*].metadata.name}')
kubectl cp default/"$pod_name":shared/fortiooutput.json /tmp/fortiooutput.json -c busybox

REQUESTSTOTAL=$(jq .DurationHistogram.Count /tmp/fortiooutput.json)
REQUESTS200=$(jq '.RetCodes."200"' /tmp/fortiooutput.json)
if [[ "REQUESTSTOTAL"=="$REQUESTS200" ]]; then
echo "Packets were not lost"
else
echo "Packets were lost"
exit 1
fi

# Check if recommended baseline is candidate
candidate="candidate"
if [[ $(kubectl get experiment canary-progressive -ojson | jq .status.recommendedBaseline)=="$candidate" ]]; then
echo "recommendedBaseline is candidate"
else
echo "recommendedBaseline must be candidate"
exit 1
fi


# Check if latest revision is true
latestRevision=true
if [[ $(kubectl get ksvc sample-app -ojson | jq '.spec.traffic[0].latestRevision')=="$latestRevision" ]]; then
echo "latestRevision is true"
else
echo "latestRevision must be true"
exit 1
fi

# Check if traffic percent is 100
percent=100
if [[ $(kubectl get ksvc sample-app -ojson | jq '.spec.traffic[0].percent')=="$percent" ]]; then
echo "percent is 100"
else
echo "percent must be 100"
exit 1
fi
export ITER8=$(pwd)
source $ITER8/samples/knative/canaryprogressive/check.sh

canary-fixedsplit-kustomize:
name: fixedsplit canary experiment with kustomize
Expand All @@ -212,13 +121,13 @@ jobs:
run: |
export ITER8=$(pwd)
kustomize build $ITER8/samples/knative/canaryfixedsplit/baseline | kubectl apply -f -
kubectl wait ksvc/sample-app --for condition=Ready --timeout=120s
kubectl wait ksvc/sample-app --for condition=Ready --timeout=240s
kustomize build $ITER8/samples/knative/canaryfixedsplit/experimentalservice | kubectl apply -f -

- name: Generate requests
run: |
export ITER8=$(pwd)
kubectl wait --for=condition=Ready ksvc/sample-app
kubectl wait --for=condition=Ready ksvc/sample-app --timeout=240s
URL_VALUE=$(kubectl get ksvc sample-app -o json | jq .status.address.url)
sed "s+URL_VALUE+${URL_VALUE}+g" $ITER8/samples/knative/canaryfixedsplit/fortio.yaml | kubectl apply -f -

Expand All @@ -227,62 +136,15 @@ jobs:
export ITER8=$(pwd)
kubectl apply -f $ITER8/samples/knative/canaryfixedsplit/experiment.yaml

- name: Sleep
- name: Sleep until end of experiment
run: |
sleep 150.0

kubectl get experiment canary-fixedsplit -o yaml

- name: Check if experiment is complete and successful
run: |
# Check if experiment has completed
completed="Completed"
if [[ $(kubectl get experiment canary-fixedsplit -ojson | jq .status.stage)=="$completed" ]]; then
echo "Experiment has Completed"
else
echo "Experiment must be Completed. It is $(kubectl get experiment canary-fixedsplit -ojson | jq .status.stage)"
exit 1
fi

# Check if no requests have been lost during the experiment

pod_name=$(kubectl get pods --selector=job-name=fortio -o jsonpath='{.items[*].metadata.name}')
kubectl cp default/"$pod_name":shared/fortiooutput.json /tmp/fortiooutput.json -c busybox

REQUESTSTOTAL=$(jq .DurationHistogram.Count /tmp/fortiooutput.json)
REQUESTS200=$(jq '.RetCodes."200"' /tmp/fortiooutput.json)
if [[ "REQUESTSTOTAL"=="$REQUESTS200" ]]; then
echo "Packets were not lost"
else
echo "Packets were lost"
exit 1
fi

# Check if recommended baseline is candidate
candidate="candidate"
if [[ $(kubectl get experiment canary-progressive -ojson | jq .status.recommendedBaseline)=="$candidate" ]]; then
echo "recommendedBaseline is candidate"
else
echo "recommendedBaseline must be candidate"
exit 1
fi


# Check if latest revision is true
latestRevision=true
if [[ $(kubectl get ksvc sample-app -ojson | jq '.spec.traffic[0].latestRevision')=="$latestRevision" ]]; then
echo "latestRevision is true"
else
echo "latestRevision must be true"
exit 1
fi

# Check if traffic percent is 100
percent=100
if [[ $(kubectl get ksvc sample-app -ojson | jq '.spec.traffic[0].percent')=="$percent" ]]; then
echo "percent is 100"
else
echo "percent must be 100"
exit 1
fi
export ITER8=$(pwd)
source $ITER8/samples/knative/canaryfixedsplit/check.sh

conformance:
name: conformance
Expand All @@ -306,7 +168,7 @@ jobs:
- name: Generate requests
run: |
export ITER8=$(pwd)
kubectl wait --for=condition=Ready ksvc/sample-app
kubectl wait --for=condition=Ready ksvc/sample-app --timeout=240s
URL_VALUE=$(kubectl get ksvc sample-app -o json | jq .status.address.url)
sed "s+URL_VALUE+${URL_VALUE}+g" $ITER8/samples/knative/conformance/fortio.yaml | kubectl apply -f -

Expand All @@ -315,31 +177,12 @@ jobs:
export ITER8=$(pwd)
kubectl apply -f $ITER8/samples/knative/conformance/experiment.yaml

- name: Sleep
- name: Sleep until end of experiment
run: |
sleep 150.0

kubectl get experiment conformance-sample -o yaml

- name: Check if experiment is complete and successful
run: |
# Check if experiment has completed
completed="Completed"
if [[ $(kubectl get experiment canary-fixedsplit -ojson | jq .status.stage)=="$completed" ]]; then
echo "Experiment has Completed"
else
echo "Experiment must be Completed. It is $(kubectl get experiment canary-fixedsplit -ojson | jq .status.stage)"
exit 1
fi

# Check if no requests have been lost during the experiment

pod_name=$(kubectl get pods --selector=job-name=fortio -o jsonpath='{.items[*].metadata.name}')
kubectl cp default/"$pod_name":shared/fortiooutput.json /tmp/fortiooutput.json -c busybox

REQUESTSTOTAL=$(jq .DurationHistogram.Count /tmp/fortiooutput.json)
REQUESTS200=$(jq '.RetCodes."200"' /tmp/fortiooutput.json)
if [[ "REQUESTSTOTAL"=="$REQUESTS200" ]]; then
echo "Packets were not lost"
else
echo "Packets were lost"
exit 1
fi
export ITER8=$(pwd)
source $ITER8/samples/knative/conformance/check.sh
14 changes: 7 additions & 7 deletions mkdocs/docs/concepts/buildingblocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Metric backends like Prometheus, New Relic, Sysdig and Elastic collect metrics f
![Conformance](/assets/images/conformance.png)

!!! tip ""
Try a [conformance experiment](/code-samples/knative/conformance/).
Try a [conformance experiment](/tutorials/knative/conformance/).

## Deployment pattern

Expand All @@ -79,15 +79,15 @@ Metric backends like Prometheus, New Relic, Sysdig and Elastic collect metrics f
![Canary](/assets/images/canary-progressive-helm.png)

!!! tip ""
Try a [progressive deployment experiment](/code-samples/knative/canary-progressive/).
Try a [progressive deployment experiment](/tutorials/knative/canary-progressive/).

=== "Fixed-split"
Fixed-split deployment does not shift traffic between versions.

![Canary](/assets/images/canary-fixedsplit-kustomize.png)

!!! tip ""
Try a [fixed-split deployment experiment](/code-samples/knative/canary-fixedsplit/).
Try a [fixed-split deployment experiment](/tutorials/knative/canary-fixedsplit/).

## Traffic shaping

Expand All @@ -101,15 +101,15 @@ Iter8 enables you to take total advantage of all the traffic shaping features av
![Canary](/assets/images/mirroring.png)

!!! tip ""
Try an experiment with [traffic mirroring/shadowing](/code-samples/knative/mirroring/).
Try an experiment with [traffic mirroring/shadowing](/tutorials/knative/mirroring/).

=== "Traffic segmentation"
**Traffic segmentation** is the ability to carve out a specific segment of the traffic to be used in an experiment, leaving the rest of the traffic unaffected by the experiment. Service meshes and ingress controllers often provide the ability to route requests dynamically to different versions based on request attributes such as user identity, URI, IP address prefixes, or origin. Iter8 can leverage this functionality in experiments to control the segment of the traffic that will participate in the experiment. For example, in the canary experiment depicted below, requests from the country `Wakanda` may be routed to baseline or candidate; requests that are not from `Wakanda` will not participate in the experiment and are routed only to the baseline.

![Canary](/assets/images/request-routing.png)

!!! tip ""
Try an experiment with [traffic segmentation](/code-samples/knative/traffic-segmentation/).
Try an experiment with [traffic segmentation](/tutorials/knative/traffic-segmentation/).


## Version promotion
Expand All @@ -122,15 +122,15 @@ Iter8 can optionally **promote a version** at the end of an experiment, based on
![Canary](/assets/images/canary-progressive-helm.png)

!!! tip ""
Try an [experiment that uses Helm charts](/code-samples/knative/canary-progressive/).
Try an [experiment that uses Helm charts](/tutorials/knative/canary-progressive/).

=== "Kustomize resources"
An experiment that uses `kustomize` for version promotion is illustrated below.

![Canary](/assets/images/canary-fixedsplit-kustomize.png)

!!! tip ""
Try an [experiment that uses Kustomize resources](/code-samples/knative/canary-fixedsplit/).
Try an [experiment that uses Kustomize resources](/tutorials/knative/canary-fixedsplit/).

=== "Plain YAML/JSON manifests"
An experiment that uses plain YAML/JSON manifests and the `kubectl` CLI for version promotion is illustrated below.
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/docs/concepts/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Iter8 makes it easy to achieve the following goals.


[^1]: An initial version of Iter8 for KFServing is available [here](https://github.com/iter8-tools/iter8-kfserving). An updated version is coming soon.
[^2]: An earlier version of Iter8 for Istio is available [here](https://github.com/iter8-tools/iter8). An updated version is coming soon.
[^2]: An earlier version of Iter8 for Istio is available [here](https://github.com/iter8-tools/iter8-istio). An updated version is coming soon.
Loading