Skip to content
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

allow deploy to specify port index for healthchecks and LB api #887

Merged
merged 3 commits into from Feb 10, 2016
Merged

Conversation

@ssalinas
Copy link
Member

ssalinas commented Feb 9, 2016

On the deploy you can specify loadBalancerPortIndex or healthcheckPortIndex (e.g. 0 for first allocated port, 1 for second allocated port). Defaults to 0 if not specified

/fixes #886

@ssalinas ssalinas added the hs_staging label Feb 9, 2016
@@ -281,6 +289,11 @@ public String getId() {
return healthcheckTimeoutSeconds;
}

@ApiModelProperty(required=false, value="Perform healthcheck on this dynamically allocated port (e.g. 0 for first port)")

This comment has been minimized.

@tpetr

tpetr Feb 9, 2016 Member

should probably indicate that it defaults to the first port

@@ -167,9 +169,9 @@ public void reEnqueueOrAbort(SingularityTask task) {

final String hostname = task.getOffer().getHostname();

Optional<Long> firstPort = task.getFirstPort();
Optional<Long> healthecheckPort = task.getPortByIndex(task.getTaskRequest().getDeploy().getHealthcheckPortIndex().or(0));

This comment has been minimized.

@tpetr

tpetr Feb 9, 2016 Member

typo

}
public Optional<Long> getPortByIndex(int index) {
List<Long> ports = MesosUtils.getAllPorts(mesosTask.getResourcesList());
if (index >= ports.size()) {

This comment has been minimized.

@tpetr

tpetr Feb 9, 2016 Member

should check for index < 0 too

@tpetr
Copy link
Member

tpetr commented Feb 9, 2016

Can you also add checks for these new fields to SingularityValidator.checkDeploy()?

@tpetr
Copy link
Member

tpetr commented Feb 9, 2016

Worth adding and/or updating tests to verify this works

@tpetr
Copy link
Member

tpetr commented Feb 9, 2016

(LGTM once all this is addressed)

@ssalinas
Copy link
Member Author

ssalinas commented Feb 9, 2016

Added validator pieces, just need to add tests

@ssalinas ssalinas force-pushed the port_indices branch from c6ee903 to fb56d10 Feb 9, 2016
@ssalinas ssalinas added hs_qa labels Feb 9, 2016
@tpetr
Copy link
Member

tpetr commented Feb 9, 2016

LGTM, thanks

tpetr added a commit that referenced this pull request Feb 10, 2016
allow deploy to specify port index for healthchecks and LB api
@tpetr tpetr merged commit 4468c7d into master Feb 10, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@tpetr tpetr removed hs_qa labels Feb 10, 2016
@ssalinas ssalinas added this to the 0.4.10 milestone Mar 2, 2016
@ssalinas ssalinas deleted the port_indices branch Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.