-
Notifications
You must be signed in to change notification settings - Fork 6
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
Mentos integration #54
Conversation
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.
So far so good, just some comments. I know its under construction.
mentor/messages.py
Outdated
return codecs.unicode_escape_decode(string)[0] | ||
|
||
# dict.iteritems(), dict.iterkeys() is also incompatible | ||
if six.PY3: |
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.
iteritems
and iterkeys
are importable from six
from six import iteritems, iterkeys
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.
Ya I know, I stole that block of code and was lazy
except KeyError: | ||
raise AttributeError(k) | ||
else: | ||
object.__delattr__(self, k) |
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.
Are these for dot notation?
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.
Yes
return Message({'name': 'disk', 'role': '*', 'scalar': Message({'value':value}), 'type': 'SCALAR'}) | ||
|
||
def Ports(begin,end): | ||
return Message({'name': 'disk', 'role': '*', 'ranges': Message({'range':[Message({'begin': begin, 'end': end})]}), 'type': 'SCALAR'}) |
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.
Needs formatting
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.
God yes, maybe setup autopep8 or something, I did not do anything on this package
b = self.flatten(other) | ||
out = {} | ||
for k, v in self.zeroes.items(): | ||
if k=="ports": |
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.
With supporting ports it could be cleaner to create scalar and range types and convert the resources when initializing the ResourceMixin.
mentor/messages.py
Outdated
return self.keys() | ||
|
||
def Cpus(value): | ||
return Message({'name': 'cpus', 'role': '*', 'scalar': Message({'value':value}), 'type': 'SCALAR'}) |
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.
Handling role will be an interesting question.
mentor/messages.py
Outdated
|
||
def __init__(self, docker='satyr', force_pull=False, | ||
envs={}, uris=[], **kwds): | ||
super(PythonExecutor, self).__init__(**kwds) |
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.
Maybe we should use something like a template with pure dict notation instead of Message constructors.
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.
So like the Cpus and Disk?
mentor/placement.py
Outdated
@@ -21,10 +21,8 @@ def weight(items, **kwargs): | |||
|
|||
def ff(items, targets): | |||
"""First-Fit | |||
|
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.
What is your problem with my whitespaces? :)
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.
It be my editor I think :D
mentor/queues.py
Outdated
self.client = client | ||
def __reduce__(self): | ||
hosts = ",".join(["{}:{}".format(h, p) for h, p in self.client.hosts]) | ||
return (SerializableMixin.init, (self.__class__, hosts, self.path)) |
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.
Cleaner indeed.
@@ -1,28 +0,0 @@ | |||
- repo: https://github.com/pre-commit/pre-commit-hooks.git |
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.
I like to use these hooks http://pre-commit.com/
Enforce me to keep the conventions. Do You have alternatives?
Nice to see the process :) |
What is the status of this? I'd like to implement a framework for distributed, but kinda blocked this PR. |
Well, it needs a fairly extended rewrite I think or rethink of how we do things. I did not have time to work on this recently as well. Need to properly understand how to do it. |
Let me know if I can help. |
What do you think are the main necessities we need in mentor? Because stuff like retry and etc are already handled in mentos, and the way it works with tornado callbacks we cannot intercept exceptions, but have to kinda propagate errors as events, meaning the function evaluation thing has to be fully redone. I am also very unsure about the function execution interface. You can take a look at the currently state. Its's a mess i think. |
Is the like retry configurable in mentos? Can You link the source of the retry logic?
Do You have proposals? |
The retry is not directly exposed to the schedulers as of now, but can be made a global config I guess. I am quite unsure to be honest. I keep getting caught up in making everything work with the existing codebase. |
Ohh, this retry logic is great. I didn't know that mentos has it. The problem is that we have multiple options to place the scheduling logic: scheduler, executor, even task. We also need to distinguish between homogeneous and heterogeneous tasks. We should specify a couple of frameworks (on pseudo code level) to plan the proper interface for mentor. We might need multiple interfaces. |
I've created a new issue #55 to plan the interface. |
I'm closing this PR now, created a new mentos branch with your modifications. |
Description
Migrating satyr to new CI, Naming and underlying driver to Mentos and Daskos
Motivation and Context
How Has This Been Tested?
Tests are still pending
Screenshots (if appropriate):
Types of changes
Checklist:
Review:
@kszucs