-
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
Proposal: "Context"-aware resources #73
Comments
I don't have any good ideas for how to model this in the config just yet. |
What if a job could take multiple commands? Analogous to a kubernetes pod, that aggregate multiple containers. The same job could take multiple commands that would share the same environment variables. Plus the image resource would not need to depend on env resources. Then deprecate the env resource and rename job to env env=dev:
net-mode: host
user: "{user.uid}"
use: dev-image
mounts: [source]
commands:
- name: webpack
command: webpack --config build/prod.js
- name: watch
interactive: true
command: node src/hot.js
depends: [webpack]
vars:
- "NODE_ENV=development" Then call it like
|
A container can only run one process (unless you exec). Would each command be an exec, or would they be different containers? Are they sequential or parallel? Instead of answering all of those questions, why not just add a bash script to run the commands the way you want to? Or separate jobs of they are meant to be independent.
I think the problem is more with the non-job resources. You may want to share a captured environment variable with an
Not sure how this would work. They are very different right now. |
I'm thinking something like this: A new field
When the tasks run, any of these "context-like" tasks are skipped until they are actually required. The |
There are two conditions which result in sub-optimal behaviour:
env
resource can modify the behaviour of a task, which requires all subsequent tasks be marked as "required" (they can't be skipped)compose
resources (and the proposedservice
andjob:serve
resources) create long running processes, so they must always run. There's no way to skip these tasks without doing some kind of look-ahead, but there isn't current enough information in the config format to determine how far to look ahead. It's not clear which of the following steps use the service.I think both of these issues could be addressed by adding some form of a "context" (inspired by python context managers).
This config construct would provide a scope for the above resources, making it possible to skip long-running tasks (if all the tasks inside the scope are fresh), and only "require" tasks within the environment scope.
The text was updated successfully, but these errors were encountered: