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

Use CSI proxy v1 client library #738

Merged
merged 2 commits into from
Jul 16, 2021

Conversation

mauriciopoppe
Copy link
Member

@mauriciopoppe mauriciopoppe commented Apr 7, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds compatibility with the following versions of the csi-proxy client: disk v1, volume v1, filesystem v1, the plan to upgrade is:

  • deploy PD CSI with the csi-proxy v1 (and others) client, keep the beta csi-proxy server on the node, the v1 client would fallback to talking to the beta csi-proxy server
  • bump csi-proxy server to v1 on the node, to do this we need to drain the node and restart PD CSI which will then talk to v1 automatically

Summary of changes:

  • add new hostPath mounts to the windows nodes, these mounts are the v1 named pipes, these named pipes don't exist however the implementation is able to understand this fact and it fallbacks to the v1beta2/v1beta1 named pipes
  • safe-mounter_windows.go was cloned into a v1 and a v1beta version, the differences are the imports (I could also change this to multiple if statements but a clone makes the code easy to follow)
  • NewSafeMounter creates either a v1 mounter or a v1beta mounter, the Interface is casted to the required type on runtime

Logs of the new implementation:

Test steps:

  • create a kubernetes GCE cluster with 2 windows nodes
  • choose one of the windows nodes and deploy csi-proxy.exe, verify that the v1 named pipes are available
PS C:\Users\mauriciopoppe\go\src\github.com\kubernetes-csi\csi-proxy> [System.IO.Directory]::GetFiles("\\.\\pipe\\")
\\.\\pipe\\InitShutdown
\\.\\pipe\\lsass
\\.\\pipe\\ntsvcs
\\.\\pipe\\scerpc
\\.\\pipe\\Winsock2\CatalogChangeListener-364-0
\\.\\pipe\\epmapper
\\.\\pipe\\Winsock2\CatalogChangeListener-1f4-0
\\.\\pipe\\LSM_API_service
\\.\\pipe\\W32TIME_ALT
\\.\\pipe\\eventlog
\\.\\pipe\\Winsock2\CatalogChangeListener-138-0
\\.\\pipe\\wkssvc
\\.\\pipe\\atsvc
\\.\\pipe\\Winsock2\CatalogChangeListener-500-0
\\.\\pipe\\Winsock2\CatalogChangeListener-278-0
\\.\\pipe\\openssh-ssh-agent
\\.\\pipe\\TermSrv_API_service
\\.\\pipe\\Ctx_WinStation_API_service
\\.\\pipe\\SessEnvPublicRpc
\\.\\pipe\\Winsock2\CatalogChangeListener-a7c-0
\\.\\pipe\\srvsvc
\\.\\pipe\\Winsock2\CatalogChangeListener-264-0
\\.\\pipe\\PSHost.132685607009879421.2264.DefaultAppDomain.powershell
\\.\\pipe\\TSVCPIPE-6969a09d-6df7-43e9-8b4d-07ca51b17aeb
\\.\\pipe\\docker_engine
\\.\\pipe\\PSHost.132685607145678539.4928.DefaultAppDomain.powershell
\\.\\pipe\\PIPE_EVENTROOT\CIMV2SCM EVENT PROVIDER
\\.\\pipe\\dockershim
\\.\\pipe\\PSHost.132685608544452389.4896.DefaultAppDomain.powershell
\\.\\pipe\\csi-proxy-filesystem-v1alpha1
\\.\\pipe\\csi-proxy-filesystem-v1beta1
\\.\\pipe\\csi-proxy-filesystem-v1beta2
\\.\\pipe\\csi-proxy-filesystem-v1
\\.\\pipe\\csi-proxy-disk-v1alpha1
\\.\\pipe\\csi-proxy-disk-v1beta1
\\.\\pipe\\csi-proxy-disk-v1beta2
\\.\\pipe\\csi-proxy-disk-v1beta3
\\.\\pipe\\csi-proxy-disk-v1
\\.\\pipe\\csi-proxy-volume-v1alpha1
\\.\\pipe\\csi-proxy-volume-v1beta1
\\.\\pipe\\csi-proxy-volume-v1beta2
\\.\\pipe\\csi-proxy-volume-v1beta3
\\.\\pipe\\csi-proxy-volume-v1
\\.\\pipe\\csi-proxy-smb-v1alpha1
\\.\\pipe\\csi-proxy-smb-v1beta1
\\.\\pipe\\csi-proxy-smb-v1beta2
\\.\\pipe\\csi-proxy-smb-v1
\\.\\pipe\\csi-proxy-system-v1alpha1
\\.\\pipe\\csi-proxy-iscsi-v1alpha1
\\.\\pipe\\csi-proxy-iscsi-v1alpha2
  • compile PD CSI driver and deploy it the cluster, check the logs of PD CSI driver in both windows nodes
# windows node without v1 pipes enabled
I0619 08:14:54.770087    1504 main.go:73] Driver vendor version latest
I0619 08:14:54.843225    1504 safe-mounter_windows.go:35] failed to connect to csi-proxy v1 with error=open \\.\\pipe\\csi-proxy-filesystem-v1: The system cannot find the file specified., will try w
I0619 08:14:54.843225    1504 safe-mounter_windows.go:39] using CSIProxyMounterV1Beta, API Versions Disk: v1beta2, Filesystem: v1beta1, Volume: v1beta1

# windows node with v1 pipes enabled
I0619 08:14:54.500483    3260 main.go:73] Driver vendor version latest
I0619 08:14:54.503411    3260 safe-mounter_windows.go:28] using CSIProxyMounterV1, API Versions Disk: v1, Filesystem: v1, Volume: v1
  • Test on v1beta: Untaint the v1beta node and taint the v1 node and run the External Storage suite from k/k (compatibility with the existing csi-proxy server)
GINKGO_PARALLEL_NODES=4 ./hack/ginkgo-e2e.sh --ginkgo.focus="External.*Storage" --ginkgo.skip="\[Disruptive\]|\[Serial\]|\[LinuxOnly\]" --allowed-not-ready-nodes=10 --storage.testdriver="/usr/local/google/home/mauriciopoppe/go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/test/k8s-integration/config/test-config-windows.yaml" --node-os-distro=windows

Ran 36 of 6637 Specs in 2833.752 seconds
SUCCESS! -- 36 Passed | 0 Failed | 0 Pending | 6601 Skipped
  • Test on v1: Untaint the v1 node and taint v1beta node and run the External Storage suite from k/k
GINKGO_PARALLEL_NODES=4 ./hack/ginkgo-e2e.sh --ginkgo.focus="External.*Storage" --ginkgo.skip="\[Disruptive\]|\[Serial\]|\[LinuxOnly\]" --allowed-not-ready-nodes=10 --storage.testdriver="/usr/local/google/home/mauriciopoppe/go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/test/k8s-integration/config/test-config-windows.yaml" --node-os-distro=windows

Ran 36 of 6637 Specs in 2970.219 seconds
SUCCESS! -- 36 Passed | 0 Failed | 0 Pending | 6601 Skipped

Next changes:

  • bump csi-proxy from v1-rc to v1

Does this PR introduce a user-facing change?:

Bumped csi-proxy client library to v1.0.0

/assign @jingxu97 @msau42

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 7, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @mauriciopoppe. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot requested review from jingxu97 and msau42 April 7, 2021 17:47
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 7, 2021
go.mod Outdated Show resolved Hide resolved
@@ -6,7 +6,6 @@
# replace the following with annotation approach. https://github.com/docker/cli/pull/2578

export DOCKER_CLI_EXPERIMENTAL=enabled
_WINDOWS_VERSIONS="20H2 2004 1909 ltsc2019"
Copy link
Member Author

Choose a reason for hiding this comment

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

this line was unused in this program

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mauriciopoppe
To complete the pull request process, please ask for approval from jingxu97 after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2021
@mauriciopoppe mauriciopoppe changed the title Use CSI proxy v1 Use new CSI proxy v1beta3/v1beta2 client libraries Jun 11, 2021
@mauriciopoppe mauriciopoppe changed the title Use new CSI proxy v1beta3/v1beta2 client libraries [WIP] Use new CSI proxy v1beta3/v1beta2 client libraries Jun 11, 2021
@mauriciopoppe mauriciopoppe changed the title [WIP] Use new CSI proxy v1beta3/v1beta2 client libraries [WIP] Use CSI proxy v1 client libraries Jun 17, 2021
@mauriciopoppe mauriciopoppe changed the title [WIP] Use CSI proxy v1 client libraries Use CSI proxy v1 client library Jun 23, 2021
@mauriciopoppe mauriciopoppe marked this pull request as ready for review June 23, 2021 00:54
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 23, 2021
@mauriciopoppe
Copy link
Member Author

/hold

Even though this is working I have to make a small refactor taking all of the methods of both v1 and v1beta mounters to an interface to simplify the code

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 23, 2021
@mauriciopoppe
Copy link
Member Author

/unhold

Made the refactor and run the e2e tests again and added the results in the description

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 24, 2021
@mauriciopoppe
Copy link
Member Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 24, 2021
@mauriciopoppe
Copy link
Member Author

/test pull-gcp-compute-persistent-disk-csi-driver-e2e-win2019

@mattcary
Copy link
Contributor

It's the same integration test problem. We still haven't figured out what's going on. After you get an lgtm from Jing I can force-merge this.

@@ -8,6 +8,7 @@ transformers:
patchesStrategicMerge:
- noauth.yaml
- controller-overlay.yaml
- node-overlay.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

why we need add this yaml too?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is a dev only file, I used it to deploy the GCE PD CSI driver with AlwaysPull

@@ -39,7 +39,7 @@ func formatAndMount(source, target, fstype string, options []string, m *mount.Sa
// not exist. Currently kubelet creates the path beforehand, this is a workaround to
// remove the path first.
func preparePublishPath(path string, m *mount.SafeFormatAndMount) error {
proxy, ok := m.Interface.(*mounter.CSIProxyMounter)
proxy, ok := m.Interface.(mounter.CSIProxyMounter)
Copy link
Contributor

Choose a reason for hiding this comment

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

why pointer is removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Previously it was a struct, now it's an interface implemented by v1 and v1beta

@jingxu97
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 14, 2021
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 14, 2021
@mauriciopoppe
Copy link
Member Author

@jingxu97 I've bumped the csi-proxy client library to v1, could you lgtm again please?

@mattcary
Copy link
Contributor

I'll wait for the tests to run, confirm they pass except for the usual suspect, and force the merge.

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 15, 2021

@mauriciopoppe: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
pull-gcp-compute-persistent-disk-csi-driver-kubernetes-integration 2d0e8dd link /test pull-gcp-compute-persistent-disk-csi-driver-kubernetes-integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mattcary
Copy link
Contributor

/test pull-gcp-compute-persistent-disk-csi-driver-e2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants