-
Notifications
You must be signed in to change notification settings - Fork 36
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
Release-friendly workflow/plugin load paths #242
Comments
Is there anything hindering that 'goplugins' resides under the 'bin' directory in the brew layout? |
No problem I can think of with moving
|
Seems sane to me; +1 |
It's a little weird to have subdirectories of |
I reckon I can work with the symlink. |
@ahpook in some sense, I think we’re in uncharted territory with our plugin approach combined with a desire to package it all as one installable thing and that’s partly why subdirectories below bin are uncommon. It makes perfect sense to me to use a subdirectory for our use case unless we’re breaking some rule that I’m unaware of. |
@scottyw I don't understand the comment about "go run ...". Does using that mean that you end up with a binary that doesn't have a proper path for the executable? |
The rule I think is most applicable is the Linux FHS guidance:
The goplugins are more like the FHS description of
|
If subdirectories in bin is a bad idea, perhaps we should reflect that in our build? How about building:
|
I'd be OK with those build changes @thallgren - if we're in agreement I'll make them as part of this work. I guess we'd want to look for workflows in both of these dirs then?
Regarding your "go run" comment, my thinking is that since "go run" puts the binary in a tmp dir we can't infer the location of the workflows from the executable's location e.g.
We use the current working dir to find the goplugins in the build dir. |
Actually, I'd prefer if we just rooted the loader at I understand why we need the |
I was hesitant to copy workflows and types because it adds a step to the workflow authoring process i.e. "edit file, run do copy via make, run lyra" whereas today we have a tighter and possibly less error-prone "edit file, run lyra" loop. If the user decides to edit the file inside the build dir to avoid the hassle of running the copy, they're at risk of accidentally losing that work when the contents are deleted/overwritten by the build. That's really why I wanted to primarily find things based on executable location but also allow current working dir as a convenience. |
If the concern is the actual "make" step, then I think that we're on the wrong path. If the user wants something that's pre-built, then the brew install is the answer. If not, then the user should be prepared to issue the make command to get things in order. IMO, we should not cater for something in between. In particular, we should not make our binary expect things like that to work. |
Regarding authoring and extra step. If the two roots are |
Yeah, you're right. So, we leave the build alone and use WORKING_DIR and EXECUTABLE_DIR/.. as the roots for finding workflows. That works for me. |
I think the build still needs to change so that 'bin' and 'goplugins' become adjacent. |
A related thing came up: when running from a container (either in operator mode or locally using docker) we needed a mount point for users to attach a volume for their workflows; I couldn't find a well established pattern for this so I just chose
|
I think this is complete, modulo the Type bug in #262 |
To support running Lyra as a binary installed via brew and when built from source we need to change the load paths for workflows and plugins, based on both the current working dir and the dir in which the binary is located.
Brew lay files out like this:
When built from source, the binaries are laid out like this (although we could change this if desired):
When using
go run cmd/lyra/main.go
during development I think we can assume that is happening in the root of the project repo.Below then, assume that
WORKING_DIR
refers to the current working dir and thatEXECUTABLE_DIR
refers to the dir containing the Lyra binary.We need to load workflows from both of:
WORKING_DIR/workflows
EXECUTABLE_DIR/../workflows
(to support brew and runningbuild\lyra
irrespective of working dir)The search path for plugins, in order, is:
WORKING_DIR/build/goplugins
(to support both plugin and lyra development)EXECUTABLE_DIR/goplugins
(to support running the built binary)EXECUTABLE_DIR/../goplugins
(to support brew)The text was updated successfully, but these errors were encountered: