Skip to content

Install from Topolograph: configure.sh, client.py --answers, boot service - #8

Merged
Vadims06 merged 67 commits into
mainfrom
feat/watcher-onboarding
Oct 24, 2026
Merged

Vadims06 merged 67 commits into
mainfrom
feat/watcher-onboarding

Conversation

@Vadims06

Copy link
Copy Markdown
Owner

Summary

Install IS-IS Watcher from Topolograph's Watchers page (https://github.com/Vadims06/flask-visual/pull/69) in GRE or BGP-LS mode.

  • configure.sh: checks dependencies (iptables and conntrack for GRE), fetches each watcher's answers with its own token, rebuilds every watcher of the checkout through client.py --action add_watcher --answers, then (re)starts topolograph-isiswatcher.service. Siblings are matched by watcher_id, so a rotated token does not stop it; a watcher deleted in Topolograph stops it with the exact removal command.
  • topolograph-isiswatcher.service + onboarding/start.sh: redeploy the containerlab topologies at boot (veth, netns and GRE do not survive a reboot) and start Fluent Bit.
  • client.py --answers: the same files as the interactive dialog for the same answers (checked), plus pinned images, the watcher id label and Topolograph address/token in the node env. The dialog is unchanged.
  • Fluent Bit: fluentbit/onboarding.yaml includes one watchers/<watcher>.yaml per watcher with its own token as Bearer; fluent-bit no longer joins topolograph_backend and restarts unless stopped.
  • VERSION, WATCHER_VERSION, REGISTRY_PREFIX; manifest; contract CI; README quick start.
  • Needs the image from isiswatcher_internal feat/watcher-onboarding (Bearer upload). GRE pins vadims06/frr:v8.5.4, which still has to be published from quay.io/frrouting/frr:8.5.4.

Test plan

  • Watcher host: GRE (FRR IS-IS over GRE): graph, heartbeat and events with the watcher token; the watcher recovers once the adjacency comes up
  • BGP-LS on a host (same code as OSPF BGP-LS, not run)

@Vadims06

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e578ed6dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client.py Resolved
Comment thread client.py Resolved
Comment thread docker-compose.yml Resolved
Comment thread client.py Resolved
Comment thread onboarding/manifest.json Resolved
Comment thread .github/workflows/onboarding.yml Resolved
@Vadims06

Copy link
Copy Markdown
Owner Author

Addressed in 11b2651. Same changes in ospfwatcher#32, which shares this code.

  • Log on rebuild: kept when it already exists.
  • Renamed topology: configure.sh destroys every old topology before rebuilding. The service redeploys all of them, and Fluent Bit inputs of folders that no longer exist are pruned. A watcher that fails to build no longer keeps the others down.
  • Tail offsets: a db in a named volume. start.sh now starts Fluent Bit before the watchers, so a new log is tailed from byte 0.
  • Existing checkout: the install block fetches and detaches at {ref}.
  • WATCHER_VERSION: falls back to the VERSION tag, and check_contract.py enforces that they match.
  • Workflow: github.ref_name goes through env in both steps, and the dispatch accepts only vX.Y.Z tags.
  • Also: config.yml and the Fluent Bit input, which both hold the token, are now created 0600 before the first write. bgpls_router_id is ipv4.

@Vadims06

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to set up container
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Vadims06

Copy link
Copy Markdown
Owner Author

README: installing from Topolograph's Watchers page is now the main method. The manual client.py / .env walkthrough, heartbeat setup and ELK are kept under collapsible Manual setup blocks; device configuration stays visible. Quick start shows the current install command.

@Vadims06

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 688759a1e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Vadims06

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11f3a8b3ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/onboarding.yml Resolved
Comment thread configure.sh Resolved
Comment thread onboarding/manifest.json Resolved
Comment thread onboarding/manifest.json Resolved
@Vadims06

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc4e18e862

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client.py Resolved
Comment thread onboarding/manifest.json Resolved
Comment thread client.py Resolved
Comment thread configure.sh Resolved
@Vadims06

Vadims06 commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9ef3005e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client.py Resolved
Comment thread client.py Resolved
@Vadims06

Vadims06 commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b5f87421a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread onboarding/start.sh Resolved
Comment thread onboarding/manifest.json Resolved
@Vadims06

Vadims06 commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: f0b9587f00

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Vadims06

Vadims06 commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07b9d75a6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Resolved
Comment thread client.py Resolved
Comment thread client.py Resolved
Comment thread onboarding/manifest.json Resolved
@Vadims06

Vadims06 commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Vadims06

Vadims06 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Status of the last review round (reviewed a765f769/097bad91 and 07b9d75a/c587fce7). Both repos share this code.

Already fixed on the head

  • Failed containerlab destroy (P2): configure.sh now stops before moving or replacing any configuration.
  • Tunnel address equal to the router source IP (P2): client.py rejects it in the answers path and in the interactive dialog.
  • Fluent Bit state keyed by folder name (P2): tag, tail DB and output are keyed by the immutable watcher_id.
  • Logstash exporters needing Topolograph's network (P2): the manual profile no longer attaches to it.

