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

run kubernetes csi-test suite on ceph-csi #250

Open
Madhu-1 opened this issue Mar 11, 2019 · 25 comments
Open

run kubernetes csi-test suite on ceph-csi #250

Madhu-1 opened this issue Mar 11, 2019 · 25 comments
Assignees
Labels
component/testing Additional test cases or CI work keepalive This label can be used to disable stale bot activiity in the repo

Comments

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Mar 11, 2019

we need to integrate ceph-csi with csi-test to test the CSI API capability of a driver.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Mar 11, 2019

@nixpanic

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Apr 4, 2019

CC @ShyamsundarR

@ShyamsundarR
Copy link
Contributor

csi-test plugin sanity runs by acting like the kubernetes driver services (provisioner/attacher/snapshotter etc.). IOW it sends in the required RPCs that invoke CSI plugin functionality across supported calls.

Hence, it does not need a kubernetes setup to run, or the kubernetes sidecars to function, it needs a running plugin instance to send the RPCs to. Also, it does not, as a result, pollute the CO system it is running on (in case it is used in such a manner).

Hence to run this against ceph-csi, without mocking any interface in ceph-csi plugins, we need the following prerequisites satisfied,
Prerequisites:

  • A working ceph cluster, to point the plugin to perform its operations
  • A environment with required ceph CLIs such that the plugin can make its CLI calls when running in such an environment
    • This can be a standalone node, where we bring up the plugin binary, OR
    • A kubenetes environment, where we run the plugin image as a pod (no csi sidecars required)

To run it in the above environment,

  • Start the plugin (rbd or cephfs) with the required CLI arguments
    • Make sure to note the socket path that the plugin will listen on, as that is to be used as a parameter to the sanity test utility
    • If running standalone (outside kubernetes), all options (like, metadataStorage) that refer to kubernetes objects, should be configured to point to node specific locations
  • Run the csi-sanity command like so, csi-sanity -ginkgo.v --csi.endpoint=/<socket-path>/csi-test.sock --csi.testvolumeparameters=./sc.yaml where sc.yaml contains all the required "YAML file of volume parameters for provisioned volumes"
    • In my case for stateless testing this yaml contained the following:
---
clusterID: rookcluster
pool: replicapool
imageFormat: "2"
imageFeatures: layering
  • It is also required to have a secrets file, which I did not use, as I was testing the stateless implementation which uses secrets from the cluster-id secrets, and does not need it separately

NOTE: Current pass rate is about 50% with some low hangers that we can fix to improve the same.


Thoughts on integration:

  • Run this for each PR
  • Environment to run this in needs some thought, as we need the prerequisites sorted out
  • Extend this as a framework, or use a similar framework to test out plugin internals by doing the required mocking or operating on the ceph cluster outside the plugin and forcing certain edge conditions to ensure plugin sanity closer to a unit test level test suite

Other frameworks that test CSI plugin functionality from a kubernetes standpoint also help, but to test out ceph-csi specific internals, IMO we need to start here and dig down into the code for other edge conditions, than use broader integration test frameworks to achieve the same.

@ShyamsundarR
Copy link
Contributor

Here are the pod and RBAC manifests used against v1.0.0 rbdplugin for a test.

rbdplugin-pod.yaml
rbdplugin-rbac.yaml
Output from the test

@ShyamsundarR
Copy link
Contributor

ShyamsundarR commented Apr 7, 2019

As a part of broader CI possibility, played with running minikube on TravisCI and here is an initial run, that setups up rook on a minikube instance in TravisCI. The files and code are here, and we can possibly start from here and see how to run csi-test suite next on the same.

@leseb
Copy link
Member

leseb commented Apr 10, 2019

CircleCI config to run minikube https://github.com/ceph/cn/blob/master/.circleci/config.yml

@mykaul
Copy link
Contributor

mykaul commented Jul 16, 2019

@ShyamsundarR - any updates?

@ShyamsundarR
Copy link
Contributor

@ShyamsundarR - any updates?

I am not on this task. I provided information based on runs and setup that I did to test the same out, to aid adoption into the e2e framework.

I agree this is a priority, as it helps keep the CSI plugins code quality higher and should be tracked as such.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jul 16, 2019

