Skip to content

Discover the agent address from BLACKSMITH_AGENT_ADDR - #122

Merged
piob-io merged 1 commit into
release/v2from
agent-addr-discovery
Jul 30, 2026
Merged

Discover the agent address from BLACKSMITH_AGENT_ADDR#122
piob-io merged 1 commit into
release/v2from
agent-addr-discovery

Conversation

@piob-io

@piob-io piob-io commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Discovers the Blacksmith agent through the BLACKSMITH_AGENT_ADDR env var the agent advertises on every platform (FastActions/fa#4816); the agent gRPC client, the internal metrics endpoint, and the Docker Hub mirror in the buildkitd registry config all derive from it, with no hardcoded agent IPs. Agent unavailability never fails the job:

  • BLACKSMITH_AGENT_ADDR unset (GitHub-hosted runner, or an agent that does not export it): warn, fall back to the local docker-container builder, omit the registry mirror config, skip metrics reporting, zero agent dials.
  • Agent answers Unimplemented (service not offered on this platform): same local-builder fallback.
  • Dial refused or timed out while BLACKSMITH_AGENT_ADDR is set: same local-builder fallback; the failure is still reported to the backend so agent outages stay visible.
  • nofallback: true fails on any error.

Only genuine agent failures reach /stickydisks/report-failed; environments without agent support are classified as "unsupported" and skipped, so non-Blacksmith and non-Linux runs do not inflate the docker setup failure metrics:

if (!reporter.isAgentUnsupportedError(error)) {
  await reporter.reportBuildPushActionFailure("STICKYDISK_SETUP", error, "sticky disk setup");
}

Requires the agent change (FastActions/fa#4816) to be rolled out fleet-wide before this is released.


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled. (Staging)


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@piob-io
piob-io force-pushed the agent-addr-discovery branch from a19a6b5 to 6493611 Compare July 29, 2026 16:36
@piob-io piob-io changed the title discover the agent address from BLACKSMITH_AGENT_ADDR Discover the agent address from BLACKSMITH_AGENT_ADDR Jul 29, 2026
@piob-io
piob-io force-pushed the agent-addr-discovery branch 3 times, most recently from 1465ba2 to 4e6fd6b Compare July 29, 2026 19:52
@piob-io
piob-io changed the base branch from main to release/v2 July 29, 2026 19:52
@piob-io
piob-io force-pushed the agent-addr-discovery branch from 4e6fd6b to d212873 Compare July 29, 2026 19:54
@piob-io piob-io closed this Jul 29, 2026
@piob-io piob-io reopened this Jul 29, 2026
@piob-io
piob-io marked this pull request as ready for review July 29, 2026 20:36
@piob-io
piob-io requested a review from taha-au July 29, 2026 21:40
@piob-io
piob-io force-pushed the agent-addr-discovery branch from d212873 to 566a7e3 Compare July 29, 2026 21:49

@taha-au taha-au 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.

I'd have expected the presence/absence of BLACKSMITH_STICKY_DISK_GRPC_PORT to be authoritative for sticky disk support, rather than BLACKSMITH_AGENT_ADDR. the exposition and use of BLACKSMITH_AGENT_ADDR itself for discovering agent address makes sense though

@piob-io

piob-io commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

I'd have expected the presence/absence of BLACKSMITH_STICKY_DISK_GRPC_PORT to be authoritative for sticky disk support, rather than BLACKSMITH_AGENT_ADDR. the exposition and use of BLACKSMITH_AGENT_ADDR itself for discovering agent address makes sense though

This was my original plan. However, for old action versions failing well, I needed to have the agent always expose the stickydisk endpoints, and just respond with unsupported error. This approach will keep these endpoints excercised, so we don't risk breaking this endpoints, and not noticing that we degraded for some old version users (https://github.com/FastActions/fa/pull/4816).

I will cleanup the BLACKSMITH_STICKY_DISK_GRPC_PORT fallback value tho.

… to the local builder when unavailable

Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
@piob-io
piob-io force-pushed the agent-addr-discovery branch from 566a7e3 to 9fef671 Compare July 30, 2026 11:51
@piob-io
piob-io requested a review from taha-au July 30, 2026 14:03
@piob-io
piob-io merged commit 4684ce0 into release/v2 Jul 30, 2026
10 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.

2 participants