-
Notifications
You must be signed in to change notification settings - Fork 58
faas-cli build error with dep #18
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
Comments
Good find Michael. This seems valid, although I didn't run into it in my usage of the template with @ewilde where we also vendored dependencies for the Monzo demos. I wonder what was different? My suggestion as a workaround would be to try to add a constraint whereby you skip / omit the sdk dependency in the Gopkg.toml or delete it manually as you are doing now. We need to figure out whether it's possible to have a package with its own vendor folder and then another sub-folder with more vendored folders under that. We get away with this in the "normal" Go template by not having an SDK at all. |
Derek add label: help wanted |
I got a similar error with your example:
|
I wonder if we can edit the Dockerfile so that the vendor folder gets moved one level up ready for the build? |
Couple of thoughts on this:
User story: As a template user I want to specify packages and versions in Gopkg.toml.
A workaround could be:
Not sure how much work that is for the |
- fixes issue: #18 by ignoring the function SDK through use of Gopkg.toml. If there are two nested vendor folders with the same dependency it causes a build error. Tested with a local build pairing with Michael Gasch Signed-off-by: Alex Ellis (VMware) <[email protected]>
- fixes issue: #18 by ignoring the function SDK through use of Gopkg.toml. If there are two nested vendor folders with the same dependency it causes a build error. Tested with a local build pairing with Michael Gasch Signed-off-by: Alex Ellis (VMware) <[email protected]>
I've been able to use nested folders with dep, Incan share an example if you want? Ideally you should be looking at Go modules now. Try the example that I added to the readme last week. |
Actually I am trying to test with NATS streaming and want to execute a small piece of code to send/publish messages. I have installed these modules in $GOPATH. when I build locally it builds OK but via faas-cli it fails. Any suggestion how I can make it work? |
@SidGrundfos can you push your test function to a new git repo and share that? It will be easier to debug. Also, for your specific case, have you seen the test functions in the nats-connector repo? https://github.com/openfaas-incubator/nats-connector/tree/master/contrib/test-functions Even if you aren't using the nats connector, perhaps you can checkout those test functions as a reference for your situation. It includes a publish function |
Hello its is just a very small piece of code. package function import (
) // Handle a function invocation
} I have made 2 functions using c# to send and receive functions in openfaas which works fine. |
@SidGrundfos it looks like Lucas asked for a complete GitHub repo so that we can reproduce the issue. Could you provide that? |
Hi Alex & Lucas, can you please close this issue. I am working with C# now and its working fine. Don't need it anymore. Thanks for all the help. |
Feel free to ask on Slack. |
/msg: slack |
-- |
I'll lock the thread now since it's old, if anyone lands here with an issue, please open your own one. |
faas-cli build ...
fails to build the image when the function contains external libraries vendored withdep
.Steps to reproduce:
Then it fails at Dockerfile step 7:
Took me a while to figure out how to work around that. Before
faas-cli build
remove the folderopenfaas-incubator
in the handler.govendor
folder. Then build works fine (as it will pull in the dependency from the template).Example function:
cc/ @alexellis
The text was updated successfully, but these errors were encountered: