Skip to content

Commit

Permalink
add zipkin request tracing for Knative functions
Browse files Browse the repository at this point in the history
Signed-off-by: Shyam Jesal <s.jesalpura@gmail.com>
  • Loading branch information
shyamjesal committed Mar 3, 2021
1 parent 2f563f1 commit c1c7cfd
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cri_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ jobs:
run: sudo containerd &

- name: Create k8s cluster
run: ./scripts/cluster/create_one_node_cluster.sh stock-only && sleep 2m
run: ./scripts/cluster/create_one_node_cluster.sh stock-only

- name: Deploy zipkin
run: ./scripts/setup_zipkin.sh && sleep 2m

- name: Create helloworld container
run: KUBECONFIG=/etc/kubernetes/admin.conf kn service create helloworld-go --image gcr.io/knative-samples/helloworld-go --env TARGET="vHive CRI test"
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
### Added
- Support for MinIO S3 storage (non-replicated, non-distributed).
- MicroVMs can now access the internet by default using custom host interface. (default route interface is used if no argument is provided)
- Knative serving now can be tested separately from vHive. More info [here](https://github.com/ease-lab/vhive/wiki/Debugging-Knative-functions).
- Knative serving now can be tested separately from vHive. More info [here](./docs/developers_guide.md#Testing-stock-Knative-images).
- Zipkin support added for tracing Knative function call requests. More info [here](./docs/developers_guide.md#Knative-request-tracing)

### Changed

Expand Down
4 changes: 4 additions & 0 deletions configs/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Ipsum
ISA
ISCA
ISPASS
istioctl
jekyll
Jevdjic
Joshi
Expand Down Expand Up @@ -165,6 +166,7 @@ Lim
Linearizable
linter
LLC
localhost
Lorem
Lotfi
lsi
Expand Down Expand Up @@ -335,3 +337,5 @@ yaml
yml
YY
Zhu
zipkin
Zipkin
1 change: 1 addition & 0 deletions cri/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test:
sleep 1s

./../scripts/cluster/create_one_node_cluster.sh
source /etc/profile && ./../scripts/setup_zipkin.sh
sleep 2m

KUBECONFIG=/etc/kubernetes/admin.conf kn service apply helloworld -f ./../configs/knative_workloads/helloworld.yaml
Expand Down
6 changes: 6 additions & 0 deletions docs/developers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ A test that is integrated with vHive-CRI orchestrator via a programmatic interfa
allows to analyze latency breakdown of boot-based and snapshot cold starts,
using detailed latency and memory footprint metrics.

## Knative request tracing
Knative function call requests can now be traced & visualized using [zipkin](https://zipkin.io/). Zipkin is a distributed tracing system featuring easy collection and lookup of tracing data. Checkout [this](https://www.scalyr.com/blog/zipkin-tutorial-distributed-tracing/) for a quickstart guide.

* Once the zipkin container is running, start the dashboard using `istioctl dashboard zipkin`.
* To access requests remotely, run `ssh -L 9411:127.0.0.1:9411 <Host_IP>` for port forwarding.
* Go to your browser and enter [localhost:9411](http://localhost:9411) for the dashboard.

## Dependencies and binaries

Expand Down
5 changes: 4 additions & 1 deletion scripts/cluster/setup_master_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ kubectl create secret generic -n metallb-system memberlist --from-literal=secret
kubectl apply -f $ROOT/configs/metallb/metallb-configmap.yaml

# istio
cd $ROOT
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.7.1 TARGET_ARCH=x86_64 sh -
./istio-1.7.1/bin/istioctl install -f $ROOT/configs/istio/istio-minimal-operator.yaml
export PATH=$PATH:$ROOT/istio-1.7.1/bin
sudo sh -c "echo 'export PATH=$PATH:$ROOT/istio-1.7.1/bin' >> /etc/profile"
istioctl install -f $ROOT/configs/istio/istio-minimal-operator.yaml

# Install KNative in the cluster
if [ "$STOCK_CONTAINERD" == "stock-only" ]; then
Expand Down
32 changes: 32 additions & 0 deletions scripts/setup_zipkin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MIT License
#
# Copyright (c) 2020 Shyam Jesalpura and EASE lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

#!/bin/bash

# install zipkin pods
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.9/samples/addons/extras/zipkin.yaml

# enable tracing in Knative
kubectl patch configmap/config-tracing \
-n knative-serving \
--type merge \
-p '{"data":{"backend":"zipkin","zipkin-endpoint":"http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans","debug":"true"}}'

0 comments on commit c1c7cfd

Please sign in to comment.