Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openstack: include support to metadata service #258

Merged
merged 2 commits into from
Mar 15, 2022
Merged

openstack: include support to metadata service #258

merged 2 commits into from
Mar 15, 2022

Conversation

MaysaMacedo
Copy link
Contributor

In most cases, OpenStack metadata service is available in the cloud,
which removes the requirement of config-drive.

This patch will change the logic to try reading Metadata and Network data from
the config-drive directory but if it's not present, it'll try to get
it by safely fetching the URL.

Note: it's adding a new dependency on hashicorp/go-retryablehttp which
is a library which provides a HTTP client interface with automatic retries
and exponential backoff.

@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

1 similar comment
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

writer.metaData, writer.networkData, err = utils.FetchOpenstackData()
if err != nil {
glog.Errorf("Run(): failed to fetch OpenStack data: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg/daemon/writer.go Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Mar 1, 2022

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@MaysaMacedo MaysaMacedo marked this pull request as ready for review March 1, 2022 18:11
@MaysaMacedo
Copy link
Contributor Author

It worked fine to fetch the metadata service:

I0301 18:00:41.740862   49272 utils_virtual.go:105] ReadOpenstackMetaData(): read OpenStack meta_data from config-drive                                                                       
2022/03/01 18:00:41 [DEBUG] GET http://169.254.169.254/openstack/2018-08-27/meta_data.json                                                                                                    
2022/03/01 18:00:41 [DEBUG] GET http://169.254.169.254/openstack/2018-08-27/network_data.json 

@EmilienM
Copy link
Contributor

EmilienM commented Mar 1, 2022

/lgtm
this looks good to me. Thanks!

@MaysaMacedo
Copy link
Contributor Author

@SchSeba can you take a look on this PR? Thanks

@MaysaMacedo MaysaMacedo changed the title openstack: try to fetch Metadata service first openstack: include support to metadata service Mar 7, 2022
@EmilienM
Copy link
Contributor

EmilienM commented Mar 8, 2022

LGTM

@adrianchiris
Copy link
Collaborator

In most cases, OpenStack metadata service is available in the cloud

should fetching from metadata service be the default ?

pkg/utils/utils_virtual.go Show resolved Hide resolved
pkg/utils/utils_virtual.go Show resolved Hide resolved
pkg/utils/utils_virtual.go Show resolved Hide resolved
pkg/daemon/writer.go Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Mar 9, 2022

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@MaysaMacedo
Copy link
Contributor Author

In most cases, OpenStack metadata service is available in the cloud

should fetching from metadata service be the default ?

Using config-drive is considered more stable than using metadata, that's why we try to handle it first.
The order chosen was initially proposed by @EmilienM, maybe he has more information about it.

@EmilienM
Copy link
Contributor

EmilienM commented Mar 9, 2022

In most cases, OpenStack metadata service is available in the cloud

should fetching from metadata service be the default ?

Using config-drive is considered more stable than using metadata, that's why we try to handle it first. The order chosen was initially proposed by @EmilienM, maybe he has more information about it.

Right, let's try to read the files first (cheaper & faster than fetching URL), by default, and if it's not there we just fallback into fetching the metadata URL.

@MaysaMacedo
Copy link
Contributor Author

@adrianchiris Thanks for the review. Can you take another look on this PR?

@adrianchiris
Copy link
Collaborator

/test-all

This commit includes a new dependency that
provides a HTTP client interface with automatic
retries and exponential backoff.
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

In most cases, OpenStack metadata service is available in the cloud,
which removes the requirement of config-drive.

This patch will change the logic to try reading Metadata and Network data from
the config-drive directory but if it's not present, it'll try to get
it by safely fetching the URL.
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@EmilienM
Copy link
Contributor

LGTM

@EmilienM
Copy link
Contributor

/test-all

@bn222
Copy link
Collaborator

bn222 commented Mar 15, 2022

/lgtm

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.

5 participants