-
Notifications
You must be signed in to change notification settings - Fork 273
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
Local paths treated like git repos? #952
Comments
Hi @camertron, thanks for the question! Is the path you're pointing to another git repo that you want to import into your project? If that is the case, you will need to link the repository via the
You can read more about working with remote sources here. However, if this is just another service in a monorepo style project you don't use the The motivation behind the That being said, the "remote sources" workflow could definitely be improved. I'd love to hear what your use case is and if you have any suggestions. Also, your comment suggests that we need to document this better. |
Hey @eysi09 thanks for your quick response :) The path I'm pointing to is another git repo, but that's sort of just a coincidence. I tried I think potentially just adding a mention of Thanks for the great tool! |
Hi @camertron, I have one question for you thou: you mentioned you can't attach the output from It would be nice to know more and also if you have a specific threat model we didn't think of. Thanks. |
@eysi09 I reopened this issue because it turns out @10ko The output .zip file contained copies of my garden.yml files, which contained names of repos, git URLs, etc. I'm currently just playing around with garden to see if it works for our use case, i.e. this is essentially throwaway stuff. |
You should be able to choose what directories you sync with the As for the That being said, we should probably detect if the We've also thought about including something like a user profile where users can set local paths to external sources. Garden could then read those and again, skip cloning and linking if applicable. Would that make sense for your use case? |
@eysi09 ah ok, I wondered about that. I tried using the I understand (and agree with) the rationale behind the A user profile would also be great, maybe a JSON file at ~/.garden? An update: I've been able to work around the rsync issues by writing a module of Let me know what you think :) |
That's interesting, and good feedback! We've been pondering how to make the external sources more easy to use, and separately pondering how we might use data volumes (e.g. for test data) more effectively. It's great to get some data points like this to help guide the design. Just on the rsync slowness issue, we've been looking into using mutagen ourselves instead of rsync. It's performant and does bi-directional syncing. Could be just what you need for your use-case? |
@edvald happy to help, and thanks again for garden! Mutagen looks very cool, but maybe overkill for our use-case? We literally just need docker containers to have access to the host filesystem. I understand NFS isn't the perfect solution (for one thing, it has to be managed separately from garden) but it seems to work well enough that I can just set it up and not think about it again. From garden's perspective, I can see how it would be desirable to continue to keep a local copy of a codebase and its remote repo separate, and I like the concept of being able to "link" a repo. Perhaps the thing to do is include an NFS (or similar) server into garden. A quick google search reveals sdc-nfs, but there may be other options out there too. |
As it happens, we actually already use NFS for our in-cluster building features, but only within the cluster to sync and then expose the build context to the Docker daemon or Kaniko. Embedding an NFS server on the client-side is something we hadn't considered, but is definitely interesting! I think the mechanics of syncing a data volume could be solved in a very similar way as to how we sync code, just need to think more about how we handle the relationship between a Oh and our pleasure :) I'm just happy that people are finding it helpful, it's super motivating to get the feedback. |
At the risk of not giving totally specific feedback on what's broken, it seems a little odd to me that it appears difficult to set up existing local git repos with files modified (i.e. not a specific committed git ref) outside of a garden project directory. I would guess that this would be a fairly common use case. Perhaps an example project that does this would be useful? Not clear that to me that I'm doing things right or wrong with modules and sources and repositoryUrls. And the sources and repositoryUrls even when set up with "file:///" seem to want to rsync a specific git ref. |
Closing this issue as the behaviour is documented here: https://docs.garden.io/using-garden/using-remote-sources#local-sources-modules |
@eysi09 are local sources still rsynced into the .build directory? If so then the concerns I've raised in this issue are still relevant and I think it should be re-opened. |
All your source code is rsynced into the If we wouldn't rsync external sources, Garden wouldn't be aware of them. |
@eysi09 yes, I understand. As I've detailed in previous comments, rsyncing is slow, space-consuming, and not bi-directional. I had hoped for a way to point garden at a local directory with no rsyncing. I had also suggested adding NFS support, which would address all my concerns. If local directories without rsync aren't on the roadmap and that's why this issue was closed, then that's fine. If not, then I think my concerns are still relevant. |
Bug
Current Behavior
I'm trying to point garden at a local path via the
repositoryUrl
option. Not only does garden expect the path to end with a git ref (i.e.#master
) which doesn't make sense to me, it also doesn't pick up local changes I make in that directory. Any changes I make to the Dockerfile, for example, aren't picked up when garden builds the image. I guess garden is checking the repo out at master, discarding my local changes in the process?It's absolutely possible I'm misunderstanding how garden is supposed to work, but I thought the whole point was to enable local development via k8s. How does that work if it treats all
repositoryUrl
s as remotes?Expected behavior
I expected garden to be able to "see" changes inside a local directory.
Reproducible example
Point your garden.yml at any local path, make a local change and run
garden build
. The local change won't make it into the image.Your environment
Mac OS 10.13.6
kubernetes 1.10.11
garden version
= 0.10.0Not attaching result of
get debug-info
because it contains sensitive info.The text was updated successfully, but these errors were encountered: