Skip to content

chore(systest): sync Grafana dashboards in run_systest.sh#10494

Open
basvandijk wants to merge 3 commits into
masterfrom
bas/dashboards-via-run-systest
Open

chore(systest): sync Grafana dashboards in run_systest.sh#10494
basvandijk wants to merge 3 commits into
masterfrom
bas/dashboards-via-run-systest

Conversation

@basvandijk

@basvandijk basvandijk commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

We're deprecating the ict tool. The last remaining use case for ict was that it would automatically checkout the Grafana dashboards from the dfinity-ops/k8s repository.

This functionality has been moved into rs/tests/run_systest.sh, gated by a new IC_DASHBOARDS_BRANCH environment variable. run_systest.sh is the single chokepoint for both the plain testnet driver and the colocated wrapper, so exporting IC_DASHBOARDS_DIR there makes dashboards work uniformly with no Rust changes:

  • The non-colocated driver reads IC_DASHBOARDS_DIR as before (prometheus_vm.rs).
  • The colocated wrapper (colocate_test.rs) already tars IC_DASHBOARDS_DIR, ships it to the UVM and re-exports it into the inner docker container.

A pre-set IC_DASHBOARDS_DIR (e.g. a local clone) is honored and skips the checkout.

Changes

  • run_systest.sh: sparse-checkout bases/apps/ic-dashboards when IC_DASHBOARDS_BRANCH is set and IC_DASHBOARDS_DIR is not; non-fatal on failure.
  • ict testnet create: sets IC_DASHBOARDS_BRANCH from --k8s-branch instead of doing the checkout itself (dashboards remain on by default).
  • ict test: drops its dashboard checkout (the driver runs in a sandbox without SSH/network, so a runtime checkout can't work there).
  • helpers.go: removes the now-unused sparse_checkout helper.
  • README_NEW.md: documents the IC_DASHBOARDS_BRANCH workflow.

Usage

IC_DASHBOARDS_BRANCH=main bazel run //rs/tests/testnets:small -- --keepalive

Testing

  • bazel build //rs/tests/ict //rs/tests/ict/cmd passes; gofmt clean; bash -n rs/tests/run_systest.sh clean.
  • Manual end-to-end run requires Farm + SSH access to the k8s repo (not runnable in CI sandbox).

Move the dfinity-ops/k8s Grafana dashboard checkout out of the `ict` Go
tool and into rs/tests/run_systest.sh, gated by the new IC_DASHBOARDS_BRANCH
environment variable.

Doing the checkout in run_systest.sh makes it work uniformly for both plain
testnets (`bazel run //rs/tests/testnets:...`) and colocated tests: the
resulting directory is exported as IC_DASHBOARDS_DIR which is already read by
the test driver (prometheus_vm.rs) and forwarded into the colocated UVM by
colocate_test.rs. A pre-set IC_DASHBOARDS_DIR (e.g. a local clone) is honored
and skips the checkout.

- run_systest.sh: sparse-checkout the dashboards when IC_DASHBOARDS_BRANCH is
  set and IC_DASHBOARDS_DIR is not; non-fatal on failure.
- ict testnet create: set IC_DASHBOARDS_BRANCH from --k8s-branch instead of
  checking out the repo itself (dashboards stay on by default).
- ict test: drop the dashboard checkout (the driver runs in a sandbox without
  SSH/network so a runtime checkout cannot work there).
- helpers.go: remove the now-unused sparse_checkout helper.
- README_NEW.md: document the IC_DASHBOARDS_BRANCH workflow.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR relocates the Grafana dashboard checkout logic from the ict Go CLI into rs/tests/run_systest.sh so dashboards can be provisioned consistently for both plain testnet runs and colocated system tests via IC_DASHBOARDS_DIR.

Changes:

  • Add optional, best-effort sparse checkout of bases/apps/ic-dashboards from dfinity-ops/k8s in run_systest.sh, controlled by IC_DASHBOARDS_BRANCH, exporting IC_DASHBOARDS_DIR.
  • Update ict testnet create to set IC_DASHBOARDS_BRANCH (instead of performing the checkout itself) and remove dashboard syncing from ict test.
  • Remove the now-unused Go helper used for sparse checkouts and document the new workflow in README_NEW.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
rs/tests/run_systest.sh Adds gated dashboards sync + exports IC_DASHBOARDS_DIR from a sparse checkout.
rs/tests/README_NEW.md Documents how to enable dashboards via IC_DASHBOARDS_BRANCH / IC_DASHBOARDS_DIR.
rs/tests/ict/cmd/testnetCreateCmd.go Switches to passing IC_DASHBOARDS_BRANCH for run_systest.sh to handle syncing.
rs/tests/ict/cmd/testCmd.go Removes dashboard checkout logic and the associated flag from ict test.
rs/tests/ict/cmd/helpers.go Removes the unused sparse_checkout helper and related imports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/tests/run_systest.sh Outdated
Comment thread rs/tests/run_systest.sh Outdated
Comment thread rs/tests/README_NEW.md Outdated
IDX GitHub Automation and others added 2 commits June 16, 2026 18:47
- run_systest.sh: make the previous-checkout cleanup non-fatal so a failed
  `rm` can't abort the test run under `set -e`.
- run_systest.sh: run `git clone` with `GIT_SSH_COMMAND="ssh -oBatchMode=yes"`
  so a missing SSH key / unknown host key fails fast instead of hanging on an
  interactive prompt; also clone shallowly (`--depth 1`).
- README_NEW.md: clarify that the `ict testnet create` dashboard sync is
  best-effort and the testnet is still deployed if it fails.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread rs/tests/run_systest.sh
echo "Syncing Grafana dashboards from k8s branch '$IC_DASHBOARDS_BRANCH' ..." >&2
# Don't let a missing SSH key / unknown host key block the run by prompting
# interactively; fail fast instead (the sync is best-effort, see below).
if GIT_SSH_COMMAND="ssh -oBatchMode=yes" \
Comment on lines 176 to +180
env := os.Environ()
cmd.Println(GREEN + "Will try to sync dashboards from k8s branch: " + cfg.k8sBranch)
icDashboardsDir, err := sparse_checkout("git@github.com:dfinity-ops/k8s.git", "", []string{"bases/apps/ic-dashboards"}, cfg.k8sBranch)
if err != nil {
cmd.PrintErrln(YELLOW + "Failed to sync k8s dashboards. Received the following error: " + err.Error())
} else {
cmd.PrintErrln(GREEN + "Successfully synced dashboards to path " + icDashboardsDir)
icDashboardsDir = filepath.Join(icDashboardsDir, "bases", "apps", "ic-dashboards")
cmd.Println(GREEN + "Will use " + icDashboardsDir + " as a root for dashboards")
env = append(env, "IC_DASHBOARDS_DIR="+icDashboardsDir)
}
// run_systest.sh syncs the Grafana dashboards from this k8s branch and exposes
// them to the test driver via the IC_DASHBOARDS_DIR environment variable.
cmd.Println(GREEN + "Dashboards will be synced from k8s branch: " + cfg.k8sBranch + NC)
env = append(env, "IC_DASHBOARDS_BRANCH="+cfg.k8sBranch)
@basvandijk basvandijk marked this pull request as ready for review June 16, 2026 19:01
@basvandijk basvandijk requested a review from a team as a code owner June 16, 2026 19:01
@github-actions github-actions Bot added the @idx label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants