dgzlopes / cloud-detect

Module that determines a host's cloud provider.
https://pypi.org/project/cloud-detect/
MIT License
35 stars 13 forks source link

Add Oracle cloud provider #1

Closed dgzlopes closed 3 years ago

dgzlopes commented 3 years ago

Determine if the host cloud provider is Oracle.

You can see how we detect the other providers (e.g AWS) here.

For reference, you can check banzaicloud/satellite code.

dennis-pg commented 3 years ago

Would like to look into this

dgzlopes commented 3 years ago

Hi @dennis-pg! Thanks for your interest. Feel free to ping me if you need help.

dennis-pg commented 3 years ago

Hi @dgzlopes

The file-based method looks okay. The metadata server based method does not seem to be working as per banzaicloud/satellite code The link -> http://169.254.169.254/opc/v1/instance/metadata/ only contains an ssh key as mentioned in the docs

Do you want to use some other logic to determice if its is OCI from the response?

dgzlopes commented 3 years ago

Um, yeah, it only contains a list of ssh keys :neutral_face:

I'm not sure why Satellite is doing that, and well, I don't have experience with Oracle Cloud... So I would say, that for now, we can implement the file-based method - and it should work as expected.

We can leave the metadata approach for another issue. Might involve creating an Oracle account, spawning instances, testing things...

I kinda prefer unknowns that bad results :stuck_out_tongue_winking_eye:

dgzlopes commented 3 years ago

But probably some SSH key contains the string that Satellite checks (e.g Scaleway makes something similar) - that's something we should research.

dennis-pg commented 3 years ago

Have raised PR