Skip to content

Conversation

PrasadG193
Copy link
Contributor

@PrasadG193 PrasadG193 commented Oct 15, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR implements SnapshotMetadata service from the CSI specs. This service in combination with external-snapshot-metadata will be used to compare and query changed block metadata between two snapshots.
Right now, the service will be disabled by default till external-snapshot-metadata alpha is release.

The changes in deploy script to add external-snapshot-metadata sidecar will be added after alpha release.

NOTE

This is a sample implementation of SnapshotMetadata intended to be used for demo and CI testing purpose only.
This should not be used in production or as an example about how to write a real driver.

Test plan

Complete test plan is documented at - https://gist.github.com/PrasadG193/1fab082f03bbdb7db25a41ed17b7e7c1

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add sample implementation of CSI SnapshotMetadata service 

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@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. 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. labels Oct 15, 2024
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 15, 2024
Implement GetMetadataAllocated RPC handler

Signed-off-by: Prasad Ghangal <[email protected]>
@PrasadG193 PrasadG193 force-pushed the snapshot-metadata-service branch from 2835d54 to 3b2b102 Compare October 15, 2024 12:21
@PrasadG193 PrasadG193 marked this pull request as ready for review October 24, 2024 17:45
@PrasadG193 PrasadG193 changed the title [WIP] Implement CSI SnapshotMetadata service Implement CSI SnapshotMetadata service Oct 24, 2024
@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 Oct 24, 2024
@xing-yang
Copy link
Contributor

/assign
/assign @bswartz

Signed-off-by: Prasad Ghangal <[email protected]>
@xing-yang
Copy link
Contributor

This is a new feature. Please add a release note.
Can you add a note in the PR description that this is a sample implementation, and not for production use.

Signed-off-by: Prasad Ghangal <[email protected]>
Signed-off-by: Prasad Ghangal <[email protected]>
@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 7, 2024
@xing-yang
Copy link
Contributor

Can you add your testing steps?

@Rakshith-R
Copy link

Can you add your testing steps?

hey @xing-yang ,

@PrasadG193 is on vacation and will be back thursday.

He had developed a client to test the new RPCs https://github.com/PrasadG193/external-snapshot-metadata-client
which has been adopted as a tool in this pr kubernetes-csi/external-snapshot-metadata#64

We are creating a gh action that adds simple e2e
kubernetes-csi/external-snapshot-metadata#67

Add a github action that:
- checkout repository
- sets up minikube
- builds latest sidecar image
- deploys csi-driver-hostpath driver resources
- runs simple e2e tests to create pvc, pod and snapshots and to write data.
- run client to verify working of both RPCs.

Sample run https://github.com/Rakshith-R/external-snapshot-metadata/actions/runs/12163453092/job/33922692908
(with the fix @iPraveenParihar has suggested above)

Signed-off-by: Prasad Ghangal <[email protected]>
@PrasadG193
Copy link
Contributor Author

@xing-yang I have documented complete test plan along with steps to deploy csi driver with external-snapshot-metadata here - https://gist.github.com/PrasadG193/1fab082f03bbdb7db25a41ed17b7e7c1

@iPraveenParihar
Copy link
Contributor

LGTM! @PrasadG193

Copy link

@bswartz bswartz left a comment

Choose a reason for hiding this comment

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

Overall this looks pretty good. There are some inefficient bits of code but for a proof-of-concept it seems fine. I found one bug with error handling.

Signed-off-by: Prasad Ghangal <[email protected]>
Copy link

@bswartz bswartz left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 16, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 17, 2024
// validate snapshot-metadata-type arg block type
bt, ok := csi.BlockMetadataType_value[*snapshotMetadataBlockType]
if !ok {
fmt.Printf("invalid snapshot-metadata-block-type passed, please pass one of the - FIXED_LENGTH, VARIABLE_LENGTH")
Copy link

@pnhoang75 pnhoang75 Dec 17, 2024

Choose a reason for hiding this comment

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

nit: use upper case for beginning of the error/exit message to conform with other error messages in the file. And probably rephase "please pass one of the -..." to "valid types are FIXED_LENGTH, VARIABLE_LENGTH".

Copy link

@bswartz bswartz left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 18, 2024
@xing-yang
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bswartz, PrasadG193, xing-yang

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 Dec 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit 245a8ee into kubernetes-csi:master Dec 18, 2024
10 checks passed
iPraveenParihar added a commit to iPraveenParihar/kubernetes that referenced this pull request Mar 19, 2025
CSI SnapshotMetadata service has been implemented for csi-driver-host-path
PR: kubernetes-csi/csi-driver-host-path#569

Signed-off-by: Praveen M <[email protected]>
iPraveenParihar added a commit to iPraveenParihar/kubernetes that referenced this pull request Mar 19, 2025
CSI SnapshotMetadata service has been implemented for csi-driver-host-path
PR: kubernetes-csi/csi-driver-host-path#569

Signed-off-by: Praveen M <[email protected]>
iPraveenParihar added a commit to iPraveenParihar/kubernetes that referenced this pull request Mar 19, 2025
CSI SnapshotMetadata service has been implemented for csi-driver-host-path
PR: kubernetes-csi/csi-driver-host-path#569

Signed-off-by: Praveen M <[email protected]>
iPraveenParihar added a commit to iPraveenParihar/kubernetes that referenced this pull request May 7, 2025
CSI SnapshotMetadata service has been implemented for csi-driver-host-path
PR: kubernetes-csi/csi-driver-host-path#569

Signed-off-by: Praveen M <[email protected]>
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants