-
Notifications
You must be signed in to change notification settings - Fork 35
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
Refactor uris/fetch #109
Refactor uris/fetch #109
Conversation
Hi, I was unhappy with my patch, so I propose to merge URIs and Fetch sub element when the task is created instead of the moment the task is effectively launched. |
Agreed that keeping stuff out of scheduler/ when possible is a good call because it's also the biggest by far submodule. It's always bit worrying to break backwards compatibility even if reading back the uris is a very minor usecase. It would be possible to reconstruct the request if we add some metadata to URIs but I don't think it's worth it. But at the very least we should keep the recently added "fetch" except that it now would contain both "uris" and "fetch" from the request. |
Hi @keis, My intent is not to break backward compatibility at user layer, but to use NewEremeticTask as "a translator", to map thanks for your time |
SandboxPath string `json:"sandbox_path"` | ||
AgentIP string `json:"agent_ip"` | ||
AgentPort int32 `json:"agent_port"` | ||
ForcePullImage bool `json:"force_pull_image"` | ||
FetchURIs []URI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking this one should still be added to the json as "fetch"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do, thanks for the review
Sure thing mapping the internal structure is perfectly fine. But it is desirable that the information POSTed is retrievable later on, and ideally in a similar format. We're still in 0.x so moving around and deprecating things is still pretty easy and if going this route it would only be natural to eventually remove "uris". We have some issues tracking the other things you mention (#64 and #59) but it's nothing we're actively working on. Thanks for helping out and making eremetic better :) |
We should consider removing URIs and having only the new Fetch feature before 1.0, as it is more or less a duplication, with the latter having more features. As @keis said we are still in "unstable" mode which means the API can quite easily change. Being able to get back what you sent in with a POST (with the exception of masked environment variables) is something I'd like to keep as far as possible. |
Thanks for the clarifications. I neglected the convenience to get back a valid request from the /task endpoint.
|
I don't think it has to exactly match any of those but the rule of least surprise tells us it should look familiar. The main use is being able to answer stuff like
Nudging people over to the new style is probably a good thing |
Anyway LGTM and if you rebase on latest master I think coveralls will shut up as well :) |
Move merging of uris/fetch from launch task to create tasks by replacing URIs/Fetch element from EremeticTask to a single one, FetchURIs, loosely based on mesos protobuf.
please don't merge it for now, I've just noticed an upleasant side effect of |
Sure, let us know when you feel it's ready to merge. |
you can merge it, thanks. I'd prefer to not squash last commit, because it fixes types.URI struct |
Thanks 😸 |
Move merging of uris/fetch from launch task to create tasks by
replacing URIs/Fetch element from EremeticTask to a single one, FetchURIs,
loosely based on mesos protobuf.
This change breaks the 1:1 mapping on request to task.