HomeMesosphereNo notifications. 4 unresolved issues.

cluster constraint should accept hostname field without a value
ClosedAll Users

Authored by jdef on Mar 30 2017, 8:19 PM.

Diff Detail

Repository
rMARATHON marathon
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jdef created this revision.Mar 30 2017, 8:19 PM
jenkins requested changes to this revision.Mar 30 2017, 8:20 PM
This revision now requires changes to proceed.Mar 30 2017, 8:20 PM
jdef added a comment.Mar 30 2017, 8:23 PM

I wonder if it's worth writing an integration test that validates the behavior of the CLUSTER operator as part of this ticket?

timcharper accepted this revision.Mar 30 2017, 8:40 PM
jdef planned changes to this revision.Mar 30 2017, 9:31 PM

um .. this is interesting: it appears that CLUSTER doesn't require a value at all, regardless of field: https://github.com/mesosphere/marathon/blob/5495479035facdcca05d6b58c6c09a0413c02c34/src/main/scala/mesosphere/mesos/Constraints.scala#L114

jdef updated this revision to Diff 2454.Mar 30 2017, 9:55 PM
jdef edited the summary of this revision. (Show Details)Mar 30 2017, 9:56 PM
jenkins requested changes to this revision.Mar 30 2017, 10:00 PM
This revision now requires changes to proceed.Mar 30 2017, 10:00 PM
jdef planned changes to this revision.Mar 30 2017, 10:59 PM
jdef added inline comments.
docs/docs/constraints.md
68

You can also tie an app to a specific node...

jdef marked an inline comment as done.Mar 30 2017, 11:13 PM
jenkins requested changes to this revision.Mar 30 2017, 11:13 PM
This revision now requires changes to proceed.Mar 30 2017, 11:13 PM

<3 the writing.

This revision is now accepted and ready to land.Mar 30 2017, 11:44 PM
aquamatthias accepted this revision.Mar 31 2017, 2:04 PM

Nice!

src/main/scala/mesosphere/marathon/api/v2/validation/SchedulingValidation.scala
57

"Missing field" could be a constant as well.

jdef added inline comments.Mar 31 2017, 5:02 PM
src/main/scala/mesosphere/marathon/api/v2/validation/SchedulingValidation.scala
57

agreed, there are a bunch of validation messages scattered over the codebase that could be formalized. i've been formalizing the ones that are referenced in the new test cases that I'm writing. i'll leave this one alone, refactoring it will be an exercise for a future validation unit test refactoring effort

This revision was automatically updated to reflect the committed changes.

Little edits and one question.

docs/docs/constraints.md
33

comma after specified, remove "then"

36

commas around "for example"

38

suggest: "The <hostname> field tells Marathon that the launched tasks of the app or pod should be launched together on the same agent."

Unless this is a term of art, I'm not sure that "have affinity for each other" is precise enough language to be useful to a user.

Which element of the example below is hostname?

39

When a value for <hostname> is specified, tasks are launched..."

40

When the <hostname> value is empty or unspecified, the first...."

43

When attribute fields are specified, tasks...

44

When attribute fields are empty or unspecified, the first...

46
Examples

The example below specifies the exact rack on which to run app tasks:

57

This example leaves the attribute field empty. This tells Marathon that all of the app tasks should run on the same rack, but does not specify which.

68

This example specifies that an app <!-- or pod? --> must run on a specific node.

79

Below, the attribute field is empty. This tells Marathon that all app tasks must run on the same node, but does not specify which.