support multiple docker parameters and task labels #1169

Merged
merged 14 commits into from Sep 2, 2016

Conversation

Projects
None yet
2 participants
@tpetr
Member

tpetr commented Jul 25, 2016

Updates Docker parameters and task labels to support multiple values for a specific key. Still testing this out.

Fixes #1074

tpetr and others added some commits Jul 25, 2016

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Aug 1, 2016

Member

@tpetr it seems the @JsonDeserialize parameter wasn't playing nice with the List<T>. It was trying to deserialize each individual SingularityDockerParameter with the custom class, not the entire list. Serialization was a bit odd also.

In cef1df4 I implemented some 'wrapper' classes for handling the custom (de)serialization. Tested it and the old Map<String, String> as well as the list of parameters was working locally. Let me know what you think of this method of getting it working.

Member

ssalinas commented Aug 1, 2016

@tpetr it seems the @JsonDeserialize parameter wasn't playing nice with the List<T>. It was trying to deserialize each individual SingularityDockerParameter with the custom class, not the entire list. Serialization was a bit odd also.

In cef1df4 I implemented some 'wrapper' classes for handling the custom (de)serialization. Tested it and the old Map<String, String> as well as the list of parameters was working locally. Let me know what you think of this method of getting it working.

@ssalinas ssalinas added the hs_staging label Aug 3, 2016

@tpetr tpetr changed the title from WIP: support multiple docker parameters and task labels to support multiple docker parameters and task labels Aug 3, 2016

@ssalinas ssalinas added the hs_qa label Aug 3, 2016

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Aug 3, 2016

Member

Note here, there was not an easy way to do this that wasn't a breaking change (that I could find). So we will need to make it clear in the release notes that while the api will accept Map<String, String> or List<SingularityDockerParameter>, it will always be returning a List<SigularityDockerParameter>, similar for task labels.

Member

ssalinas commented Aug 3, 2016

Note here, there was not an easy way to do this that wasn't a breaking change (that I could find). So we will need to make it clear in the release notes that while the api will accept Map<String, String> or List<SingularityDockerParameter>, it will always be returning a List<SigularityDockerParameter>, similar for task labels.

@ssalinas ssalinas modified the milestone: 0.10.0 Aug 4, 2016

ssalinas added some commits Aug 8, 2016

@ssalinas ssalinas modified the milestones: 0.10.0, 0.11.0 Aug 19, 2016

+ @JsonProperty("dockerParameters") Optional<List<SingularityDockerParameter>> dockerParameters) {
+ if (dockerParameters.isPresent() && !dockerParameters.get().isEmpty() && parameters.isPresent() && !parameters.get().isEmpty()) {
+ throw new IllegalArgumentException("Can only specify one of 'parameters' or 'dockerParameters'");
+ }

This comment has been minimized.

@tpetr

tpetr Aug 25, 2016

Member

I'm a little hesitant of putting these kinds of exceptions in constructors -- if we somehow had a bogus one saved we'd be throwing every time it was deserialized. What do you think about moving this into SingularityValidator instead?

@tpetr

tpetr Aug 25, 2016

Member

I'm a little hesitant of putting these kinds of exceptions in constructors -- if we somehow had a bogus one saved we'd be throwing every time it was deserialized. What do you think about moving this into SingularityValidator instead?

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Aug 25, 2016

Member

@tpetr moved those checks to the validator. Since I'm setting both objects when the deprecated one is set, validating by making sure that they are the same

Member

ssalinas commented Aug 25, 2016

@tpetr moved those checks to the validator. Since I'm setting both objects when the deprecated one is set, validating by making sure that they are the same

@ssalinas ssalinas added the hs_stable label Aug 30, 2016

@ssalinas ssalinas merged commit ff65145 into master Sep 2, 2016

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@ssalinas ssalinas deleted the multi-params-and-labels branch Sep 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment