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

Coupling functions with containers #5 #39

Merged
merged 2 commits into from
Aug 14, 2019
Merged
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
3 changes: 2 additions & 1 deletion funcx/executors/high_throughput/funcx_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ def pull_tasks(self, kill_event):

for task in tasks:
# In the FuncX model we forward tasks received directly via a DEALER socket.
b_task_id = (task['task_id']).to_bytes(4, "little")
b_task_id = task['task_id'].encode()

# Set default type to raw
task_type = task.get('task_type', 'RAW')
if task_type not in self.task_queues:
Expand Down
14 changes: 10 additions & 4 deletions funcx/sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,22 @@ def get_container(self, container_uuid, container_type):
# Return the result
return r.data['container']

def register_function(self, function, entry_point=None, description=None):
def register_function(self, function, function_name=None, container_uuid=None, description=None):
"""Register a function code with the funcX service.

Parameters
----------
function : Python Function
The function to be registered for remote execution

function_name : str
The entry point (function name) of the function. Default: None

container_uuid : str
Container UUID from registration with funcX

description : str
Description of the file
entry_point : str
The entry point (function name) of the function. Default: None

Returns
-------
Expand All @@ -241,7 +246,8 @@ def register_function(self, function, entry_point=None, description=None):

data = {"function_name": function.__name__,
"function_code": packed_code,
"entry_point": entry_point if entry_point else function.__name__,
"container_uuid": container_uuid,
"entry_point": function_name if function_name else function.__name__,
"description": description}

logger.info("Registering function : {}".format(data))
Expand Down