Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

build error due to csi in container-storage-interface API changed #57

Closed
andyzhangx opened this issue Feb 28, 2018 · 15 comments
Closed

Comments

@andyzhangx
Copy link

Anyone know how to work around this issue?

root@andy-dev:~/go/src/github.com/kubernetes-csi/drivers# make hostpath
if [ ! -d ./vendor ]; then dep ensure; fi
go build -i -o _output/hostpathplugin ./app/hostpathplugin
# github.com/kubernetes-csi/drivers/pkg/csi-common
pkg/csi-common/nodeserver-default.go:47:66: undefined: csi.NodeGetIdRequest
pkg/csi-common/nodeserver-default.go:47:90: undefined: csi.NodeGetIdResponse
pkg/csi-common/nodeserver-default.go:55:10: undefined: csi.NodeGetIdResponse
pkg/csi-common/utils.go:55:8: cannot use major (type int32) as type uint32 in field value
pkg/csi-common/utils.go:56:8: cannot use minor (type int32) as type uint32 in field value
pkg/csi-common/utils.go:57:8: cannot use patch (type int32) as type uint32 in field value
Makefile:30: recipe for target 'hostpath' failed
make: *** [hostpath] Error 2

Using master branch of github.com/container-storage-interface/spec/lib/go/csi is incorrect now since csi api has changed.
@rootfs

@andyzhangx andyzhangx changed the title build error due to csi API changed build error due to csi in container-storage-interface API changed Feb 28, 2018
@andyzhangx
Copy link
Author

just could not find the correct commit:

git checkout 2571bd3ff69187efbaef51f3eae6235af59b1614
root@andy-dev:~/go/src/github.com/kubernetes-csi/drivers# make hostpath
if [ ! -d ./vendor ]; then dep ensure; fi
go build -i -o _output/hostpathplugin ./app/hostpathplugin
# github.com/kubernetes-csi/drivers/pkg/csi-common
pkg/csi-common/utils.go:97:9: cannot use ids (type *DefaultIdentityServer) as type csi.IdentityServer in argument to s.Start:
        *DefaultIdentityServer does not implement csi.IdentityServer (missing GetPluginCapabilities method)
pkg/csi-common/utils.go:105:9: cannot use ids (type *DefaultIdentityServer) as type csi.IdentityServer in argument to s.Start:
        *DefaultIdentityServer does not implement csi.IdentityServer (missing GetPluginCapabilities method)
pkg/csi-common/utils.go:113:9: cannot use ids (type *DefaultIdentityServer) as type csi.IdentityServer in argument to s.Start:
        *DefaultIdentityServer does not implement csi.IdentityServer (missing GetPluginCapabilities method)
Makefile:30: recipe for target 'hostpath' failed

@andyzhangx
Copy link
Author

v0.1.0 works, while there is build error for master branch

@sbezverk
Copy link
Contributor

sbezverk commented Feb 28, 2018

@andyzhangx Currently CSI master points to CSI Spec 0.2.0 which introduced breaking changes. There is an effort to convert all existing plugins, as well as provisioner/attacher/registrar to support CSI Spec 0.2.0. Here is my PR which addresses hostpath plugin and csi-common 0.2.0 changes:
#56
Please keep in mind that you still need new provisioner and registrar. New external attacher was merged this morning.

@andyzhangx
Copy link
Author

@sbezverk thanks, I am going to write a new CSI driver, so should I start with v0.1.0 or just wait for 0.2.0? I still need new provisioner and registrar for 0.2.0, it looks like v0.2.0 is still on-going.

@sbezverk
Copy link
Contributor

sbezverk commented Mar 1, 2018

@andyzhangx please do not bother doing anything for 0.1.0, registrar and attacher are already merged, provisioner will be merged tomorrow. You can start working for 0.2.0 right away :)

@andyzhangx
Copy link
Author

@sbezverk thanks for clarification, I just would like to make it very detailed, so when the following images would be ready in docker hub, do I need to build them myself?