@humblec @ShyamsundarR @poornimag @nixpanic anyone like to take this up for next release?

@nixpanic nixpanic self-assigned this Oct 24, 2019
@nixpanic
Copy link
Member

Not sure for what release this will be ready, but I'm working on this a little now.

Environment for local testing:

  • vagrant VM with CentOS-7
  • minikube inside the VM (with --vm-driver-none)
  • Ceph Nano for minimal Ceph environment
  • Ceph-CSI from local git repository with last commit

This should allow for easy integration in the CentOS CI or other CI environments.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Oct 30, 2019

@nixpanic how about running this as a kubernetes Job in E2E testing?

we should be able to download the csi-sanity binary and connect to the socket where csi driver is running

@nixpanic
Copy link
Member

nixpanic commented Jan 8, 2020

@humblec
Copy link
Collaborator

humblec commented Apr 1, 2020

@nixpanic @Madhu-1 do we need this any more ?

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Apr 1, 2020

Yes we need to run csi-test with cephcsi

@humblec
Copy link
Collaborator

humblec commented Apr 1, 2020

Yes we need to run csi-test with cephcsi

as long as we cover the features with e2e i miss the point why we need that :)

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Apr 1, 2020

Yes we need to run csi-test with cephcsi

as long as we cover the features with e2e i miss the point why we need that :)

to make sure we return proper error code and to make sure we are not missing any other valid or invalid cases

@nixpanic nixpanic added this to the release-3.0.0 milestone Apr 10, 2020
@nixpanic nixpanic added component/testing Additional test cases or CI work and removed release-3.0.0 labels Apr 17, 2020
@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jul 20, 2020

@nixpanic do we need it in release-3.0.0 milestone? or can we move it outside

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Aug 6, 2020

@nixpanic can this be done in 3.1.0? or do we need to move it out to the next release?

@humblec
Copy link
Collaborator

humblec commented Aug 10, 2020

Moving this from release 3.1.0

@humblec humblec removed this from the release-3.1.0 milestone Aug 10, 2020
@humblec
Copy link
Collaborator

humblec commented Oct 1, 2020

@yati1998 is this something you would like to explore ?

@humblec humblec added this to the release-3.2.0 milestone Oct 1, 2020
@yati1998
Copy link
Contributor

yati1998 commented Oct 1, 2020

@humblec sure I will take a look in this.

@yati1998
Copy link
Contributor

@yati1998 is this something you would like to explore ?

@humblec it will be difficult for me to work on this as of now. If it is a priority issue, it will be better to assign it to someone who have experience on this. Sorry for mentioning this so late.

@Madhu-1 Madhu-1 modified the milestones: release-3.2.0, release-3.3.0 Dec 8, 2020
@Madhu-1 Madhu-1 modified the milestones: release-3.3.0, release-3.4.0 Apr 7, 2021
@nixpanic
Copy link
Member

I'm moving this out of 3.4 in favour of #2015

@nixpanic nixpanic removed this from the release-3.4.0 milestone Apr 22, 2021
@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 21, 2021
@Madhu-1 Madhu-1 added keepalive This label can be used to disable stale bot activiity in the repo and removed wontfix This will not be worked on labels Sep 15, 2021
@humblec
Copy link
Collaborator

humblec commented Jan 27, 2022

/assign @humblec

@humblec humblec added this to the release-3.6 milestone Jan 27, 2022
@Madhu-1 Madhu-1 assigned humblec and unassigned nixpanic Jan 27, 2022
@humblec humblec removed this from the release-3.6 milestone Mar 28, 2022
nixpanic pushed a commit that referenced this issue Mar 23, 2023
Avoid extra RPC calls as request will be requested again for
updating the LastSyncTime in the status. The image need to be
promoted only one time not always during the reconcile.

fixes: #250

Co-authored-by: Madhu Rajanna <[email protected]>
Signed-off-by: yati1998 <[email protected]>
nixpanic pushed a commit to nixpanic/ceph-csi that referenced this issue Mar 4, 2024
Syncing latest changes from upstream devel for ceph-csi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/testing Additional test cases or CI work keepalive This label can be used to disable stale bot activiity in the repo
Projects
None yet
Development

No branches or pull requests

7 participants