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

Windows SMB Support #36

Merged
merged 2 commits into from
Aug 19, 2019
Merged

Windows SMB Support #36

merged 2 commits into from
Aug 19, 2019

Conversation

alexiondev
Copy link
Contributor

@alexiondev alexiondev commented Jul 23, 2019

Refactored some Linux specific code to allow requests to be made when running on Windows to mount SMB shares.

The code has been manualy tested end-to-end and successfully mounts an SMB share on a Windows node. However, it doesn't run containerized yet (see this enhancement) and hasn't been tested against GCP FileStore because SMB support is not available.

@k8s-ci-robot
Copy link
Contributor

Welcome @almos98!

It looks like this is your first PR to kubernetes-sigs/gcp-filestore-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gcp-filestore-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 23, 2019
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 23, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @almos98. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes 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 added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 23, 2019
@pjh
Copy link

pjh commented Jul 23, 2019

/cc msau42 pjh

@k8s-ci-robot k8s-ci-robot requested a review from msau42 July 23, 2019 21:07
@k8s-ci-robot
Copy link
Contributor

@pjh: GitHub didn't allow me to request PR reviews from the following users: pjh.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc msau42 pjh

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.

@msau42
Copy link
Contributor

msau42 commented Jul 23, 2019

/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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 23, 2019
@msau42
Copy link
Contributor

msau42 commented Jul 23, 2019

/assign @jingxu97 @yujuhong

Copy link
Contributor Author

@alexiondev alexiondev left a comment

Choose a reason for hiding this comment

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

@msau42 I commented out a test for now because the behavior of FakeMount has changed and this test was failing after updating vendor.

@@ -177,11 +188,54 @@ func TestNodePublishVolume(t *testing.T) {
},
expectErr: true,
},
// TODO: enable this test when FakeMount supports Windows behavior
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be cleaner to actually have a separate test function just for the windows cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there something still preventing this test from being enabled? If so, let's open an issue for it and reference it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On Windows, if TargetPath exists it should return an error but FakeMount doesn't do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened an issue on K/K: kubernetes/kubernetes#81609

@alexiondev
Copy link
Contributor Author

@msau42 @yujuhong @jingxu97 I think this is ready for review now.
/cc adjackura

@k8s-ci-robot
Copy link
Contributor

@almos98: GitHub didn't allow me to request PR reviews from the following users: adjackura.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

@msau42 @yujuhong @jingxu97 I think this is ready for review now.
/cc adjackura

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.

@pjh
Copy link

pjh commented Aug 6, 2019

cc @adjackura

@pjh
Copy link

pjh commented Aug 6, 2019

LGTM!

@almos98 could you update the PR description to note that you've manually tested this end-to-end to confirm that it successfully mounts an SMB share on the Windows node, but 1) it doesn't run containerized yet (link to kubernetes/enhancements#1122), and 2) it hasn't been tested against GCP Filestore (since SMB support is still not available). Thanks!

@msau42
Copy link
Contributor

msau42 commented Aug 7, 2019

This is looking good. Can you also do the following:

  • squash your commits down into 2-3 commits. One for vendor updates, and 1 or 2 for the Windows implementation? If you haven't done this before, create a duplicate branch first so you still have all your commits
  • retitle the PR. this is more than a refactor
  • did you use any scripts to manually test the csi driver? If so, can you add them to test/experimental? Or at least document the steps somewhere

@msau42
Copy link
Contributor

msau42 commented Aug 7, 2019

Also is it possible to enhance https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/blob/master/test/run_unit.sh to also run the windows unit tests? Maybe @yujuhong or @pjh can help with how to do that.

@msau42
Copy link
Contributor

msau42 commented Aug 7, 2019

Also is it possible to enhance https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/blob/master/test/run_unit.sh to also run the windows unit tests? Maybe Yu-Ju Hong or Peter Hornyack can help with how to do that.

Sorry I realized the unit tests were written in a way that it doesn't actually require a windows env to run. So scratch that, I think it is fine the way it is.

@alexiondev alexiondev changed the title Windows refactor Windows SMB Support Aug 7, 2019
@alexiondev
Copy link
Contributor Author

Squashed commits, changed PR title and documented testing steps!

Copy link
Contributor

@msau42 msau42 left a comment

Choose a reason for hiding this comment

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

/approve

Will let the others do a final review

windows-local:
mkdir -p bin
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.vendorVersion=${VERSION}" -o bin/gcfs-csi-driver.exe ./cmd/

push:
docker push $(IMAGE):$(VERSION)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do anything special here for windows container images?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will need to write a separate Dockerfile to build a Windows container. I haven't written one because the driver can't run from within a container on Windows. Can write one and include it if you'd like.

Copy link
Contributor

Choose a reason for hiding this comment

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

It may be good to add now so once CSI on windows is ready, we can easily leverage this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a Dockerfile for windows under test/experimental but the driver has to be compiled first. I added a target in the Makefile to do this.

@@ -177,11 +188,54 @@ func TestNodePublishVolume(t *testing.T) {
},
expectErr: true,
},
// TODO: enable this test when FakeMount supports Windows behavior
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there something still preventing this test from being enabled? If so, let's open an issue for it and reference it here

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: almos98, msau42

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2019
@msau42
Copy link
Contributor

msau42 commented Aug 16, 2019

/retest

@pjh
Copy link

pjh commented Aug 17, 2019

@davidz627 @msau42 can you provide your final feedback and approval so that we can get this merged? Thanks!

@pjh
Copy link

pjh commented Aug 17, 2019

@almos98 consider squashing this back into two commits again.

With these changes it's possible to make a request to mount a generic
SMB share on Windows.
@msau42
Copy link
Contributor

msau42 commented Aug 19, 2019

/lgtm

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2019
@k8s-ci-robot k8s-ci-robot merged commit f7d9d76 into kubernetes-sigs:master Aug 19, 2019
@alexiondev alexiondev deleted the windows_refactor branch August 19, 2019 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

7 participants