-
Notifications
You must be signed in to change notification settings - Fork 431
Use the vendor BIOS file to determine if we are on GCE. #539
Conversation
We currently use a connection test to the GCE metadata server to determine if we are on a GCE instance. This can be flaky and may take a long time. Instead, we can simply check for "Google" in the vendor BIOS file.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
This is a proposed change to how we determine if we are on a GCE instance. |
It looks like this will need a little work. However, I would welcome comments on the feasibility of this change. |
Will this work in docker? E.g., Container Engine or App Engine Flex? I would be for this change as a short-circuit for the metadata server check. |
Let me look into that. |
A short-circuit -- that sounds like a good idea. Going to the metadata server check if either (a) the vendor file doesn't exist or (b) does not have the value 'Google' might be a safer first version. |
This is closer, but I'd like to update test_client.py as well. |
|
@nathanielmanistaatgoogle we can do that at the end when we merge, no need for them to squash ahead of time anymore. :) |
@Galabar001 you're a googler, can you make sure your commits are authored with your @google.com address and that you've registered your github username at go/github? |
Jon -- it looks like go/github knows me. :) Nathaniel -- thank you for the pointers. I'm still talking to the Vanadium team to determine of the BIOS vendor will only ever be a cloud thing. If, for example, Google created the BIOS/motherboard for a chromebook, we could get ourselves into trouble. Another option we are discussing is using an environment variable that could be set by clients (like gcloud). |
I think I may withdraw this pull request for now. I'm not able to get over the nagging feeling that this mechanism may break at some point in the future. Let me try the environment variable approach and send out another pull request. |
We currently use a connection test to the GCE metadata server to
determine if we are on a GCE instance. This can be flaky and may
take a long time. Instead, we can simply check for "Google" in
the vendor BIOS file.