Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Use the vendor BIOS file to determine if we are on GCE. #539

Closed
wants to merge 3 commits into from
Closed

Use the vendor BIOS file to determine if we are on GCE. #539

wants to merge 3 commits into from

Conversation

Galabar001
Copy link
Contributor

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.

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.
@googlebot
Copy link

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. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@Galabar001
Copy link
Contributor Author

This is a proposed change to how we determine if we are on a GCE instance.

@Galabar001
Copy link
Contributor Author

It looks like this will need a little work. However, I would welcome comments on the feasibility of this change.

@theacodes
Copy link
Contributor

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.

@Galabar001
Copy link
Contributor Author

Let me look into that.

@Galabar001
Copy link
Contributor Author

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.

@Galabar001
Copy link
Contributor Author

This is closer, but I'd like to update test_client.py as well.

@nathanielmanistaatgoogle
Copy link
Contributor

nathanielmanistaatgoogle commented Jul 8, 2016

  1. Please squash commits with each round of code review back-and-forth.
  2. Ensure that your commit has both an author and committer who have signed the CLA. This pull request currently has the "cla: no" label on it; please get that fixed (probably by ensuring that your commit has your corporate account listed for both author and committer).
  3. Include in your commit message at least a paragraph of details answering questions like:
    • Where does Google guarantee that GCE instances will have this file with these contents? And for how far into the future does Google guarantee this?
    • Where does Google guarantee that other computing environments that aren't GCE will not have this file with these contents?

@theacodes
Copy link
Contributor

Please squash commits with each round of code review back-and-forth.

@nathanielmanistaatgoogle we can do that at the end when we merge, no need for them to squash ahead of time anymore. :)

@theacodes
Copy link
Contributor

@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?

@Galabar001
Copy link
Contributor Author

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).

@Galabar001
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants