-
Notifications
You must be signed in to change notification settings - Fork 159
Add e2e CI tests for Windows #529
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
Conversation
7a847f7
to
ce1b374
Compare
06e6d4e
to
b9689dd
Compare
/retest |
/test pull-gcp-compute-persistent-disk-csi-driver-kubernetes-integration |
b9689dd
to
ec1ccd6
Compare
/retest |
ec1ccd6
to
be33e2e
Compare
} | ||
defer func() { | ||
err = setEnvProject(string(oldProject)) | ||
if *platform != "windows" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we intend to have a prow CI job to run windows? Then we should use boskos to get a project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. this is prow config file. https://github.com/kubernetes/test-infra/pull/17980/files
- /workspace/scenarios/kubernetes_e2e.py already set up the project and kubernetes for windows I think. So instead of getting boskos for a new project, just use the current project. This is how other Windows test works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here explaining this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
test/k8s-integration/main.go
Outdated
@@ -352,6 +355,9 @@ func generateGCETestSkip(clusterVersion string) string { | |||
if v.LessThan(apimachineryversion.MustParseSemantic("1.16.0")) { | |||
skipString = skipString + "|volumeMode\\sshould\\snot\\smount\\s/\\smap\\sunused\\svolumes\\sin\\sa\\spod" | |||
} | |||
if platform == "windows" { | |||
skipString = skipString + "|\\[Slow\\]|\\[LinuxOnly\\]|\\[Feature:.+\\][Ephemeral]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What slow, and feature tests don't work on windows? Also ephemeral can probably be removed, there shouldn't be any external storage tests tagged with ephemeral
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en, I forgot why I added slow. I will remove it.
test/k8s-integration/main.go
Outdated
@@ -352,6 +355,9 @@ func generateGCETestSkip(clusterVersion string) string { | |||
if v.LessThan(apimachineryversion.MustParseSemantic("1.16.0")) { | |||
skipString = skipString + "|volumeMode\\sshould\\snot\\smount\\s/\\smap\\sunused\\svolumes\\sin\\sa\\spod" | |||
} | |||
if platform == "windows" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put this before or after the version checks instead of in the middle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
test/run-windows-script.sh
Outdated
@@ -0,0 +1,48 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this script used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at first, I was trying to use a simple script to deploy and run tests for windows cluster. But later I release it missed driver build part which is available in the run-integration-test go program. So this script is not really used. I can remove it or adjust it and make it available just for users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to add it in, maybe put it in an "experimental" directory and add a comment at the top explaining what the script is used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove it for now, and add it later if needed.
Dockerfile.Windows
Outdated
WORKDIR /code | ||
ADD . /code/ | ||
|
||
RUN cd /code/ && GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/') GCE_PD_CSI_STAGING_VERSION=dev make gce-pd-driver-windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weren't there issues with building in a container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but here the RUN command is being run on a Linux image
FROM --platform=$BUILDPLATFORM golang:1.13.3 AS builder. So this RUN can work here
@@ -0,0 +1,20 @@ | |||
StorageClass: | |||
FromName: false | |||
FromFile: sc-windows.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storageclass, snapshotclass, and capabilities should be templated as they are generated by the test runner, like https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/blob/master/test/k8s-integration/config/test-config-template.in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated using template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seeing the update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove it.
@@ -1,3 +1,10 @@ | |||
kind: Namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why none of our tests were failing without this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was created in the driver deployment script. It is configurable. But looking at the kustomization code. it was hardcoded to gce-pd-csi-driver as namespace. Then it seems like we should not make it configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @verult
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The installation script also creates a secret in the namespace using the JSON key provided by the user, which doesn't have a retry loop, so if the namespace hasn't been created yet the deployment would be broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
Dockerfile.Windows
Outdated
WORKDIR /code | ||
ADD . /code/ | ||
|
||
RUN cd /code/ && GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/') GCE_PD_CSI_STAGING_VERSION=dev make gce-pd-driver-windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should GCE_PD_CSI_STAGING_VERSION be hardcoded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
/assign @mattcary |
@msau42: GitHub didn't allow me to assign the following users: mattcary. Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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. |
9401be4
to
569ad3c
Compare
/retest |
569ad3c
to
9b332c7
Compare
@@ -0,0 +1,20 @@ | |||
StorageClass: | |||
FromName: false | |||
FromFile: sc-windows.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seeing the update?
fmt.Sprintf("GCE_PD_CSI_STAGING_VERSION=%s", stagingVersion), | ||
fmt.Sprintf("GCE_PD_CSI_STAGING_IMAGE=%s", stagingImage)) | ||
} else { | ||
cmd = exec.Command("make", "-C", pkgDir, "build-and-push-windows-container-1909", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to test ltsc2019?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking to test this first and will add for ltsc2019 after finish testing.
} | ||
defer func() { | ||
err = setEnvProject(string(oldProject)) | ||
if *platform != "windows" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here explaining this?
test/k8s-integration/main.go
Outdated
oldProject, err := exec.Command("gcloud", "config", "get-value", "project").CombinedOutput() | ||
*stagingImage = fmt.Sprintf("gcr.io/%s/gcp-persistent-disk-csi-driver", strings.TrimSpace(string(oldProject))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staging image should only be overridden if doDriverBuild
= true. Can we actually pull L173 out of the linux block so we set it in one place for both windows and linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
test/k8s-integration/main.go
Outdated
if v.LessThan(apimachineryversion.MustParseSemantic("1.17.0")) { | ||
skipString = skipString + "|VolumeSnapshotDataSource" | ||
} | ||
if platform == "windows" { | ||
skipString = skipString + "|\\[LinuxOnly\\]|\\[Feature:.+\\][Ephemeral]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to skip Feature and Ephemeral? Skipping Feature means snapshot tests won't run on windows. Ephemeral I think is not run as part of the external storage test suite anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove Feature and Ephemeral. I think the reason windows tests in presubmit remove Feature is to reduce running time. But periodic tests will test it.
test/run-windows-k8s-integration.sh
Outdated
--platform=windows --local-k8s-dir=${LOCAL_K8S_DIR} --bringup-cluster=false --teardown-cluster=false --teardown-driver=true\ | ||
--run-in-prow=true --deploy-overlay-name=${overlay_name} --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \ | ||
--do-driver-build=${do_driver_build} --gce-zone=${gce_zone}\ | ||
--storageclass-file=sc-windows.yaml --snapshotclass-file=pd-volumesnapshotclass.yaml --test-focus="External.Storage.*ntfs" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need focus on ntfs? Configuring the fstype in the driver config should run the ntfs tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it
@@ -33,6 +34,7 @@ var ( | |||
teardownCluster = flag.Bool("teardown-cluster", true, "teardown the cluster after the e2e test") | |||
teardownDriver = flag.Bool("teardown-driver", true, "teardown the driver after the e2e test") | |||
bringupCluster = flag.Bool("bringup-cluster", true, "build kubernetes and bringup a cluster") | |||
platform = flag.String("platform", "linux", "platform that the tests will be run, either linux or windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some ensureFlag
logic below that bringup-cluster and teardown-cluster are required to be false for windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added it
test/run-windows-script.sh
Outdated
@@ -0,0 +1,48 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to add it in, maybe put it in an "experimental" directory and add a comment at the top explaining what the script is used for.
test/run-windows-k8s-integration.sh
Outdated
--run-in-prow=true --deploy-overlay-name=${overlay_name} --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \ | ||
--do-driver-build=${do_driver_build} --gce-zone=${gce_zone}\ | ||
--storageclass-file=sc-windows.yaml --snapshotclass-file=pd-volumesnapshotclass.yaml --test-focus="External.Storage.*ntfs" \ | ||
--deployment-strategy=${deployment_strategy} --num-nodes=4 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we need 4 nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--num-nodes was a required parameter. Remove this if bringupCluster is false
test/run-windows-k8s-integration.sh
Outdated
#readonly gce_region=${GCE_CLUSTER_REGION:-} | ||
readonly image_type=${IMAGE_TYPE:-cos} | ||
|
||
export GCE_PD_VERBOSITY=9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove the verbosity. Before we were debugging some test config errors and bumped it up to debug, but forgot to bump it back down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it
9b332c7
to
1c2dbc5
Compare
/retest |
1 similar comment
/retest |
1c2dbc5
to
3aa390a
Compare
/retest |
3aa390a
to
87b3b36
Compare
@msau42 comments were addressed. PTAL. |
test/k8s-integration/main.go
Outdated
} | ||
|
||
if *platform == "windows" && *inProw { | ||
ensureFlag(bringupCluster, false, "bringupCluster is set to false if it is for prow test in windows cluster") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually bringupCluster is not supported for any windows testing right? (even outside of prow)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now yes. Later we could add an option to bring up windows cluster.
Remove the inPros check.
--platform=windows --local-k8s-dir=${LOCAL_K8S_DIR} --bringup-cluster=false --teardown-cluster=false --teardown-driver=${teardown_driver}\ | ||
--run-in-prow=true --deploy-overlay-name=${overlay_name} --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \ | ||
--do-driver-build=${do_driver_build} --gce-zone=${gce_zone}\ | ||
--storageclass-file=sc-windows.yaml --snapshotclass-file=pd-volumesnapshotclass.yaml --test-focus="External.Storage" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing sc-windows.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
readonly GCE_PD_DO_DRIVER_BUILD=false | ||
readonly PKGDIR=${GOPATH}/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver | ||
readonly LOCAL_K8S_DIR=${GOPATH}/src/k8s.io/kubernetes | ||
readonly overlay_name="${GCE_PD_OVERLAY_NAME:-alpha}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the alpha overlay is pointing to an image in your own gcr gcr.io/jing-k8s-dev/gce-pd-windows-2019. Is that publicly accessible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
This PR adds e2e CI tests for Windows.
87b3b36
to
33654c9
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jingxu97, 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 |
/retest |
This PR adds e2e CI tests for Windows.
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: