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: dynamically mount the config-drive #773

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

EmilienM
Copy link
Contributor

When we want to use config-drive in immutable systems, very often the
config-drive is only used at boot and then umounted (e.g. ignition does
this).

Later when we want to fetch Metadata from the config drive, we actually
have to mount it.

In this PR, I'm adding similar code than coreos/ignition where we
dynamically mount the config-drive is the device was found with the
right label (config-2 or CONFIG-2 as documented in OpenStack). If the
device is found, we mount it, fetch the data and umount it.

Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can 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, Maintainers can 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.

@coveralls
Copy link

coveralls commented Sep 11, 2024

Pull Request Test Coverage Report for Build 10997470993

Details

  • 5 of 67 (7.46%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 44.896%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/platforms/openstack/openstack.go 5 67 7.46%
Totals Coverage Status
Change from base Build 10979758277: -0.1%
Covered Lines: 6628
Relevant Lines: 14763

💛 - Coveralls

@EmilienM
Copy link
Contributor Author

It's open for review but I haven't tested it yet.

/hold

@github-actions github-actions bot added the hold label Sep 11, 2024
@bn222
Copy link
Collaborator

bn222 commented Sep 12, 2024

/lgtm thanks

@EmilienM
Copy link
Contributor Author

Just an update on this, the current patch doesn't work yet, I'm reworking it here: openshift/sriov-network-operator#1004 so I can get CI feedback fairly quickly. I'll update this PR as soon as I have satisfying results and ask for reviews here.

@EmilienM
Copy link
Contributor Author

I got a successful CI run:

2024-09-12T22:31:21.02913626Z	INFO	daemon/writer.go:65	CreateOpenstackDevicesInfo()
2024-09-12T22:31:21.029146361Z	INFO	openstack/openstack.go:118	reading OpenStack meta_data from config-drive
2024-09-12T22:31:21.057448323Z	INFO	openstack/openstack.go:225	found config drive device	{"device": "/dev/sr0"}
2024-09-12T22:31:21.065428364Z	INFO	openstack/openstack.go:229	mounted config drive %s into %s	{"/dev/sr0": "/tmp/sriov-configdrive2821721804"}
2024-09-12T22:31:21.066344839Z	INFO	openstack/openstack.go:118	reading OpenStack network_data from config-drive
2024-09-12T22:31:21.079312593Z	INFO	openstack/openstack.go:234	umounted config drive	{"path": "/tmp/sriov-configdrive2821721804"}

https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_sriov-network-operator/1004/pull-ci-openshift-sriov-network-operator-master-e2e-openstack-nfv-config-drive/1834316002138001408/artifacts/e2e-openstack-nfv-config-drive/gather-extra/artifacts/pods/openshift-sriov-network-operator_sriov-network-config-daemon-5mhxf_sriov-network-config-daemon.log

@EmilienM
Copy link
Contributor Author

@SchSeba @zeeke please review :)

Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

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

Though these changes add dependencies to blkid and mount commands, they are well perimetered inside the ad-hoc OpenStack logic

Only one other minor comment about logging.

LGTM

pkg/platforms/openstack/openstack.go Outdated Show resolved Hide resolved
@SchSeba
Copy link
Collaborator

SchSeba commented Sep 23, 2024

Hi @EmilienM can you check the unit tests please

When we want to use config-drive in immutable systems, very often the
config-drive is only used at boot and then umounted (e.g. ignition does
this).

Later when we want to fetch Metadata from the config drive, we actually
have to mount it.

In this PR, I'm adding similar code than coreos/ignition where we
dynamically mount the config-drive is the device was found with the
right label (config-2 or CONFIG-2 as documented in OpenStack). If the
device is found, we mount it, fetch the data and umount it.
@EmilienM
Copy link
Contributor Author

@SchSeba done, and sorry for the typo.

@EmilienM
Copy link
Contributor Author

EmilienM commented Oct 9, 2024

/hold cancel

@github-actions github-actions bot removed the hold label Oct 9, 2024
@EmilienM EmilienM requested a review from zeeke October 9, 2024 11:48
@zeeke zeeke merged commit 92cf81c into k8snetworkplumbingwg:master Oct 9, 2024
12 of 13 checks passed
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.

6 participants