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

.github/workflows/action-test-smoke: Add a step to verify the jeager #794

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/action-test-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ jobs:
with:
name: test-img
path: dist
- name: enable OTLP
- name: Enable OTLP
if: ${{ inputs.runtime == 'wasmtime' }}
run: |
sudo ./scripts/setup-otel.sh
- name: run
sudo ./scripts/setup-jeager-and-otel.sh
- name: Run wasi-demo-app using ctr
timeout-minutes: 5
run: |
ls -alh dist
ls -alh dist/bin
make load
sudo cp -f dist/bin/* /usr/local/bin
sudo ctr run --rm --runtime=io.containerd.${{ inputs.runtime }}.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello'
- name: Verify Jaeger traces
if: ${{ inputs.runtime == 'wasmtime' }}
run: |
sleep 5
sudo ./scripts/verify-jaeger-traces.sh
4 changes: 3 additions & 1 deletion scripts/setup-otel.sh → scripts/setup-jeager-and-otel.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euxo pipefail

# start jeager endpoint
docker run -d -p16686:16686 -p4317:4317 -p4318:4318 -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:latest
Expand All @@ -11,7 +12,8 @@ mkdir -p /etc/systemd/system/containerd.service.d
cat <<EOF > /etc/systemd/system/containerd.service.d/override.conf
[Service]
Environment="OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318"
Environment="OTEL_SERVICE_NAME=wasmtime"
Environment="OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf"
Environment="OTEL_SERVICE_NAME=containerd"
EOF

systemctl daemon-reload
Expand Down
17 changes: 17 additions & 0 deletions scripts/verify-jaeger-traces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

TRACE_DATA=$(curl -s "http://localhost:16686/api/traces?service=containerd&limit=0" \
| jq '[ .data[].spans[].operationName ]')

REQUIRED_OPS=("task_create" "task_wait" "task_start" "task_delete" "task_state" "wait" "shutdown" "shim_main_inner")

for op in "${REQUIRED_OPS[@]}"; do
COUNT=$(echo "$TRACE_DATA" | jq --arg op "$op" '[ .[] | select(. == $op) ] | length')
if [ "$COUNT" -eq 0 ]; then
echo "Operation '$op' not found in Jaeger!"
exit 1
fi
done

echo "All required operations found in Jaeger!"
Loading