Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Remove init-containers in LVM mode #688

Merged
merged 1 commit into from
Jun 29, 2020
Merged

Conversation

avalluri
Copy link
Contributor

As we are using 'shared/Bidirectional' mounts for LVM driver also, we
could create the needed physical devices(namespaces, volume groups) in
the same driver session. This invalidates the usage of init-containers.

Few advantages of merging the init-containers functionality to driver code:

  • smaller container image size
  • allows us to implement features that are common to both modes(ex:
    pmemPercentage)

FIXES #532

docs/install.md Outdated Show resolved Hide resolved
pkg/pmem-device-manager/pmd-lvm.go Outdated Show resolved Hide resolved
pkg/pmem-device-manager/pmd-lvm.go Outdated Show resolved Hide resolved
@@ -287,3 +295,86 @@ func getVolumeGroups(groups []string) ([]vgInfo, error) {

return vgs, nil
}

func createNS(r *ndctl.Region, uselimit uint) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic in this function is complex enough that we should have a unit test which covers different scenarios.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The particular code was authored by @okartau. I just moved the existing code from pmem-ns-init.go to here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then tests were already missing before. Now would still be a good time to add them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests for this part of code is a bit complicated as the code depends on underlined PMEM hardware region properties(size, interleaves, max extent). Current LVM unit tests are run on a pre-populated logical volume groups.

Copy link
Contributor

Choose a reason for hiding this comment

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

The usual approach for cases like this is to introduce an interface and then test the code with a mock implementation of the interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The usual approach for cases like this is to introduce an interface and then test the code with a mock implementation of the interface.

@pohly Seems like it's a bigger effort, do you mind to deal this separately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. Please file an issue to track it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #692

As we are using 'shared/Bidirectional' mounts for LVM driver also, we
could create the needed physical devices(namespaces, volume groups) in
the same driver session. This invalidates the usage of init-containers.

Few advantages of merging the init-containers functionality to driver code:
 - smaller container image size
 - allows us to implement features that are common to both modes(ex:
 pmemPercentage)

FIXES intel#532
@pohly pohly merged commit 8c2e37f into intel:devel Jun 29, 2020
@avalluri avalluri deleted the init-containers branch October 20, 2020 20:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

merge pmem-ns-init and pmem-vgm into pmem-csi-driver
2 participants