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

Add a "defaultPortMapping" option which exposes all Mesos provided ports #1036

Merged
merged 5 commits into from
May 17, 2016

Conversation

stevenschlansker
Copy link
Contributor

Our apps generally ask for 1 or 2 ports. It's a pain to repeatedly write

      "portMappings": [
        {"hostPort": 0, "hostPortType": "FROM_OFFER", "containerPort": 0, "containerPortType": "FROM_OFFER"},
        {"hostPort": 1, "hostPortType": "FROM_OFFER", "containerPort": 1, "containerPortType": "FROM_OFFER"}
      ]

so why not just let Singularity fill it in for you?

@@ -239,6 +239,14 @@ private void prepareContainerInfo(final Offer offer, final SingularityTaskId tas
dockerInfoBuilder.addPortMappings(maybePortMapping.get());
}
}
} else if (configuration.getNetworkConfiguration().isDefaultPortMapping() && dockerInfo.get().getPortMappings().isEmpty() && ports.isPresent()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also need to check that network mode is BRIDGE here, if it's HOST or NONE and you specify mappings believe that will end up at least in a TASK_FAILED if not a TASK_ERROR. Other than that looks good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ssalinas ssalinas modified the milestone: 0.6.0 May 13, 2016
@ssalinas
Copy link
Member

Tested this in our staging infra and looks good 👍

@stevenschlansker
Copy link
Contributor Author

Test failure looks transient, timed out on the openjdk7 build.

@tpetr
Copy link
Contributor

tpetr commented May 17, 2016

LGTM

@ssalinas ssalinas merged commit 0408b28 into HubSpot:master May 17, 2016
@stevenschlansker stevenschlansker deleted the default-network-mapping branch February 10, 2017 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants