-
Notifications
You must be signed in to change notification settings - Fork 52
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
Dcos support #31
Conversation
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.
There was a problem hiding this 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}") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Very early, prototype level support for HSDS on DCOS.