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

Import Argo client library but build failed. #1983

Closed
fscnick opened this issue Jan 15, 2020 · 5 comments
Closed

Import Argo client library but build failed. #1983

fscnick opened this issue Jan 15, 2020 · 5 comments

Comments

@fscnick
Copy link

fscnick commented Jan 15, 2020

Summary

Tried to utilize client library reference example/example-golang to fulfill our need. But build failed. Is something I did wrong? The snippet is from go.mod

	github.com/argoproj/argo v2.4.3+incompatible
	github.com/argoproj/pkg v0.0.0-20200102163130-2dd1f3f6b4de // indirect

Motivation

At the first, I encountered:

# k8s.io/client-go/rest
../../go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/rest/request.go:598:31: not enough arguments in call to watch.NewStreamWatcher
        have (*versioned.Decoder)
        want (watch.Decoder, watch.Reporter)

I googled and follows kubernetes/client-go#584 (comment)

Use go get k8s.io/client-go@master to upgrade client-go

After that, it came with another broken

# github.com/argoproj/argo/pkg/client/clientset/versioned/typed/workflow/v1alpha1
../../go/pkg/mod/github.com/argoproj/argo@v2.4.3+incompatible/pkg/client/clientset/versioned/typed/workflow/v1alpha1/workflow_client.go:63:32: undefined: serializer.DirectCodecFactory
# github.com/argoproj/argo/workflow/artifacts/hdfs
../../go/pkg/mod/github.com/argoproj/argo@v2.4.3+incompatible/workflow/artifacts/hdfs/util.go:21:10: options.KerberosClient undefined (type hdfs.ClientOptions has no field or method KerberosClient)
../../go/pkg/mod/github.com/argoproj/argo@v2.4.3+incompatible/workflow/artifacts/hdfs/util.go:22:10: options.KerberosServicePrincipleName undefined (type hdfs.ClientOptions has no field or method KerberosServicePrincipleName)
@fscnick
Copy link
Author

fscnick commented Jan 16, 2020

I referenced Gopkg.lock to specify go mod to download exact version mentioned in the file. It seems passed but now I got stuck at

# github.com/argoproj/argo/workflow/metrics
.dockerbuild/gopath/pkg/mod/github.com/argoproj/argo@v2.3.0-rc3.0.20200115233111-48b85e5705a2+incompatible/workflow/metrics/collector.go:72:54: too many arguments in call to prometheus.NewProcessCollector
        have (int, string)
        want (prometheus.ProcessCollectorOpts)

It had mismatched function arguments with our imports, we use v1.0.0. Instruct go mod to download old version seems useless, it would fresh to v1.0.0.

By the way, I change to master branch.

@clementlecorre
Copy link

I have exactly the same problem (argo@v2.4.3). How do I fix it?
(I have the same mistake with master)

@fscnick
Copy link
Author

fscnick commented Jan 16, 2020

Finally, I took a workaround. The grpc client is what I wants, so copy the code related to grpc and it worked.

@clementlecorre
Copy link

clementlecorre commented Jan 16, 2020

Finally, I've also found a solution which works...

github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31 // indirect
github.com/argoproj/argo v2.3.0-rc3.0.20200115233111-48b85e5705a2+incompatible

@alexec
Copy link
Contributor

alexec commented Jan 29, 2020

See #1375

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

Successfully merging a pull request may close this issue.

3 participants