Declined

  • Keeping the previous watcher folder until systemctl restart succeeds (P2): a watcher folder is a pure product of its registration on the Watchers page, so a failed deploy of the new configuration is fixed by correcting the registration and running the command again. The EXIT trap already brings the watchers back up after a failed step, and a failed rebuild restores the previous folder.
  • Watcher token in the process arguments (P1): the token only authorises uploads of its own watcher's data, the host is dedicated to the watcher, and the command follows the registration-token model (--token on the command line) already used by CI runner installers. Passing it any other way still leaves it in the shell history of the pasted command.
  • Junos type internal for differing ASNs (P2): the example carries the eBGP instruction (type external and multihop) as a comment next to the line, and the form states that a different AS makes the session eBGP.

@codex review

@Vadims06

Vadims06 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: c587fce7fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Vadims06

Vadims06 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

The same firewall-rule ownership change as ospfwatcher#32 (P2 raised there): GRE rules carry -m comment --comment topolograph-isiswatcher and cleanup deletes only those.

@Vadims06

Vadims06 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a8f8de900

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client.py Outdated
# Kept until the rebuild succeeds, so a failed one leaves the working watcher in place
backup_path = os.path.join(self.watcher_root_folder_path, f".{existing_folder}.previous")
shutil.rmtree(backup_path, ignore_errors=True)
os.rename(os.path.join(self.watcher_root_folder_path, existing_folder), backup_path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recover backups left by an interrupted rebuild

When Docker is restarted or the host shuts down after this rename but before _build_from_answers() finishes writing the replacement config, the Python process can be terminated without entering the except BaseException restoration path. The only valid config then remains under .watcher...previous, while onboarding/start.sh only scans watcher/watcher[0-9]*/config.yml, so the watcher remains undeployed after Docker or the host returns. Build in a staging directory and swap atomically, or recover leftover .previous directories before deployment.

Useful? React with 👍 / 👎.

Comment thread onboarding/manifest.json Outdated
"router_examples": [
{
"vendor": "Cisco",
"config": "interface Tunnel{gre_tunnel_number}\n ip address {gre_tunnel_ip_w_mask_network_device}\n tunnel mode gre ip\n tunnel source {gre_tunnel_network_device_ip}\n tunnel destination {host_interface_device_ip}\n ip router isis <name>\n isis network point-to-point"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Render a Cisco-compatible interface mask

For every GRE answer, gre_tunnel_ip_w_mask_network_device is an ip_interface value such as 10.0.0.1/30—the interactive client likewise asks for x.x.x.x/yy—but this template emits it verbatim after ip address. Cisco IOS XE requires ip address ip-address mask and shows a dotted-decimal mask in its example (Cisco IOS XE configuration guide), so pasting the generated configuration is rejected and GRE onboarding cannot complete. Convert the prefix length to a dotted-decimal mask before rendering this Cisco example.

Useful? React with 👍 / 👎.

Comment thread onboarding/manifest.json Outdated
"env": "REGISTRY_PREFIX",
"source": "default",
"default": "",
"pattern": "^([A-Za-z0-9.-]+(:[0-9]+)?(/[A-Za-z0-9._-]+)*/)?$",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject invalid uppercase mirror namespaces

When a user enters a prefix such as mirror.example.com/Team/, this pattern accepts it, but configure.sh then constructs image names such as mirror.example.com/Team/vadims06/isis-watcher:... and Docker rejects the pull. Docker Registry repository path components must match [a-z0-9]+(?:[._-][a-z0-9]+)* (Docker Registry API documentation), so restrict namespace components to that lowercase grammar while still allowing a registry hostname and port.

Useful? React with 👍 / 👎.

@Vadims06

Vadims06 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Round on 2a8f8de9, fixed in 81daa2a:

  • Cisco tunnel address (P2): the Cisco example renders the tunnel address as address netmask (rendered by Topolograph from the answer).
  • Mirror prefix (P2): namespace components are lowercase only.
  • Same configure.sh changes as ospfwatcher#32: iptables required for deployed GRE watchers, one run per checkout, .env restored when the image preflight fails.

Declined: backup left by a host crash during a rebuild (P2). It needs the process to die inside the rename-to-write window, and a watcher folder is rebuilt from its registration on the Watchers page by running the command again.

@Vadims06

Vadims06 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

A PSNP with no TLVs is exactly 17 bytes, so the unconditional 19-byte read dropped a valid one.
router2 advertised TE Router ID 10.10.10.1, colliding with router1's
own address, instead of its own loopback 10.10.10.2.
Announcement filter: tc-BPF on the tunnel egress instead of XDP
isis01 lab: FRR 10.8 stable, TE on the router4 LAN
Fluent Bit: temetric fields when the link has no SRLG
…f client.py

Remove client.py, its interactive dialog and tests, and the contract check script;
add per-mode templates under watcher/watcher-template; replace the Elastic index
step with curl on pinned index-template JSON files.
Install with the watcher image's render instead of client.py
onboarding/diagnostic.sh passes the host's iptables-save -c to the Rust
diagnostic subcommand, which has no iptables binary of its own. The Python
diagnostic.py (409 lines) is removed.
VERSION, .env.template and the release notes move to v4.0.0. The notes lead
with the Rust watcher, the built-in diagnostic and the one restart every
watcher makes on the upgrade.
Troubleshoot with onboarding/diagnostic.sh instead of diagnostic.py
Version v4.0.0: the Rust watcher
The Rust watcher reads the LSDB from FRR's JSON, which FRR 8.5.4 lays out
differently, so the published topology came out empty. FRR 10.8 runs IS-IS
over GRE; no hostname dynamic keeps LSP ids as system ids.
IS-IS watcher router: FRR 10.8 and no hostname dynamic
@Vadims06
Vadims06 merged commit 0bfb650 into main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant