Repository navigation
[Swarming] Skip GCE detection on Swarming bots - #5535
Merged
Merged
Conversation
IvanBM18
added this pull request to stack #5537
October 7, 2026 23:50
dylanjew
approved these changes
Oct 8, 2026
On Swarming, luci-auth context exports GCE_METADATA_HOST pointing to its local token-only metadata emulator. Since #5479, is_gce() honours that variable and only checks for a TCP connection, so Swarming bots were treated as GCE and crashed fetching instance/zone (404). Bug: b/571127789
IvanBM18
force-pushed
the
fix/is-gce-skip-swarming
branch
from
October 8, 2026 17:05
5e50a7c to
feffa50
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: b/571127789
Background
Since #5479,
is_gce()usesGCE_METADATA_HOSTand treats any TCP connection to it as "on GCE".Swarming's uses a cli tool:
luci-auth contextwhich setsGCE_METADATA_HOSTto a server that mints tokens so that swarming bots can connect to gcp services, but seems that luci-auth emulator is so good that it fools CF to believe that is running on a GCE bot, hence causing failures in swarming when:This change only affects Swarming bots. A broader option (probe
instance/idinstead of a TCP connect) is on a separate branch, because it changes behaviour on every bot.Changes
compute_metadata.is_gce()now returnsFalseright away whenenvironment.is_running_on_swarming()is true.Test
test_is_gce_on_swarming: withSWARMING_BOT=True,is_gce()returnsFalseeven when the metadata host is reachable.