docker.io/k8scsi/csi-provisioner:0.2
docker.io/k8scsi/csi-attacher:0.2
docker.io/k8scsi/driver-registrar:0.2

Is there any example config when 0.2.0 is ready, I got an 0.1.0 example from here:
https://raw.githubusercontent.com/lpabon/csi-workspace/master/demo/hostPath.yaml

@sbezverk
Copy link
Contributor

sbezverk commented Mar 1, 2018

@andyzhangx the images will be available at quay.io/k8scsi
See this link for my hostpath plugin yaml: https://gist.github.com/sbezverk/2229db8d27968c1a968e3a4ab5dabe14

@andyzhangx
Copy link
Author

@sbezverk thanks, you are awesome!

@andyzhangx
Copy link
Author

hi @sbezverk you are using image from 192.168.80.240:4000/k8scsi/csi-provisioner:v0.2.0, could you put those images into docker pub? thanks.

@arm64b
Copy link

arm64b commented Mar 15, 2018

Hello @sbezverk , I've setup an CSI-enabled k8s cluster with kubeadm, but when I create the csi-pod with:

#kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/docs/master/book/src/example/csi-setup.yaml

The command kubectl get pod always shows:

s# kubectl get pod
NAME      READY     STATUS              RESTARTS   AGE
csi-pod   0/4       ContainerCreating   0          3m

Do I need to adapt that yml file to my local environment, but seems there's not env specific settings in that yaml file. Any suggestions?

@andyzhangx
Copy link
Author

external-provisioner is crahsing, it says:

#kubectl logs -p csi-pod -c external-provisioner
I0315 08:14:04.529371       1 csi-provisioner.go:68] Building kube configs for running in cluster...
I0315 08:14:04.561105       1 controller.go:84] Connecting to /csi/csi.sock
I0315 08:14:04.561319       1 controller.go:111] Still trying, connection is CONNECTING
I0315 08:14:04.561816       1 controller.go:108] Connected
I0315 08:14:04.561879       1 controller.go:75] GRPC call: /csi.v0.Identity/GetPluginCapabilities
I0315 08:14:04.561961       1 controller.go:76] GRPC request:
I0315 08:14:04.564703       1 controller.go:78] GRPC response: capabilities:<service:<> >
I0315 08:14:04.564749       1 controller.go:79] GRPC error: <nil>
F0315 08:14:04.564792       1 controller.go:198] no plugin controller service support detected

@arm64b
Copy link

arm64b commented Mar 15, 2018

@andyzhangx are you using the cmd #kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/docs/master/book/src/example/csi-setup.yaml to create the csi-pod? But the output of #kubectl logs -p csi-pod -c external-provisioner in my side is:

# kubectl logs -p csi-pod -c external-provisioner
Error from server (BadRequest): previous terminated container "external-provisioner" in pod "csi-pod" not found

@andyzhangx
Copy link
Author

@arm64b yes, i am using the same cmd, you may delete it and recreate.

@arm64b
Copy link

arm64b commented Mar 15, 2018

Yes, I delete it, the kubectl get pod shows No resources found, then I create it again with kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/docs/master/book/src/example/csi-setup.yaml:

storageclass "csi-hostpath-sc" created
serviceaccount "csi-service-account" created
clusterrole "csi-cluster-role" created
clusterrolebinding "csi-role-binding" created
pod "csi-pod" created

The kubectl get pod output then:

NAME      READY     STATUS              RESTARTS   AGE
csi-pod   0/4       ContainerCreating   0          3s

After that:

# kubectl logs -p csi-pod -c external-provisioner
Error from server (BadRequest): previous terminated container "external-provisioner" in pod "csi-pod" not found

@pohly
Copy link
Contributor

pohly commented Mar 15, 2018

F0315 08:14:04.564792 1 controller.go:198] no plugin controller service support detected

This was found and fixed yesterday, see PR #69. The images need to be updated to reflect that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants