-
Notifications
You must be signed in to change notification settings - Fork 96
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
Higher level commands #488
Comments
This is not so obvious. Other people (like me) can read this arrow as "then". |
Sure, this was just a quick sketch. It's currently more of a question of whether we want a graph, a block diagram, or maybe just 'before/after' parameters in commands themselves? |
Another idea about subprojects and workspaces was here: #14 |
Well, the good part of discussion in #14 is that you might want subprojects be:
So subprojects are specified like this:
The problems are:
|
Motivation
As projects managed by vagga get bigger, we need more tools to manage them easily. Here is a set of ideas in unified discussion to find out how they fit together.
Proposal
1. Using Commands From Different Mixins
When there was only one file we could use anchors to refer to the commands defined elsewhere, but when using mixins we can't. This is mostly useful for supervise commands.
This is #466, but using shorter
!Ref
syntax:2. More powerful pipelines
Currently we have:
prerequisites
to run commands sequentially!Supervise
to run commands in parallelBut what we really want is more than that:
And all the combinations of above. This is a tough problem to solve, but let's imagine we can draw
a diagram:
Or maybe using a graph (dot-like syntax, where arrow
->
means "depends on", or "after"):3. Subprojects
Mixins and subconfigs are great for reusing parts of configs from elsewhere, but they only work when target config is specifically prepared to be sourced. For example, they don't change where
/work
dir point to. Also subconfigs don't handle commands at all, while mixins handle command conflicts by overriding commands (which is fine for them but not for cross-project embedding).So this issue proposes
subprojects
:In this case
!Ref db:run
anddb:migration
work exactly the same as if you would runvagga run
orvagga migration
in thecookbook/postgres
directory, but allows commands to be used as part of a higher level pipeline.The subprojects here are just subdirectories. It's expected that they are git submodules in most cases, but no such obligations are done.
One of the questions here is how
.vagga
folder is managed here? Are these projects glued together, or work exactly as cd'ing into a directory? Separate dirs work with a least surprise for user. While single directory is probably faster and more space-efficient, still having more edge-cases though.4. Workspaces
The idea is that subprojects should be great, but we also want loose coupling.
Let's imagine we have services B and C depend on A. They both probably have
A
as a subproject. But then we have a superproject which contains all the A, B, and C. And at a glance it looks like A will be duplicated three times.This is easy to overcome if you have only one "superproject". Just don't use subprojects for inner
project and run anything that involves more than one project in a top level thing. This doesn't work well for integration tests though.
So the idea here is probably to have a parent directory for multiple projects and to remap their subprojects to different folders. I.e.
workspace/B/A
should be mapped toworkspace/A
, it's easyto do inside vagga using bind mounts.
While it looks so simple the real questions of how to organize workspace, is it versioned, how to match common subprojects, how to manage git submodules, and so on. So probably we should postpone it until we have more usecases for subprojects to find good solution to the problem.
The text was updated successfully, but these errors were encountered: