-
Notifications
You must be signed in to change notification settings - Fork 224
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
Can't have "template" folder in function folder #745
Comments
This was done in #524 to fix #478 The relevant line is here Line 197 in e5f498a
We could probably change the check to inspect the abs path and if it is equal to Also the build output should indicate that the folder is being skipped Line 240 in e5f498a
|
I remember, thank you for the links to the issues/PR. I think this will lead to bugs that are nasty to debug if left as is. Would you like to write some tests to prove the issue and then fix? |
I'm not sure this is as simple as it seems on first glance owing to the decision to support the use case in #478. Consider a scenario where the handler resides in the same folder as the stack, for the (broken) cloudlogo project this would mean:
Here the user would build from within
The
Which leaves the user with:
We can see the user's template is now in with the OpenFaaS templates. Now if the user tries to build the CLI will not copy the template folder. If changes were made to copy the template folder then the OpenFaaS templates would be copied into the resulting function image. Furthermore, there is a proposal in #849 to clobber the template folder when overwriting, which if adopted would potentially regress any solution here. I think much of the conversation on #478 remains relevant here, particularly @LucasRoesler's query as to whether to support the handler and stack being co-located. Failing that, the idea of using .folders to separate the OpenFaaS and userland contexts seems like a cleaner alternative to iterating through a |
I have a rather big proposal, but one i have thought about for awhile and can implicitly fix this problem as well. what if we mimicked some of the behavior we see with go modules? Specifically:
this proposal does a couple of things First, the files Second, this new cache scheme still allows for multiple versions of a template to be used between different projects. Third, this also reduces the number of times a template needs to be copied to a machine. Finally, we elimate any need to guess about colocated It is important to note that this change is not backwards compatible, but we can achieve compatibility by incrementing the version in the stack.yaml . We would have Version 2 would also remove the This also means we can remove the |
@LucasRoesler could you spin out your comment on the lock files into its own issue? |
Can't have "template" folder in function folder
Expected Behaviour
This function stopped working at this commit, renaming template to templates fixed the issue
alexellis/cloudlogo@9e29ed5
Possible Solution
Revisit any code that does a blanket ban on copying "template" or "build" folders in the pre-build stage.
The text was updated successfully, but these errors were encountered: