feat: general service discovery for farm testnets #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MSD Diff | |
on: | |
pull_request: | |
branches: | |
- "main" | |
paths: | |
- "rs/ic-observability/multiservice-discovery*/src/**" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
msd-diff: | |
runs-on: | |
labels: dre-runner-custom | |
# This image is based on ubuntu:20.04 | |
container: ghcr.io/dfinity/dre/actions-runner:3dd4f38f076cad73fdcc68ad37fd29bed4fa3e4d | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: "🔧 Setup runner" | |
uses: ./.github/workflows/manage-runner-pre | |
- name: "📥 Download main test artifact" | |
uses: dawidd6/action-download-artifact@v9 | |
with: | |
name: test-artifacts | |
branch: main | |
workflow: main.yaml | |
- name: "🔭 Compute MSD" | |
id: msd-diff | |
shell: bash | |
run: | | |
set -exuo pipefail | |
REGISTRY_DIR_MAIN="$HOME/tmp/main-registry" | |
TARGETS_DIR_MAIN="$HOME/main-targets" | |
TARGETS_DIR_BRANCH="$HOME/branch-targets" | |
mkdir -p "$REGISTRY_DIR_MAIN" \ | |
"$TARGETS_DIR_MAIN" \ | |
"$TARGETS_DIR_BRANCH" | |
chmod +x multiservice-discovery | |
# Run multiservice-discovery for main targets | |
./multiservice-discovery \ | |
--targets-dir "$REGISTRY_DIR_MAIN" \ | |
--render-prom-targets-to-stdout > "$TARGETS_DIR_MAIN/targets.json" | |
# Run multiservice-discovery for branch targets with bazel | |
bazel run //rs/ic-observability/multiservice-discovery -- \ | |
--targets-dir "$REGISTRY_DIR_MAIN" \ | |
--skip-update-local-registry \ | |
--render-prom-targets-to-stdout > "$TARGETS_DIR_BRANCH/targets.json" | |
echo "targets_main=$TARGETS_DIR_MAIN" >> $GITHUB_OUTPUT | |
echo "targets_branch=$TARGETS_DIR_BRANCH" >> $GITHUB_OUTPUT | |
- name: "Check MSD Diff" | |
uses: "int128/diff-action@v1" | |
with: | |
base: ${{ steps.msd-diff.outputs.targets_main }} | |
head: ${{ steps.msd-diff.outputs.targets_branch }} | |
comment-header: "MSD Diff" |