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

MYRIAD-184 RM Ports are Hardcoded in NMExecutorCLGenImpl.java #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ public class MyriadConfiguration {
@JsonProperty
private String mesosAuthenticationSecretFilename;

@JsonProperty
private String yarnResourceManagerPortHTTPS;

@JsonProperty
private String yarnResourceManagerPortHTTP;

public MyriadConfiguration() {
}
Expand Down Expand Up @@ -252,4 +257,11 @@ public String getMesosAuthenticationPrincipal() {
return mesosAuthenticationPrincipal;
}

public String getYarnResourceManagerPortHTTPS() {
return yarnResourceManagerPortHTTPS;
}

public String getYarnResourceManagerPortHTTP() {
return yarnResourceManagerPortHTTP;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ public String getConfigurationUrl() {
if (httpPolicy != null && httpPolicy.equals(TaskFactory.YARN_HTTP_POLICY_HTTPS_ONLY)) {
String address = conf.get(TaskFactory.YARN_RESOURCEMANAGER_WEBAPP_HTTPS_ADDRESS);
if (address == null || address.isEmpty()) {
address = conf.get(TaskFactory.YARN_RESOURCEMANAGER_HOSTNAME) + ":8090";
address = conf.get(TaskFactory.YARN_RESOURCEMANAGER_HOSTNAME) + cfg.getYarnResourceManagerPortHTTPS();
}
return "https://" + address + "/conf";
Copy link
Contributor

Choose a reason for hiding this comment

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

Basically Lines 166-168 were a last ditch effort to get the HTTPS port if it didn't exist in the YarnConfiguration object, after learning more it turns out this code is only hit if yarn.resourcemanager.webapp.https.address does not exist, however it defaults to yarn.resource.manager.hostnam:8090. So we can safely delete that code, making the additional configuration cruft unnecessary.

} else {
String address = conf.get(TaskFactory.YARN_RESOURCEMANAGER_WEBAPP_ADDRESS);
if (address == null || address.isEmpty()) {
address = conf.get(TaskFactory.YARN_RESOURCEMANAGER_HOSTNAME) + ":8088";
address = conf.get(TaskFactory.YARN_RESOURCEMANAGER_HOSTNAME) + cfg.getYarnResourceManagerPortHTTP();
}
return "http://" + address + "/conf";
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

}
Expand Down
2 changes: 2 additions & 0 deletions myriad-scheduler/src/main/resources/myriad-config-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ yarnEnvironment:
#JAVA_HOME: /usr/lib/jvm/java-default #System dependent, but sometimes necessary
mesosAuthenticationPrincipal:
mesosAuthenticationSecretFilename:
yarnResourceManagerPortHTTPS: :8090
yarnResourceManagerPortHTTP: :8088