-
Notifications
You must be signed in to change notification settings - Fork 529
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
Support Mesos fetcher cache (and other options). #637
Conversation
* Deprecates "uri" option. * Requires Mesos 0.23
Note about Travis check: |
Hi @turb, Thanks for the pull request! It looks pretty good, however there are a couple of issue to do with the way the API functions.
May I suggest we use the same rules as Marathon to deal with these two fields? We should allow the user to specify either |
@philipnrmn thanks for the feedback! On those two points, two questions:
|
It seems I have been mistaken on constraints, so let's restart the first point. Bean validation is initialized in |
@philipnrmn OK, nevermind, I changed the code to implement both points and now have to test it. Do you prefer another commit, or an amendment to the current one? |
Wow you respond quicker than I can! I was halfway through replying when your latest comment appeared. I'd prefer a separate commit, if that's OK with you. |
@philipnrmn that's because I decided to really enter in Chronos codebase, to understand how things are done, and my messages reflect this process :) I am afraid I have nearly rewritten The change will only be on the REST JSON for compatibility (and avoid the problems I mentioned in a previous message). I will be able to test this on our Mesos cluster only once it is available for disturbance, so if everything goes well the commit (with both modifications) will be pushed by the end of the week. |
Amazing! Thanks for this contribution! |
…t), and return both for compatibility
Now available for review. |
if(j.fetch.isEmpty) j.copy(fetch = j.uris.map { Fetch(_) }) | ||
else j.copy(uris = j.fetch.map { _.uri }) | ||
case j : DependencyBasedJob => | ||
if(j.fetch.isEmpty) j.copy(fetch = j.uris.map { 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.
This code is duplicated on matching each type. Consider moving it to a method.
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.
This cannot be moved to a method, due to the fact that there is a case class duplicate between ScheduleBasedJob
and DependencyBasedJob
. An alternative would be to add one case class standard copy() in the trait, just for this one usage; I don't like too much the idea.
Best course of action would be to refactor to remove duplicates in the model (out of scope of this PR).
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.
Due to the lack of standard copy command this is okay.
@philipnrmn if think this PR is ready to merge ;) |
Support Mesos fetcher cache (and other options).
Implements #611.
The replaces the
uri
option by afetch
structure that follows Mesos Fetcher configuration options.Those options are:
uri
cache
(each mesos slave involved will cache the file on disk)extract
(the file is an archive that will be extracted)executable
(the file will be chown to be executable)This has two consequences:
uri
option (for now, is mapped tofetch
with all boolean options to false).