Skip to content

[DX-4048] use dynamic ChIP Ingress/Router host port allocation#22315

Merged
Tofel merged 4 commits intodevelopfrom
dx-4048-fix-cre-flakes-ci
May 6, 2026
Merged

[DX-4048] use dynamic ChIP Ingress/Router host port allocation#22315
Tofel merged 4 commits intodevelopfrom
dx-4048-fix-cre-flakes-ci

Conversation

@Tofel
Copy link
Copy Markdown
Contributor

@Tofel Tofel commented May 6, 2026

Instead of using static ports ChIP Ingress and ChIP Router will now defer to Docker to select a free host port. That will allow us to avoid conflicts with GHA Runner Listener process like this one:

Error: failed to start environment: failed to setup test environment: failed to start chip router: start container: container start: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint chip-router-0f2f3 (f1100fb23598a5f9d398ba758663cc4f25d53872e3c7ce1552bca37eedd18e6a): failed to bind host port for 0.0.0.0:50050:172.18.0.2:50050/tcp: address already in use

Port 50050 is already in use by:
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
Runner.Li 1155 runner  143u  IPv6  10454      0t0  TCP 10.1.36.185:50050->20.85.130.105:443 (ESTABLISHED)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 6, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link
Copy Markdown

@Tofel Tofel marked this pull request as ready for review May 6, 2026 13:24
Copilot AI review requested due to automatic review settings May 6, 2026 13:24
@Tofel Tofel requested review from a team as code owners May 6, 2026 13:24
@Tofel Tofel added this pull request to the merge queue May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: MEDIUM

This PR updates the local CRE/Beholder and system-test configuration flow to support dynamic ChIP Ingress/Router host port allocation, avoiding hard-coded/default gRPC ports and passing the router’s internal gRPC URL into generated node configs.

Changes:

  • Stop forcing a fixed --grpc-port when starting Beholder/ChIP Ingress; allow Docker to assign the host port when unspecified.
  • Plumb Chip Router internal gRPC URL through CRE environment setup into generated node TOMLs (Telemetry ChipIngress endpoint).
  • Bump chainlink-testing-framework chiprouter/dockercompose component versions and adjust GitHub Actions workflows/env vars accordingly.

Targeted areas for scrupulous human review

  • system-tests/lib/cre/environment/environment.go: new dereference of input.ChipRouterInput.Out.InternalGRPCURL (possible nil output / API expectation mismatch with CTF).
  • core/scripts/cre/environment/environment/beholder.go: behavior when --grpc-port=0 (dynamic port) vs existing port-availability checks and downstream registration assumptions.
  • .github/workflows/*: YAML line-splitting around runs-on labels and image env vars—ensure rendered values are exactly as intended in GitHub Actions.

Reviewed changes

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

Show a summary per file
File Description
system-tests/tests/test-helpers/beholder_provider.go Starts Beholder without passing a fixed gRPC port (dynamic allocation).
system-tests/tests/go.mod Bumps CTF chiprouter version.
system-tests/tests/go.sum Updates sums for bumped CTF components.
system-tests/lib/go.mod Bumps CTF chiprouter/dockercompose and adds indirect protocompile.
system-tests/lib/go.sum Updates sums for bumped CTF components and new indirects.
system-tests/lib/cre/types.go Adds Chip Router internal gRPC URL to config-generation input + validation.
system-tests/lib/cre/environment/environment.go Passes Chip Router internal gRPC URL into DON config generation.
system-tests/lib/cre/don/config/config.go Uses provided Chip Router internal gRPC URL for Telemetry ChipIngress endpoint.
core/scripts/go.mod Updates dockercompose dep; moves chiprouter to indirect.
core/scripts/go.sum Updates sums for bumped CTF components.
core/scripts/cre/environment/environment/beholder.go Defaults --grpc-port to 0 (dynamic) and registers Beholder via internal gRPC URL.
.github/workflows/cre-system-tests.yaml Updates env var names/formatting for Chip components and runner labels.
.github/workflows/cre-soak-memory-leak.yml Updates env var names/formatting for Chip components and runner labels.
.github/workflows/cre-regression-system-tests.yaml Updates env var names/formatting and improves shell quoting/flow.

Comment on lines 175 to 183
updatedNodeSets, topoErr := donconfig.PrepareNodeTOMLs(
ctx,
topology,
creEnvironment,
input.NodeSets,
input.Capabilities,
input.ConfigFactoryFunctions,
input.ChipRouterInput.Out.InternalGRPCURL,
)

cmd.Flags().DurationVarP(&timeout, "wait-on-error-timeout", "w", 15*time.Second, "Time to wait before removing Docker containers if environment fails to start (e.g. 10s, 1m, 1h)")
cmd.Flags().IntVarP(&port, "grpc-port", "g", ctfchiprouter.DefaultBeholderGRPCPort, "GRPC port for downstream Chip Ingress")
cmd.Flags().IntVarP(&port, "grpc-port", "g", 0, "GRPC port for downstream Chip Ingress")
return fmt.Errorf("no addresses found for home chain %d in datastore", g.RegistryChainSelector)
}
// TODO check for required registry contracts by type and version
if g.ChipRouterInternalGRPCURL == "" {
Merged via the queue into develop with commit 781f360 May 6, 2026
230 of 233 checks passed
@Tofel Tofel deleted the dx-4048-fix-cre-flakes-ci branch May 6, 2026 13:48
yashnevatia pushed a commit that referenced this pull request May 7, 2026
* use dynamic ChIP Ingress/Router host port allocation

* lint fix

* fix actionlints

* tagged CTF
yashnevatia pushed a commit that referenced this pull request May 8, 2026
* use dynamic ChIP Ingress/Router host port allocation

* lint fix

* fix actionlints

* tagged CTF
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.

4 participants