diff --git a/docs/getting-started/concepts.md b/docs/getting-started/concepts.md index 80c6f901..5327438e 100644 --- a/docs/getting-started/concepts.md +++ b/docs/getting-started/concepts.md @@ -9,23 +9,23 @@ Iter8 is the Kubernetes release optimizer built for DevOps, MLOps, SRE and data Iter8 simplifies a variety of traffic engineering and metrics-driven validation use cases. To support such use cases, Iter8 provides support for the key challenges enabling simpler implementation and quicker adoption of testing in the CD process. -**Progressive release with automated traffic management** Iter8 supports blue-green, canary and mirrored releases of new applications and ML models. When new models are deployed, Iter8 automatically reconfigures the routing to desired traffic pattern. Deployment of new versions and their promotion is done by describing the desired state. +**Progressive release with automated traffic management:** Iter8 supports blue-green, canary and mirrored releases of new applications and ML models. When new models are deployed, Iter8 automatically reconfigures the routing to desired traffic pattern. Deployment of new versions and their promotion is done by describing the desired state. -**A/B/n testing with client SDK and business metrics** Iter8 addresses the challenge of doing A/B/n testing of backend application components/ML models. It provides a simple client SDK allowing a user-facing component to easily and reliably associate business metrics with the backend components that were used. This SDK provides sticky lookup based on user request headers. +**A/B/n testing with client SDK and business metrics:** Iter8 addresses the challenge of doing A/B/n testing of backend application components/ML models. It provides a simple client SDK allowing a user-facing component to easily and reliably associate business metrics with the backend components that were used. This SDK provides sticky lookup based on user request headers. -**Performance testing for HTTP and gRPC endpoints** To enable rapid testing, Iter8 provides synthetic load generation and notification support. A set of reusable tasks can be used to implement the desired test and notification behavior. +**Performance testing for HTTP and gRPC endpoints:** To enable rapid testing, Iter8 provides synthetic load generation and notification support. A set of reusable tasks can be used to implement the desired test and notification behavior. -## Design Principles +## Design principles -**Support all applications** Iter8 does not limit what types of resources an application is composed of. It supports applications that are composed of any Kubernetes resources including those defined by custom resource definitions (CRDs). Adding support for a new resource type is both straightforward and declarative. +**Support all applications:** Iter8 does not limit what types of resources an application is composed of. It supports applications that are composed of any Kubernetes resources including those defined by custom resource definitions (CRDs). Adding support for a new resource type is both straightforward and declarative. -**Support any routing technology** Progress release use cases are supported using an service mesh or ingress. Iter8 natively supports the Kubernetes Gateway API allowing easy adoption of many of these technologies. However, native interfaces can also be supported declaratively. +**Support any routing technology:** Progress release use cases are supported using an service mesh or ingress. Iter8 natively supports the Kubernetes Gateway API allowing easy adoption of many of these technologies. However, native interfaces can also be supported declaratively. -**Simplify user interaction** Iter8 leverages Helm to allow users to declaratively specify deployment patterns and to describe test scenarios. The Helm charts provided by Iter8 minimize the barrier to entry by providing common examples. Extension is often possible just be modifying the input to the charts. However, more complicated use cases can also be supported by (user) modification of the Helm charts as well. +**Simplify user interaction:** Iter8 leverages Helm to allow users to declaratively specify deployment patterns and to describe test scenarios. The Helm charts provided by Iter8 minimize the barrier to entry by providing common examples. Extension is often possible just be modifying the input to the charts. However, more complicated use cases can also be supported by (user) modification of the Helm charts as well. -**Minimize Access** Progressive release and A/B/n use cases require the user to install a Kubernetes controller. However, Iter8 allows for users with only namespace level access to install and use Iter8. Iter8 can also be installed and run with cluster level access. +**Minimize Access:** Progressive release and A/B/n use cases require the user to install a Kubernetes controller. However, Iter8 allows for users with only namespace level access to install and use Iter8. Iter8 can also be installed and run with cluster level access. -## Implementation Choices +## Implementation choices ### Iter8 controller diff --git a/docs/getting-started/first-release.md b/docs/getting-started/first-release.md index 99c1b3c7..4302821b 100644 --- a/docs/getting-started/first-release.md +++ b/docs/getting-started/first-release.md @@ -4,14 +4,18 @@ template: main.html # Your first progressive release -This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a blue-green release strategy. +This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a blue-green release strategy. + In a blue-green release, a percentage of requests are directed to a candidate version of the model. -This percentage can be changed over time. +This percentage can be changed over time. + +![Blue-green release](../tutorials/images/blue-green.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the blue-green release strategy. -![Blue-green release](../tutorials/images/blue-green.png) +*** ???+ warning "Before you begin" 1. Ensure that you have a Kubernetes cluster and the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs. If using a local cluster (for example, [Kind](https://kind.sigs.k8s.io/) or [Minikube](https://minikube.sigs.k8s.io/docs/)), we recommend providing the cluster with at least 16GB of memory. diff --git a/docs/tutorials/abn.md b/docs/tutorials/abn.md index bc5b063d..b02f34f5 100644 --- a/docs/tutorials/abn.md +++ b/docs/tutorials/abn.md @@ -4,4 +4,4 @@ template: main.html # A/B Testing with the Iter8 SDK -[Your first A/B/n test](../getting-started/first-abn.md) describes how to perform an A/B test of an backend component using the with the [Iter8 SDK](../user-guide/abn/using-sdk.md). +[Your first A/B/n test](../getting-started/first-abn.md) describes how to perform an A/B test of an backend component using the [Iter8 SDK](../user-guide/abn/using-sdk.md). diff --git a/docs/tutorials/canary.md b/docs/tutorials/canary.md index 4f672afd..c1eef8c3 100644 --- a/docs/tutorials/canary.md +++ b/docs/tutorials/canary.md @@ -4,13 +4,17 @@ template: main.html # Canary release -This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a canary release strategy. +This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a canary release strategy. + In a canary release, requests that match a particular pattern, for example those that have a particular header, are directed to the candidate version of the model. The remaining requests go to the primary, or initial, version of the model. + +![Canary release](images/canary.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the canary release strategy. -![Canary release](images/canary.png) +*** ???+ warning "Before you begin" 1. Ensure that you have a Kubernetes cluster and the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs. If using a local cluster (for example, [Kind](https://kind.sigs.k8s.io/) or [Minikube](https://minikube.sigs.k8s.io/docs/)), we recommend providing the cluster with at least 16GB of memory. diff --git a/docs/tutorials/integrations/ghactions.md b/docs/tutorials/integrations/ghactions.md index 2b3d8ff1..bab1b778 100644 --- a/docs/tutorials/integrations/ghactions.md +++ b/docs/tutorials/integrations/ghactions.md @@ -2,9 +2,9 @@ template: main.html --- -# Trigger a GitHub Actions workflow during a performance test +# Trigger a GitHub Actions workflow -Iter8 provides a [`github` task](../../user-guide/performance/tasks/github.md) that sends a [`repository_dispatch`](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_dispatch) which can trigger the workflows in the default branch of a GitHub repository. +Iter8 provides a [`github` task](../../user-guide/performance/tasks/github.md) that can be used in a performance test to send a [`repository_dispatch`](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_dispatch) event to trigger workflows in the default branch of a GitHub repository. ## Example diff --git a/docs/tutorials/integrations/kserve-mm/blue-green.md b/docs/tutorials/integrations/kserve-mm/blue-green.md index b923d08f..9d46d795 100644 --- a/docs/tutorials/integrations/kserve-mm/blue-green.md +++ b/docs/tutorials/integrations/kserve-mm/blue-green.md @@ -4,14 +4,18 @@ template: main.html # Blue-green release of a ML model -This tutorial shows how Iter8 can be used to release ML models hosted in a KServe ModelMesh environment using a blue-green release strategy. +This tutorial shows how Iter8 can be used to release ML models hosted in a KServe ModelMesh environment using a blue-green release strategy. + In a blue-green release, a percentage of requests are directed to a candidate version of the model. -This percentage can be changed over time. +This percentage can be changed over time. + +![Blue-green release](../../images/blue-green.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the blue-green release strategy. -![Blue-green release](../../images/blue-green.png) +*** ???+ warning "Before you begin" 1. Ensure that you have the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs installed. diff --git a/docs/tutorials/integrations/kserve-mm/canary.md b/docs/tutorials/integrations/kserve-mm/canary.md index 40ac649b..e68f43a9 100644 --- a/docs/tutorials/integrations/kserve-mm/canary.md +++ b/docs/tutorials/integrations/kserve-mm/canary.md @@ -4,14 +4,18 @@ template: main.html # Canary release of a ML model -This tutorial shows how Iter8 can be used to release ML models hosted in a KServe ModelMesh environment using a canary release strategy. +This tutorial shows how Iter8 can be used to release ML models hosted in a KServe ModelMesh environment using a canary release strategy. + In a canary release, inference requests that match a particular pattern, for example those that have a particular header, are directed to the candidate version of the model. The remaining requests go to the primary, or initial, version of the model. + +![Canary release](../../images/canary.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the canary release strategy. -![Canary release](../../images/canary.png) +*** ???+ warning "Before you begin" 1. Ensure that you have the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs installed. diff --git a/docs/tutorials/integrations/kserve/blue-green.md b/docs/tutorials/integrations/kserve/blue-green.md index 9dbe90fe..67cd278f 100644 --- a/docs/tutorials/integrations/kserve/blue-green.md +++ b/docs/tutorials/integrations/kserve/blue-green.md @@ -4,14 +4,18 @@ template: main.html # Blue-green release of a KServe ML model -This tutorial shows how Iter8 can be used to release ML models hosted in a KServe environment using a blue-green release strategy. +This tutorial shows how Iter8 can be used to release ML models hosted in a KServe environment using a blue-green release strategy. + In a blue-green release, a percentage of requests are directed to a candidate version of the model. -This percentage can be changed over time. +This percentage can be changed over time. + +![Blue-green release](../../images/blue-green.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the blue-green release strategy. -![Blue-green release](../../images/blue-green.png) +*** ???+ warning "Before you begin" 1. Ensure that you have the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs installed. diff --git a/docs/tutorials/integrations/kserve/canary.md b/docs/tutorials/integrations/kserve/canary.md index 0a95c506..37a4cff0 100644 --- a/docs/tutorials/integrations/kserve/canary.md +++ b/docs/tutorials/integrations/kserve/canary.md @@ -4,14 +4,18 @@ template: main.html # Canary release of a KServe ML model -This tutorial shows how Iter8 can be used to release ML models hosted in a KServe environment using a canary release strategy. +This tutorial shows how Iter8 can be used to release ML models hosted in a KServe environment using a canary release strategy. + In a canary release, inference requests that match a particular pattern, for example those that have a particular header, are directed to the candidate version of the model. The remaining requests go to the primary, or initial, version of the model. + +![Canary release](../../images/canary.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the canary release strategy. -![Canary release](../../images/canary.png) +*** ???+ warning "Before you begin" 1. Ensure that you have the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs installed. diff --git a/docs/tutorials/integrations/kubernetes-gateway-api/blue-green.md b/docs/tutorials/integrations/kubernetes-gateway-api/blue-green.md index d533d6f8..9c25f1f8 100644 --- a/docs/tutorials/integrations/kubernetes-gateway-api/blue-green.md +++ b/docs/tutorials/integrations/kubernetes-gateway-api/blue-green.md @@ -4,17 +4,21 @@ template: main.html # Blue-green release -This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a blue-green release strategy. +This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a blue-green release strategy. + In a blue-green release, a percentage of requests are directed to a candidate version of the model. -This percentage can be changed over time. +This percentage can be changed over time. + +![Blue-green release](../../images/blue-green.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the blue-green release strategy. -![Blue-green release](../../images/blue-green.png) - This tutorial uses the Kubernetes Gateway API to allow the use any service mesh that supports this API. In this case, we use demonstrate with [Linkerd](https://linkerd.io/). +*** + ???+ warning "Before you begin" 1. Ensure that you have a Kubernetes cluster and the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs. If using a local cluster (for example, [Kind](https://kind.sigs.k8s.io/) or [Minikube](https://minikube.sigs.k8s.io/docs/)), we recommend providing the cluster with at least 16GB of memory. 2. [Install Linkerd](https://linkerd.io/2.14/getting-started/). diff --git a/docs/tutorials/integrations/kubernetes-gateway-api/canary.md b/docs/tutorials/integrations/kubernetes-gateway-api/canary.md index d7ddc73d..cfd918fd 100644 --- a/docs/tutorials/integrations/kubernetes-gateway-api/canary.md +++ b/docs/tutorials/integrations/kubernetes-gateway-api/canary.md @@ -4,17 +4,21 @@ template: main.html # Canary release -This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a canary release strategy. +This tutorial shows how Iter8 can be used to release a basic Kubernetes application using a canary release strategy. + In a canary release, inference requests that match a particular pattern, for example those that have a particular header, are directed to the candidate version of the model. The remaining requests go to the primary, or initial, version of the model. + +![Canary release](../../images/canary.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the canary release strategy. -![Canary release](../../images/canary.png) - This tutorial uses the Kubernetes Gateway API to allow the use any service mesh that supports this API. In this case, we use demonstrate with [Linkerd](https://linkerd.io/). +*** + ???+ warning "Before you begin" 1. Ensure that you have a Kubernetes cluster and the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs. If using a local cluster (for example, [Kind](https://kind.sigs.k8s.io/) or [Minikube](https://minikube.sigs.k8s.io/docs/)), we recommend providing the cluster with at least 16GB of memory. 2. [Install Linkerd](https://linkerd.io/2.14/getting-started/). diff --git a/docs/tutorials/integrations/slack.md b/docs/tutorials/integrations/slack.md index 25766106..f2062d00 100644 --- a/docs/tutorials/integrations/slack.md +++ b/docs/tutorials/integrations/slack.md @@ -2,9 +2,9 @@ template: main.html --- -# Use Iter8 to send a message to a Slack channel +# Use Iter8 to send a Slack message -Iter8 provides a [`slack` task](../../user-guide/performance/tasks/slack.md) that sends a message to a Slack channel using a [webhook](https://api.slack.com/messaging/webhooks). +Iter8 provides a [`slack` task](../../user-guide/performance/tasks/slack.md) that can be used in a performance test to send a message to a Slack channel using a [webhook](https://api.slack.com/messaging/webhooks). ## Example diff --git a/docs/tutorials/mirror.md b/docs/tutorials/mirror.md index 8dd37150..69e2d97a 100644 --- a/docs/tutorials/mirror.md +++ b/docs/tutorials/mirror.md @@ -5,14 +5,18 @@ template: main.html # Mirrored release This tutorial shows how Iter8 can be used to release a new version of an application using mirroring. + When an application is mirrored, all requests are sent to the primary version of the application. A percentage of requests is replicated and sent to the candidate version of the model. This percentage can be changed over time. Only the responses from the primary version are returned to the user. + +![Mirrored release](images/mirror.png) + The user declaratively describes the desired application state at any given moment. An Iter8 `release` chart assists users who describe the application state at any given moment. The chart provides the configuration needed for Iter8 to automatically deploy application versions and configure the routing to implement the mirrored release strategy. -![Mirrored release](images/mirror.png) +*** ???+ warning "Before you begin" 1. Ensure that you have a Kubernetes cluster and the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and [`helm`](https://helm.sh/) CLIs. If using a local cluster (for example, [Kind](https://kind.sigs.k8s.io/) or [Minikube](https://minikube.sigs.k8s.io/docs/)), we recommend providing the cluster with at least 16GB of memory. diff --git a/docs/tutorials/performance/load-test-grpc-multiple.md b/docs/tutorials/performance/load-test-grpc-multiple.md index 2f9ab37f..36414b1b 100644 --- a/docs/tutorials/performance/load-test-grpc-multiple.md +++ b/docs/tutorials/performance/load-test-grpc-multiple.md @@ -4,7 +4,7 @@ template: main.html # Load test multiple gRPC methods -This tutorial expands on the tutorial [Single gRPC method](./load-test-grpc.md) by describing how to load test multiple gRPC methods. +This tutorial expands on the [Single gRPC method](./load-test-grpc.md) tutorial by describing how to load test multiple gRPC methods. ![load-test-grpc](../images/grpc.png) diff --git a/docs/tutorials/performance/load-test-http-multiple.md b/docs/tutorials/performance/load-test-http-multiple.md index c93cd1b1..2686bb19 100644 --- a/docs/tutorials/performance/load-test-http-multiple.md +++ b/docs/tutorials/performance/load-test-http-multiple.md @@ -4,7 +4,7 @@ template: main.html # Load test multiple HTTP endpoints -[Your first performance test](../../getting-started/first-performance.md) describes how to load test a single HTTP service. This tutorial expands on the previous tutorial and describes how to load test multiple HTTP endpoints. +This tutorial expands on the [Your first performance test](../../getting-started/first-performance.md) tutorial by describing how to load test multiple HTTP endpoints. ![load-test-http](../../getting-started/images/kubernetesusage.png) diff --git a/docs/user-guide/abn/about.md b/docs/user-guide/abn/about.md index fcd9c0e1..da05d819 100644 --- a/docs/user-guide/abn/about.md +++ b/docs/user-guide/abn/about.md @@ -15,9 +15,9 @@ The Iter8 SDK uses a fixed set of versions numbers (`0`, `1`, etc.) as a way to The Iter8 SDK provides two APIs to frontend application components: -a. **Lookup()** - Given an application and user session, returns a version number to be used as an index to a table of routes. So long as there are no changes in configuration, the version number (and hence the route) will be same for the same user session, guaranteeing session stickiness. +a. `Lookup()` - Given an application and user session, returns a version number to be used as an index to a table of routes. So long as there are no changes in configuration, the version number (and hence the route) will be same for the same user session, guaranteeing session stickiness. -b. **WriteMetric()** - Given an application, a user session, a metric name its value, *WriteMetric()* associates the metric value with the appropriate version of the application. +b. `WriteMetric()` - Given an application, a user session, a metric name its value, *WriteMetric()* associates the metric value with the appropriate version of the application. ## Configuring the Iter8 controller @@ -60,147 +60,6 @@ This `ConfigMap` describes an application `backend`. It identifies two versions As versions of a watched application are deployed or deleted, the Iter8 controller keeps track of which versions are available enabling it to respond appropriately to `Lookup()` and `WriteMetric()` requests. -## Developing frontend components: Using the SDK - -The basic steps to author a frontend application component using the Iter8 SDK are outlined below for *Node.js* and *Go*. Similar steps would be required for any gRPC supported language. - -### Use/import language specific libraries - -The gRPC protocol buffer definition is used to generate language specific implementation. These files can be used directly or packaged and imported as a library. As examples, the [Node.js sample](https://github.com/iter8-tools/docs/tree/main/samples/abn-sample/frontend/node) uses manually generated files directly. On the other hand, the [Go sample](https://github.com/iter8-tools/docs/tree/main/samples/abn-sample/frontend/go) imports the library provided by the core Iter8 service implementation. In addition to the API specific methods, some general gRPC libraries are required. - -=== "Node.js" - The manually generated node files [`abn_pd.js`](https://raw.githubusercontent.com/iter8-tools/docs/main/samples/abn-sample/frontend/node/abn_pb.js) and [`abn_grpc_pb.js`](https://raw.githubusercontent.com/iter8-tools/docs/main/samples/abn-sample/frontend/node/abn_grpc_pb.js) used in the sample application can be copied and used without modification. - - ```javascript - var grpc = require('@grpc/grpc-js'); - - var messages = require('./abn_pb.js'); - var services = require('./abn_grpc_pb.js'); - ``` - -=== "Go" - ```go - import ( - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - pb "github.com/iter8-tools/iter8/abn/grpc" - ) - ``` - -### Instantiate a gRPC client - -Instantiate a client to the Iter8 controller: - -=== "Node.js" - ```javascript - var client = new services.ABNClient(abnEndpoint, grpc.credentials.createInsecure()); - ``` - -=== "Go" - ```go - opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())} - conn, err := grpc.Dial(fmt.Sprintf("%s:%s", getAbnService(), getAbnServicePort()), opts...) - if err != nil { - panic("Cannot establish connection with abn service") - } - c := pb.NewABNClient(conn) - client = &c - ``` - -### Define routing - -Track identifiers are mapped to a static set of endpoints. One approach is to maintain a map from track identifier to endpoint: - -=== "Node.js" - ```javascript - const versionNumberToRoute = [ - "http://backend.default.svc.cluster.local:8091", - "http://backend-candidate-1.default.svc.cluster.local:8091", - ] - ``` - -=== "Go" - ```go - versionNumberToRoute = []string{ - "http://backend.default.svc.cluster.local:8091", - "http://backend-candidate-1.default.svc.cluster.local:8091", - } - ``` - -### Using `Lookup()` - -Given a user session identifier, `Lookup()` returns a version number that can be used to route requests. In code sample below, the user session identifier is assumed to be passed in the `X-User` header of user requests. The version number is used as an index to the `versionNumberToRoute` map defined above. A default is used if the call to `Lookup()` fails for any reason. - -=== "Node.js" - ```javascript - var application = new messages.Application(); - application.setName('default/backend'); - application.setUser(req.header('X-User')); - client.lookup(application, function(err, versionRecommendation) { - if (err) { - // use default route (see above) - console.warn("error calling Lookup()") - } else { - // use route determined by recommended track - console.info('lookup suggested track %d', versionRecommendation.getVersionnumber()) - versionNumber = versionRecommendation.getVersionnumber() - if (versionNumber != NaN && 0 <= versionNumber && versionNumber < versionNumberToRoute.length) { - route = versionNumberToRoute[versionNumber] - } - } - - // call backend service using route - ... - }); - ``` - -=== "Go" - ```go - route := versionNumberToRoute[0] - user := req.Header["X-User"][0] - s, err := (*client).Lookup( - ctx, - &pb.Application{ - Name: "default/backend", - User: user, - }, - ) - if err == nil && s != nil { - versionNumber := int(s.GetVersionNumber()) - if err == nil && 0 <= versionNumber && versionNumber < len(versionNumberToRoute) { - route = versionNumberToRoute[versionNumber] - } // else use default value for route - } - - // call backend service using route - ... - ``` - -### Using *WriteMetric()* - -As an example, a single metric named *sample_metric* is assigned a random value between 0 and 100 and written. - -=== "Node.js" - ```javascript - var mv = new messages.MetricValue(); - mv.setName('sample_metric'); - mv.setValue(random({min: 0, max: 100, integer: true}).toString()); - mv.setApplication('default/backend'); - mv.setUser(user); - client.writeMetric(mv, function(err, session) {}); - - ``` - -=== "Go" - ```go - _, _ = (*client).WriteMetric( - ctx, - &pb.MetricValue{ - Name: "sample_metric", - Value: fmt.Sprintf("%f", rand.Float64()*100.0), - Application: "default/backend", - User: user, - }, - ) - ``` +## Developing frontend components: use the SDK + +The basic steps to author a frontend application component using the Iter8 SDK are outlined [here](using-sdk.md) for *Node.js* and *Go*. Similar steps would be required for any gRPC supported language. diff --git a/docs/user-guide/abn/using-sdk.md b/docs/user-guide/abn/using-sdk.md index 30080928..ade08048 100644 --- a/docs/user-guide/abn/using-sdk.md +++ b/docs/user-guide/abn/using-sdk.md @@ -119,7 +119,7 @@ Given a user session identifier, `Lookup()` returns a version number that can be ... ``` -## Using *WriteMetric()* +## Using `WriteMetric()` As an example, a single metric named *sample_metric* is assigned a random value between 0 and 100 and written. diff --git a/docs/user-guide/install.md b/docs/user-guide/install.md index 5ae4c37c..1109f5b5 100644 --- a/docs/user-guide/install.md +++ b/docs/user-guide/install.md @@ -4,9 +4,7 @@ template: main.html # Install options -By default, Iter8 uses [BadgerDB](https://dgraph.io/docs/badger/) to store metrics from A/B/n and performance tests. BadgerDB is not suitable for production use. To install for production, use [Redis](metrics_store.md). - -## Install with `helm` +## With `helm` Iter8 can be installed and configured to watch resources either in a single namespace (namespace-scoped) or in the whole cluster (cluster-scoped). @@ -23,7 +21,7 @@ Iter8 can be installed and configured to watch resources either in a single name To install Iter8 in a non-default namespace, use the `-n` option. -## Install with `kustomize` +## With `kustomize` Iter8 can be installed and configured to watch resources either in a single namespace (namespace-scoped) or in the whole cluster (cluster-scoped). @@ -39,6 +37,10 @@ Iter8 can be installed and configured to watch resources either in a single name To install Iter8 in a non-default namespace, download the `kustomize` folder and modify the `namespace` field in the `kustomization.yaml` file. +## Install for production use + +By default, Iter8 uses [BadgerDB](https://dgraph.io/docs/badger/) to store metrics from A/B/n and performance tests. BadgerDB is not suitable for production use. To install for production, use [Redis](metrics_store.md). + ## Install using Rancher Desktop Rancher does not support a `standard` storage class by default. Install the [local path provisioner](https://github.com/rancher/local-path-provisioner/): @@ -55,4 +57,4 @@ And set `metrics.badgerdb.storageClassName` when starting the Iter8 controller: ## Install on OpenDataHub -See [https://github.com/opendatahub-io-contrib/odh-contrib-manifests/tree/main/iter8](https://github.com/opendatahub-io-contrib/odh-contrib-manifests/tree/main/iter8) \ No newline at end of file +See [here](https://github.com/opendatahub-io-contrib/odh-contrib-manifests/tree/main/iter8). \ No newline at end of file diff --git a/docs/user-guide/performance/tasks/github.md b/docs/user-guide/performance/tasks/github.md index 2d0eb6e5..283eb341 100644 --- a/docs/user-guide/performance/tasks/github.md +++ b/docs/user-guide/performance/tasks/github.md @@ -8,7 +8,7 @@ Trigger GitHub workflows via a [repository_dispatch](https://docs.github.com/en/ A `repository_dispatch` will trigger workflows in the default branch of the GitHub repository. By default, an summary of the performance test will also be sent. -## Usage Example +## Usage example ```shell helm upgrade --install \ diff --git a/docs/user-guide/performance/tasks/grpc.md b/docs/user-guide/performance/tasks/grpc.md index 9e75689e..e831dac8 100644 --- a/docs/user-guide/performance/tasks/grpc.md +++ b/docs/user-guide/performance/tasks/grpc.md @@ -148,7 +148,7 @@ helm upgrade --install \ In this example, all three endpoints will have a `skipFirst` of 5. -## Grafana Dashboard +## Grafana dashboard The results of the `grpc` task is visualized using the `grpc` Iter8 Grafana dashboard. The dashboard can be found [here](https://raw.githubusercontent.com/iter8-tools/iter8/v1.1.1/grafana/grpc.json). diff --git a/docs/user-guide/performance/tasks/http.md b/docs/user-guide/performance/tasks/http.md index 08deeb18..2ca9d2fb 100644 --- a/docs/user-guide/performance/tasks/http.md +++ b/docs/user-guide/performance/tasks/http.md @@ -119,7 +119,7 @@ helm upgrade --install \ In this example, all three endpoints will have a `numRequests` of 50. -## Grafana Dashboard +## Grafana dashboard The results of the `http` task is visualized using the `http` Iter8 Grafana dashboard. The dashboard can be found [here](https://raw.githubusercontent.com/iter8-tools/iter8/v1.1.1/grafana/http.json). diff --git a/docs/user-guide/performance/tasks/slack.md b/docs/user-guide/performance/tasks/slack.md index 624119c9..b37e2471 100644 --- a/docs/user-guide/performance/tasks/slack.md +++ b/docs/user-guide/performance/tasks/slack.md @@ -6,7 +6,7 @@ template: main.html Send an performance test summary in a message to a Slack channel using a [incoming webhook](https://api.slack.com/messaging/webhooks). -## Usage Example +## Usage example ```shell helm upgrade --install \ diff --git a/docs/user-guide/uninstall.md b/docs/user-guide/uninstall.md index 968a48b9..b33560b6 100644 --- a/docs/user-guide/uninstall.md +++ b/docs/user-guide/uninstall.md @@ -2,17 +2,15 @@ template: main.html --- -## Uninstall with `helm` - -If installed with `helm`, uninstall with: +## With `helm` ```shell helm delete iter8 ``` -## Uninstall with `kustomize` +## With `kustomize` -If installed with `kustomize`, uninstall with one of the following: +Uninstall with one of the following, depending on whether Iter8 was installed and configured for a single namespace (namespace-scoped) or for the whole cluster (cluster-scoped). === "Namespace-scoped" ```shell diff --git a/mkdocs.yml b/mkdocs.yml index 7e63b72c..941add9e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -168,7 +168,7 @@ nav: - Using new resource types: user-guide/abn/extension.md - Performance testing: - Parameters: user-guide/performance/parameters.md - - Test Tasks: + - Tasks: - http: user-guide/performance/tasks/http.md - grpc: user-guide/performance/tasks/grpc.md - ready: user-guide/performance/tasks/ready.md