funcx.sdk.client.FuncXClient

class funcx.sdk.client.FuncXClient(http_timeout=None, funcx_home='~/.funcx', force_login=False, fx_authorizer=None, search_authorizer=None, openid_authorizer=None, funcx_service_address='https://api2.funcx.org/v2', check_endpoint_version=False, asynchronous=False, loop=None, results_ws_uri='wss://api.funcx.org/ws/v2/', use_offprocess_checker=True, **kwargs)

Main class for interacting with the funcX service

Holds helper operations for performing common tasks with the funcX service.

__init__(http_timeout=None, funcx_home='~/.funcx', force_login=False, fx_authorizer=None, search_authorizer=None, openid_authorizer=None, funcx_service_address='https://api2.funcx.org/v2', check_endpoint_version=False, asynchronous=False, loop=None, results_ws_uri='wss://api.funcx.org/ws/v2/', use_offprocess_checker=True, **kwargs)

Initialize the client

Parameters:
  • http_timeout (int) – Timeout for any call to service in seconds. Default is no timeout
  • force_login (bool) – Whether to force a login to get new credentials.
:param fx_authorizer:class:GlobusAuthorizer <globus_sdk.authorizers.base.GlobusAuthorizer>: A custom authorizer instance to communicate with funcX.
Default: None, will be created.
:param search_authorizer:class:GlobusAuthorizer <globus_sdk.authorizers.base.GlobusAuthorizer>: A custom authorizer instance to communicate with Globus Search.
Default: None, will be created.
:param openid_authorizer:class:GlobusAuthorizer <globus_sdk.authorizers.base.GlobusAuthorizer>: A custom authorizer instance to communicate with OpenID.
Default: None, will be created.
Parameters:
  • funcx_service_address (str) – The address of the funcX web service to communicate with. Default: https://api.funcx.org/v2
  • asynchronous (bool) –
  • the API use asynchronous interactions with the web service? Currently (Should) –
  • impacts the run method (only) –
  • Default (None) –
  • loop (AbstractEventLoop) –
  • asynchronous mode is requested, then you can provide an optional event loop (If) –
  • If None, then we will access asyncio.get_event_loop() (instance.) –
  • Default
  • use_offprocess_checker (Bool,) – Use this option to disable the offprocess_checker in the FuncXSerializer used by the client. Default: True
  • arguments are the same as for BaseClient. (Keyword) –

Methods

__init__([http_timeout, funcx_home, …]) Initialize the client
add_to_whitelist(endpoint_id, function_ids) Adds the function to the endpoint’s whitelist
batch_run(batch) Initiate a batch of tasks to funcX
create_batch([task_group_id]) Create a Batch instance to handle batch submission in funcX
delete(path, **kwargs) Make a DELETE request to the specified path.
delete_from_whitelist(endpoint_id, function_ids) List the endpoint’s whitelist
get(path, **kwargs) Make a GET request to the specified path.
get_batch_result(task_id_list) Request status for a batch of task_ids
get_container(container_uuid, container_type) Get the details of a container for staging it locally.
get_containers(name[, description]) Register a DLHub endpoint with the funcX service and get the containers to launch.
get_endpoint_status(endpoint_uuid) Get the status reports for an endpoint.
get_result(task_id) Get the result of a funcX task
get_task(task_id) Get a funcX task.
get_whitelist(endpoint_id) List the endpoint’s whitelist
logout() Remove credentials from your local system
map_run(*args[, endpoint_id, function_id, …]) Initiate an invocation
patch(path[, json_body, params, headers, …]) Make a PATCH request to the specified path.
post(path, **kwargs) Make a POST request to the specified path.
put(path[, json_body, params, headers, …]) Make a PUT request to the specified path.
qjoin_path(*parts)
register_container(location, container_type) Register a container with the funcX service.
register_endpoint(name, endpoint_uuid[, …]) Register an endpoint with the funcX service.
register_function(function[, function_name, …]) Register a function code with the funcX service.
run(*args[, endpoint_id, function_id]) Initiate an invocation
search_endpoint(q[, scope, owner_id])
param q:
search_function(q[, offset, limit, advanced]) Search for function via the funcX service
set_app_name(app_name) Set an application name to send to Globus services as part of the User Agent.
throttle_max_requests()
throttle_request_size(*request_args, …)
update_function(func_uuid, function)
update_table(return_msg, task_id) Parses the return message from the service and updates the internal func_table
version_check() Check this client version meets the service’s minimum supported version.

Attributes

BASE_USER_AGENT
DEFAULT_MAX_REQUESTS
DEFAULT_MAX_REQUEST_SIZE
FUNCX_SCOPE
FUNCX_SDK_CLIENT_ID
TOKEN_DIR
TOKEN_FILENAME
allowed_authorizer_types