-
Notifications
You must be signed in to change notification settings - Fork 61
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
WIP: build/deploy csi-proxy in host-process container #179
Conversation
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
@marosset: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: marosset 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 |
Hi @marosset. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
I think this should probably get tied into https://github.com/kubernetes-csi/csi-release-tools but I need to formalize myself with that process. |
image/build-container-image.sh
Outdated
if [ $(docker buildx ls | grep -c img-builder) == 0 ]; then | ||
docker buildx create --name img-builder | ||
fi | ||
docker buildx use img-builder |
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.
might consider cleaning up the image builder:
trap 'docker buildx rm img-builder' EXIT
image/build-container-image.sh
Outdated
|
||
export DOCKER_CLI_EXPERIMENTAL=enabled | ||
if [ $(docker buildx ls | grep -c img-builder) == 0 ]; then | ||
docker buildx create --name img-builder |
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.
In a recent update to buildx I had to begin explicitly requesting windows:
docker buildx create --name img-builder --use --platform windows/amd64
image/build-container-image.sh
Outdated
docker buildx build --platform windows/amd64 --output=type=registry --pull -f Dockerfile --build-arg BASE=mcr.microsoft.com/windows/nanoserver:1809 -t $REGISTRY/csi-proxy:$VERSION-1809 .. | ||
docker buildx build --platform windows/amd64 --output=type=registry --pull -f Dockerfile --build-arg BASE=mcr.microsoft.com/windows/nanoserver:ltsc2022 -t $REGISTRY/csi-proxy:$VERSION-ltsc2022 .. | ||
|
||
docker manifest create $REGISTRY/csi-proxy:$VERSION $REGISTRY/csi-proxy:$VERSION-1809 $REGISTRY/csi-proxy:$VERSION-ltsc2022 |
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.
In Kubernetes test images we keep these values as separate config: https://github.com/kubernetes/kubernetes/blob/master/test/images/agnhost/BASEIMAGE
I guess we only have 2019 and WS 2022 to deal with now so this isn't an issue
image/build-container-image.sh
Outdated
docker manifest inspect $REGISTRY/csi-proxy:$VERSION | ||
docker manifest push $REGISTRY/csi-proxy:$VERSION | ||
|
||
|
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.
nit: extra lines
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.
This looks interesting, thanks for the PR!
I think this should probably get tied into kubernetes-csi/csi-release-tools but I need to formalize myself with that process.
yeah, we use release-tools/build.make
, it already handles creating a multiarch binary too for many Windows platforms, I'd create a Dockerfile.Windows file like https://github.com/kubernetes-csi/node-driver-registrar/blob/master/Dockerfile.Windows and modify the root Makefile
to call push-multiarch instead
deploy/csi-proxy-ds.yaml
Outdated
hostNetwork: true | ||
containers: | ||
- name: csi-proxy | ||
image: mrosse3/csi-proxy:v1.0.2 |
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 be k8s.gcr.io/sig-storage/csi-proxy
before the merge
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.
ack!
/ok-to-test |
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.
This is great! It would be nice to align with release-tools and a structure like https://github.com/kubernetes-csi/csi-driver-smb/tree/master/deploy .
deploy/csi-proxy-ds.yaml
Outdated
kind: DaemonSet | ||
metadata: | ||
name: csi-proxy | ||
namespace: kube-system # Is this the right 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.
Thanks all, let me look into aligning with the release-tools. |
@mauriciopoppe I made some updates and ran The image it produced looks good - https://hub.docker.com/layers/mrosse3/csi-proxy/canary/images/sha256-e085d3942a3bef9c9f4ffcd6f534bc75f1d18fcca4cec3dc3093c7369bc7ab7f?context=explore Is there anything else I need to do to integrate w/ the release tools? |
@marosset I've been reading the scripts related with our build process, we have two:
I think the overall objective is to call the function For the presubmit job the file used is For the postsubmit job the file used is |
Thanks @mauriciopoppe this is very helpful. |
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
.prow.sh
Outdated
@@ -14,3 +14,6 @@ ensure_paths | |||
# main | |||
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make all "GOFLAGS_VENDOR=${GOFLAGS_VENDOR}" "BUILD_PLATFORMS=${CSI_PROW_BUILD_PLATFORMS}" | |||
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make -k test "GOFLAGS_VENDOR=${GOFLAGS_VENDOR}" 2>&1 | make_test_to_junit | |||
|
|||
# build / push multi-arch images for validation | |||
gcr_cloud_build |
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.
gcr_cloud_build just calls make push-multiarch so i left in the calls to run_with_go make all and make test.
Should I update the push-multiarch make target to run the tests too so this file can just call gcr_cloud_build and not the run_with_go commands?
That seems a little convoluted to me.
@marosset: The following test failed, say
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. |
@mauriciopoppe is gcr.io/k8s-staging-sig-storage the correct registry to use for presubmit jobs? I'm getting the following errors
|
# Extract tag-n-hash value from GIT_TAG (form vYYYYMMDD-tag-n-hash) for REV value. | ||
REV=v$(echo "$GIT_TAG" | cut -f3- -d 'v') | ||
: ${CSI_PROW_BUILD_PLATFORMS:="windows amd64 .exe nanoserver:1809; windows amd64 .exe nanoserver:ltsc2022"} | ||
: ${REGISTRY_NAME:="gcr.io/k8s-staging-sig-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.
@marosset so sorry for the late response. I checked what other CSI projects do and none of them push the presubmit artifacts to a remote! They instead just build the linux image locally and run a kind cluster on the location where the prow job runs for the integration tests.
I recently added a multidistro build to kubernetes-sigs/local-volume-provisioner in https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/pull/279/files, every prow job inherits the project through the env var $PROJECT
which can be used for the presubmit image location.
One thing that I saw that might cause problems is that the tag is always canary
for master, I think it should have some info about the git tag to avoid stepping on the changes of another contributor but we can fix that later.
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.
This might make the presubmit job pass but I think I might be forgetting about the post submit image push to gcr.io/k8s-staging-sig-storage
, I'll check that too
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.
: ${REGISTRY_NAME:="gcr.io/k8s-staging-sig-storage"}
shouldn't be set in this file, this is the file that runs on postsubmit
@@ -4,7 +4,8 @@ | |||
|
|||
# # Only these tests make sense for csi-proxy | |||
: ${CSI_PROW_TESTS:="unit"} | |||
: ${CSI_PROW_BUILD_PLATFORMS:="windows amd64 .exe"} | |||
: ${CSI_PROW_BUILD_PLATFORMS:="windows amd64 .exe nanoserver:1809"} | |||
: ${REGISTRY_NAME:="gcr.io/k8s-staging-sig-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.
This should be:
: ${REGISTRY_NAME:="gcr.io/$PROJECT"}
@@ -4,7 +4,8 @@ | |||
|
|||
# # Only these tests make sense for csi-proxy | |||
: ${CSI_PROW_TESTS:="unit"} | |||
: ${CSI_PROW_BUILD_PLATFORMS:="windows amd64 .exe"} | |||
: ${CSI_PROW_BUILD_PLATFORMS:="windows amd64 .exe nanoserver:1809"} |
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.
CSI_PROW_BUILD_PLATFORMS should already have a default, I think we should remove this line and use that default instead
@@ -14,3 +15,6 @@ ensure_paths | |||
# main | |||
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make all "GOFLAGS_VENDOR=${GOFLAGS_VENDOR}" "BUILD_PLATFORMS=${CSI_PROW_BUILD_PLATFORMS}" | |||
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make -k test "GOFLAGS_VENDOR=${GOFLAGS_VENDOR}" 2>&1 | make_test_to_junit | |||
|
|||
# build / push multi-arch images for validation | |||
gcr_cloud_build |
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.
for clarification, this file .prow.sh is what runs in the presubmit jobs and .cloudbuild.sh is the one that runs on postsubmit jobs
@ddebroy, @jingxu97 and I talked about supporting this mode, my opinion is:
|
I've been out of the office for a bit but am back now. |
Correct, we would:
There's a doc that @ddebroy started but I haven't had a chance to complete yet: https://docs.google.com/document/d/15lgXyWytWSg1PuEcHl72eqgLoXc_i8kXmQcrXhRpjO0/edit#heading=h.6vn5bqze2ffs |
/close |
@marosset: Closed this PR. 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. |
Signed-off-by: Mark Rossetti marosset@microsoft.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds functionality to build a container image containing csi-proxy.exe and deploy it as a daemonSet using HostProcess containers
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I have testing using csi-proxy deployed in a host-process container in conjunction with azurefile-csi-driver and everything is behaving as expected.
Does this PR introduce a user-facing change?: