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

Dcos support #31

Merged
merged 6 commits into from
Mar 27, 2020
Merged

Dcos support #31

merged 6 commits into from
Mar 27, 2020

Conversation

s004pmg
Copy link
Contributor

@s004pmg s004pmg commented Mar 18, 2020

Very early, prototype level support for HSDS on DCOS.

Known limitations so far:
* I've only tested scaling up data nodes, not service nodes
* Sometimes the data nodes grab an internal docker IP instead of the cluster visible IP
* The nodes aren't very good at self organizing at startup yet:
** start in this order head node, data nodes, server node

This was tested on DCOS 1.13.5.
Copy link
Member

@jreadey jreadey left a comment

Choose a reason for hiding this comment

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

Please take a look at my comments.

@@ -400,7 +402,7 @@ def getDataNodeUrl(app, obj_id):
node_count = app["node_count"]
node_state = app["node_state"]
if node_state!= "READY" or node_count <= 0 or node_count != len(dn_urls):
log.info(f"getDataNodeUrl returning 503 - node_state: {node_state} node count: {node_count}")
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason not use f-strings here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, fixed

@@ -450,7 +580,7 @@ def getHeadUrl(app):

if this_node is None and rsp_json["cluster_state"] != "READY":
log.warn("this node not found, re-initialize")
app["node_state"] == "INITIALIZING"
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing this stupid bug (I'm surprised pyflakes doesn't catch this)

return
except CancelledError as cancelled_exception:
log.error(f"got CanceeledError registering with oio_proxy: {cancelled_exception}")
Copy link
Member

Choose a reason for hiding this comment

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

Please change "Canceeled" to "Cancelled"! (bad spelling in the original code I know)

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

hsds/basenode.py Outdated
@@ -61,7 +68,14 @@ def getHeadUrl(app):
req_reg = head_url + "/register"
log.info("register: {}".format(req_reg))

body = {"id": app["id"], "port": app["node_port"], "node_type": app["node_type"]}
log.warn("env:{}".format(os.environ))
Copy link
Member

Choose a reason for hiding this comment

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

Why are we dumping os.environ as a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should have been taken out before check-in, this was temporarily useful for seeing what useful things DCOS was given in the environment.

hsds/basenode.py Outdated
log.warn("env:{}".format(os.environ))

if "is_dcos" in app:
outside_port = os.environ.get('PORT0')
Copy link
Member

Choose a reason for hiding this comment

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

Rather than using os.environ here (note this would throw a KeyNotFound exception is PORT0 is not set) you can use config.get("PORT0"). Alternatively, you may want to put a dict of docs related stuff when you set "is_dcos". e.g. app["dcos_config"] = {'PORT0': 999}, and then refer to that here.

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

hsds/basenode.py Outdated
@@ -654,6 +784,12 @@ def baseInit(loop, node_type):
log.info("running in kubernetes")
app["is_k8s"] = True

# check to see if we are running in a DCOS cluster
is_dcos = os.environ.get('MARATHON_APP_ID')
Copy link
Member

Choose a reason for hiding this comment

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

Won't this throw an exception for non-dcos?

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

@jreadey jreadey merged commit dd454fd into HDFGroup:master Mar 27, 2020
@jreadey jreadey mentioned this pull request Mar 31, 2020
16 tasks
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.

None yet

2 participants