Check for number of workers before soft failing the task. #104195

Merged
Sybren A. Stüvel merged 15 commits from Nitin-Rawat-1/flamenco:104190-job-stuck into main 2023-04-20 11:53:43 +02:00
76 changed files with 5523 additions and 248 deletions
Showing only changes of commit 5c101c47fb - Show all commits

View File

@ -8,6 +8,7 @@ bugs in actually-released versions.
- Improve speed of queueing up >100 simultaneous job deletions. - Improve speed of queueing up >100 simultaneous job deletions.
- Improve logging of job deletion. - Improve logging of job deletion.
- Add Worker Cluster support. Workers can be members of any number of clusters. When assigned to a cluster, they will only work on jobs that are also assigned to that cluster. Jobs that do not have a cluster will be available to all workers, regardless of their cluster assignment. Another way to phrase this: a Worker will never pick up a job that is assigned to a cluster it is not part of.
## 3.2 - released 2023-02-21 ## 3.2 - released 2023-02-21

View File

@ -17,7 +17,7 @@ _GIT_DESCRIPTION_OR_TAG := $(subst v${VERSION}-,,$(shell git describe --tag --di
# ${GITHASH}. # ${GITHASH}.
GITHASH := $(subst v${VERSION},$(shell git rev-parse --short HEAD),${_GIT_DESCRIPTION_OR_TAG}) GITHASH := $(subst v${VERSION},$(shell git rev-parse --short HEAD),${_GIT_DESCRIPTION_OR_TAG})
LDFLAGS := -X ${PKG}/internal/appinfo.ApplicationVersion=${VERSION} \ LDFLAGS := ${LDFLAGS} -X ${PKG}/internal/appinfo.ApplicationVersion=${VERSION} \
-X ${PKG}/internal/appinfo.ApplicationGitHash=${GITHASH} \ -X ${PKG}/internal/appinfo.ApplicationGitHash=${GITHASH} \
-X ${PKG}/internal/appinfo.ReleaseCycle=${RELEASE_CYCLE} -X ${PKG}/internal/appinfo.ReleaseCycle=${RELEASE_CYCLE}
BUILD_FLAGS = -ldflags="${LDFLAGS}" BUILD_FLAGS = -ldflags="${LDFLAGS}"

View File

@ -19,7 +19,7 @@ from pathlib import Path
__is_first_load = "operators" not in locals() __is_first_load = "operators" not in locals()
if __is_first_load: if __is_first_load:
from . import operators, gui, job_types, comms, preferences from . import operators, gui, job_types, comms, preferences, worker_clusters
else: else:
import importlib import importlib
@ -28,6 +28,7 @@ else:
job_types = importlib.reload(job_types) job_types = importlib.reload(job_types)
comms = importlib.reload(comms) comms = importlib.reload(comms)
preferences = importlib.reload(preferences) preferences = importlib.reload(preferences)
worker_clusters = importlib.reload(worker_clusters)
import bpy import bpy
@ -145,6 +146,7 @@ def register() -> None:
) )
preferences.register() preferences.register()
worker_clusters.register()
operators.register() operators.register()
gui.register() gui.register()
job_types.register() job_types.register()
@ -162,4 +164,5 @@ def unregister() -> None:
job_types.unregister() job_types.unregister()
gui.unregister() gui.unregister()
operators.unregister() operators.unregister()
worker_clusters.unregister()
preferences.unregister() preferences.unregister()

View File

@ -43,6 +43,11 @@ class FLAMENCO_PT_job_submission(bpy.types.Panel):
col.prop(context.scene, "flamenco_job_name", text="Job Name") col.prop(context.scene, "flamenco_job_name", text="Job Name")
col.prop(context.scene, "flamenco_job_priority", text="Priority") col.prop(context.scene, "flamenco_job_priority", text="Priority")
# Worker cluster:
row = col.row(align=True)
row.prop(context.scene, "flamenco_worker_cluster", text="Cluster")
row.operator("flamenco.fetch_worker_clusters", text="", icon="FILE_REFRESH")
layout.separator() layout.separator()
col = layout.column() col = layout.column()

View File

@ -53,6 +53,11 @@ def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
submitter_platform=platform.system().lower(), submitter_platform=platform.system().lower(),
type_etag=propgroup.job_type.etag, type_etag=propgroup.job_type.etag,
) )
worker_cluster: str = getattr(scene, "flamenco_worker_cluster", "")
if worker_cluster and worker_cluster != "-":
job.worker_cluster = worker_cluster
return job return job

View File

@ -23,6 +23,9 @@ from flamenco.manager.model_utils import ( # noqa: F401
) )
from flamenco.manager.model.error import Error from flamenco.manager.model.error import Error
from flamenco.manager.model.worker import Worker from flamenco.manager.model.worker import Worker
from flamenco.manager.model.worker_cluster import WorkerCluster
from flamenco.manager.model.worker_cluster_change_request import WorkerClusterChangeRequest
from flamenco.manager.model.worker_cluster_list import WorkerClusterList
from flamenco.manager.model.worker_list import WorkerList from flamenco.manager.model.worker_list import WorkerList
from flamenco.manager.model.worker_sleep_schedule import WorkerSleepSchedule from flamenco.manager.model.worker_sleep_schedule import WorkerSleepSchedule
from flamenco.manager.model.worker_status_change_request import WorkerStatusChangeRequest from flamenco.manager.model.worker_status_change_request import WorkerStatusChangeRequest
@ -39,6 +42,56 @@ class WorkerMgtApi(object):
if api_client is None: if api_client is None:
api_client = ApiClient() api_client = ApiClient()
self.api_client = api_client self.api_client = api_client
self.create_worker_cluster_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [],
'endpoint_path': '/api/v3/worker-mgt/clusters',
'operation_id': 'create_worker_cluster',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'worker_cluster',
],
'required': [
'worker_cluster',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'worker_cluster':
(WorkerCluster,),
},
'attribute_map': {
},
'location_map': {
'worker_cluster': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
self.delete_worker_endpoint = _Endpoint( self.delete_worker_endpoint = _Endpoint(
settings={ settings={
'response_type': None, 'response_type': None,
@ -88,6 +141,55 @@ class WorkerMgtApi(object):
}, },
api_client=api_client api_client=api_client
) )
self.delete_worker_cluster_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [],
'endpoint_path': '/api/v3/worker-mgt/cluster/{cluster_id}',
'operation_id': 'delete_worker_cluster',
'http_method': 'DELETE',
'servers': None,
},
params_map={
'all': [
'cluster_id',
],
'required': [
'cluster_id',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'cluster_id':
(str,),
},
'attribute_map': {
'cluster_id': 'cluster_id',
},
'location_map': {
'cluster_id': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.fetch_worker_endpoint = _Endpoint( self.fetch_worker_endpoint = _Endpoint(
settings={ settings={
'response_type': (Worker,), 'response_type': (Worker,),
@ -137,6 +239,97 @@ class WorkerMgtApi(object):
}, },
api_client=api_client api_client=api_client
) )
self.fetch_worker_cluster_endpoint = _Endpoint(
settings={
'response_type': (WorkerCluster,),
'auth': [],
'endpoint_path': '/api/v3/worker-mgt/cluster/{cluster_id}',
'operation_id': 'fetch_worker_cluster',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'cluster_id',
],
'required': [
'cluster_id',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'cluster_id':
(str,),
},
'attribute_map': {
'cluster_id': 'cluster_id',
},
'location_map': {
'cluster_id': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.fetch_worker_clusters_endpoint = _Endpoint(
settings={
'response_type': (WorkerClusterList,),
'auth': [],
'endpoint_path': '/api/v3/worker-mgt/clusters',
'operation_id': 'fetch_worker_clusters',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
},
'attribute_map': {
},
'location_map': {
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.fetch_worker_sleep_schedule_endpoint = _Endpoint( self.fetch_worker_sleep_schedule_endpoint = _Endpoint(
settings={ settings={
'response_type': (WorkerSleepSchedule,), 'response_type': (WorkerSleepSchedule,),
@ -284,6 +477,62 @@ class WorkerMgtApi(object):
}, },
api_client=api_client api_client=api_client
) )
self.set_worker_clusters_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [],
'endpoint_path': '/api/v3/worker-mgt/workers/{worker_id}/setclusters',
'operation_id': 'set_worker_clusters',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'worker_id',
'worker_cluster_change_request',
],
'required': [
'worker_id',
'worker_cluster_change_request',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'worker_id':
(str,),
'worker_cluster_change_request':
(WorkerClusterChangeRequest,),
},
'attribute_map': {
'worker_id': 'worker_id',
},
'location_map': {
'worker_id': 'path',
'worker_cluster_change_request': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
self.set_worker_sleep_schedule_endpoint = _Endpoint( self.set_worker_sleep_schedule_endpoint = _Endpoint(
settings={ settings={
'response_type': None, 'response_type': None,
@ -340,6 +589,139 @@ class WorkerMgtApi(object):
}, },
api_client=api_client api_client=api_client
) )
self.update_worker_cluster_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [],
'endpoint_path': '/api/v3/worker-mgt/cluster/{cluster_id}',
'operation_id': 'update_worker_cluster',
'http_method': 'PUT',
'servers': None,
},
params_map={
'all': [
'cluster_id',
'worker_cluster',
],
'required': [
'cluster_id',
'worker_cluster',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'cluster_id':
(str,),
'worker_cluster':
(WorkerCluster,),
},
'attribute_map': {
'cluster_id': 'cluster_id',
},
'location_map': {
'cluster_id': 'path',
'worker_cluster': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
def create_worker_cluster(
self,
worker_cluster,
**kwargs
):
"""Create a new worker cluster. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_worker_cluster(worker_cluster, async_req=True)
>>> result = thread.get()
Args:
worker_cluster (WorkerCluster): The worker cluster.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['worker_cluster'] = \
worker_cluster
return self.create_worker_cluster_endpoint.call_with_http_info(**kwargs)
def delete_worker( def delete_worker(
self, self,
@ -418,6 +800,83 @@ class WorkerMgtApi(object):
worker_id worker_id
return self.delete_worker_endpoint.call_with_http_info(**kwargs) return self.delete_worker_endpoint.call_with_http_info(**kwargs)
def delete_worker_cluster(
self,
cluster_id,
**kwargs
):
"""Remove this worker cluster. This unassigns all workers from the cluster and removes it. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_worker_cluster(cluster_id, async_req=True)
>>> result = thread.get()
Args:
cluster_id (str):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['cluster_id'] = \
cluster_id
return self.delete_worker_cluster_endpoint.call_with_http_info(**kwargs)
def fetch_worker( def fetch_worker(
self, self,
worker_id, worker_id,
@ -495,6 +954,155 @@ class WorkerMgtApi(object):
worker_id worker_id
return self.fetch_worker_endpoint.call_with_http_info(**kwargs) return self.fetch_worker_endpoint.call_with_http_info(**kwargs)
def fetch_worker_cluster(
self,
cluster_id,
**kwargs
):
"""Get a single worker cluster. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fetch_worker_cluster(cluster_id, async_req=True)
>>> result = thread.get()
Args:
cluster_id (str):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
WorkerCluster
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['cluster_id'] = \
cluster_id
return self.fetch_worker_cluster_endpoint.call_with_http_info(**kwargs)
def fetch_worker_clusters(
self,
**kwargs
):
"""Get list of worker clusters. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fetch_worker_clusters(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
WorkerClusterList
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
return self.fetch_worker_clusters_endpoint.call_with_http_info(**kwargs)
def fetch_worker_sleep_schedule( def fetch_worker_sleep_schedule(
self, self,
worker_id, worker_id,
@ -725,6 +1333,87 @@ class WorkerMgtApi(object):
worker_status_change_request worker_status_change_request
return self.request_worker_status_change_endpoint.call_with_http_info(**kwargs) return self.request_worker_status_change_endpoint.call_with_http_info(**kwargs)
def set_worker_clusters(
self,
worker_id,
worker_cluster_change_request,
**kwargs
):
"""set_worker_clusters # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.set_worker_clusters(worker_id, worker_cluster_change_request, async_req=True)
>>> result = thread.get()
Args:
worker_id (str):
worker_cluster_change_request (WorkerClusterChangeRequest): The list of cluster IDs this worker should be a member of.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['worker_id'] = \
worker_id
kwargs['worker_cluster_change_request'] = \
worker_cluster_change_request
return self.set_worker_clusters_endpoint.call_with_http_info(**kwargs)
def set_worker_sleep_schedule( def set_worker_sleep_schedule(
self, self,
worker_id, worker_id,
@ -806,3 +1495,84 @@ class WorkerMgtApi(object):
worker_sleep_schedule worker_sleep_schedule
return self.set_worker_sleep_schedule_endpoint.call_with_http_info(**kwargs) return self.set_worker_sleep_schedule_endpoint.call_with_http_info(**kwargs)
def update_worker_cluster(
self,
cluster_id,
worker_cluster,
**kwargs
):
"""Update an existing worker cluster. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_worker_cluster(cluster_id, worker_cluster, async_req=True)
>>> result = thread.get()
Args:
cluster_id (str):
worker_cluster (WorkerCluster): The updated worker cluster.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['cluster_id'] = \
cluster_id
kwargs['worker_cluster'] = \
worker_cluster
return self.update_worker_cluster_endpoint.call_with_http_info(**kwargs)

View File

@ -17,6 +17,7 @@ Name | Type | Description | Notes
**settings** | [**JobSettings**](JobSettings.md) | | [optional] **settings** | [**JobSettings**](JobSettings.md) | | [optional]
**metadata** | [**JobMetadata**](JobMetadata.md) | | [optional] **metadata** | [**JobMetadata**](JobMetadata.md) | | [optional]
**storage** | [**JobStorageInfo**](JobStorageInfo.md) | | [optional] **storage** | [**JobStorageInfo**](JobStorageInfo.md) | | [optional]
**worker_cluster** | **str** | Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job. | [optional]
**delete_requested_at** | **datetime** | If job deletion was requested, this is the timestamp at which that request was stored on Flamenco Manager. | [optional] **delete_requested_at** | **datetime** | If job deletion was requested, this is the timestamp at which that request was stored on Flamenco Manager. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

View File

@ -1225,6 +1225,7 @@ with flamenco.manager.ApiClient() as api_client:
storage=JobStorageInfo( storage=JobStorageInfo(
shaman_checkout_id="shaman_checkout_id_example", shaman_checkout_id="shaman_checkout_id_example",
), ),
worker_cluster="worker_cluster_example",
) # SubmittedJob | Job to submit ) # SubmittedJob | Job to submit
# example passing only required values which don't have defaults set # example passing only required values which don't have defaults set
@ -1306,6 +1307,7 @@ with flamenco.manager.ApiClient() as api_client:
storage=JobStorageInfo( storage=JobStorageInfo(
shaman_checkout_id="shaman_checkout_id_example", shaman_checkout_id="shaman_checkout_id_example",
), ),
worker_cluster="worker_cluster_example",
) # SubmittedJob | Job to check ) # SubmittedJob | Job to check
# example passing only required values which don't have defaults set # example passing only required values which don't have defaults set

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**settings** | [**JobSettings**](JobSettings.md) | | [optional] **settings** | [**JobSettings**](JobSettings.md) | | [optional]
**metadata** | [**JobMetadata**](JobMetadata.md) | | [optional] **metadata** | [**JobMetadata**](JobMetadata.md) | | [optional]
**storage** | [**JobStorageInfo**](JobStorageInfo.md) | | [optional] **storage** | [**JobStorageInfo**](JobStorageInfo.md) | | [optional]
**worker_cluster** | **str** | Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -15,6 +15,7 @@ Name | Type | Description | Notes
**status_change** | [**WorkerStatusChangeRequest**](WorkerStatusChangeRequest.md) | | [optional] **status_change** | [**WorkerStatusChangeRequest**](WorkerStatusChangeRequest.md) | | [optional]
**last_seen** | **datetime** | Last time this worker was seen by the Manager. | [optional] **last_seen** | **datetime** | Last time this worker was seen by the Manager. | [optional]
**task** | [**WorkerTask**](WorkerTask.md) | | [optional] **task** | [**WorkerTask**](WorkerTask.md) | | [optional]
**clusters** | [**[WorkerCluster]**](WorkerCluster.md) | Clusters of which this Worker is a member. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -8,6 +8,7 @@ Name | Type | Description | Notes
**platform** | **str** | Operating system of the Worker | **platform** | **str** | Operating system of the Worker |
**supported_task_types** | **[str]** | | **supported_task_types** | **[str]** | |
**task** | [**WorkerTask**](WorkerTask.md) | | [optional] **task** | [**WorkerTask**](WorkerTask.md) | | [optional]
**clusters** | [**[WorkerCluster]**](WorkerCluster.md) | Clusters of which this Worker is a member. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,15 @@
# WorkerCluster
Cluster of workers. A job can optionally specify which cluster it should be limited to. Workers can be part of multiple clusters simultaneously.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
**id** | **str** | UUID of the cluster. Can be ommitted when creating a new cluster, in which case a random UUID will be assigned. | [optional]
**description** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# WorkerClusterChangeRequest
Request to change which clusters this Worker is assigned to.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cluster_ids** | **[str]** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,12 @@
# WorkerClusterList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**clusters** | [**[WorkerCluster]**](WorkerCluster.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -4,14 +4,90 @@ All URIs are relative to *http://localhost*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**create_worker_cluster**](WorkerMgtApi.md#create_worker_cluster) | **POST** /api/v3/worker-mgt/clusters | Create a new worker cluster.
[**delete_worker**](WorkerMgtApi.md#delete_worker) | **DELETE** /api/v3/worker-mgt/workers/{worker_id} | Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued. [**delete_worker**](WorkerMgtApi.md#delete_worker) | **DELETE** /api/v3/worker-mgt/workers/{worker_id} | Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued.
[**delete_worker_cluster**](WorkerMgtApi.md#delete_worker_cluster) | **DELETE** /api/v3/worker-mgt/cluster/{cluster_id} | Remove this worker cluster. This unassigns all workers from the cluster and removes it.
[**fetch_worker**](WorkerMgtApi.md#fetch_worker) | **GET** /api/v3/worker-mgt/workers/{worker_id} | Fetch info about the worker. [**fetch_worker**](WorkerMgtApi.md#fetch_worker) | **GET** /api/v3/worker-mgt/workers/{worker_id} | Fetch info about the worker.
[**fetch_worker_cluster**](WorkerMgtApi.md#fetch_worker_cluster) | **GET** /api/v3/worker-mgt/cluster/{cluster_id} | Get a single worker cluster.
[**fetch_worker_clusters**](WorkerMgtApi.md#fetch_worker_clusters) | **GET** /api/v3/worker-mgt/clusters | Get list of worker clusters.
[**fetch_worker_sleep_schedule**](WorkerMgtApi.md#fetch_worker_sleep_schedule) | **GET** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule | [**fetch_worker_sleep_schedule**](WorkerMgtApi.md#fetch_worker_sleep_schedule) | **GET** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule |
[**fetch_workers**](WorkerMgtApi.md#fetch_workers) | **GET** /api/v3/worker-mgt/workers | Get list of workers. [**fetch_workers**](WorkerMgtApi.md#fetch_workers) | **GET** /api/v3/worker-mgt/workers | Get list of workers.
[**request_worker_status_change**](WorkerMgtApi.md#request_worker_status_change) | **POST** /api/v3/worker-mgt/workers/{worker_id}/setstatus | [**request_worker_status_change**](WorkerMgtApi.md#request_worker_status_change) | **POST** /api/v3/worker-mgt/workers/{worker_id}/setstatus |
[**set_worker_clusters**](WorkerMgtApi.md#set_worker_clusters) | **POST** /api/v3/worker-mgt/workers/{worker_id}/setclusters |
[**set_worker_sleep_schedule**](WorkerMgtApi.md#set_worker_sleep_schedule) | **POST** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule | [**set_worker_sleep_schedule**](WorkerMgtApi.md#set_worker_sleep_schedule) | **POST** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule |
[**update_worker_cluster**](WorkerMgtApi.md#update_worker_cluster) | **PUT** /api/v3/worker-mgt/cluster/{cluster_id} | Update an existing worker cluster.
# **create_worker_cluster**
> create_worker_cluster(worker_cluster)
Create a new worker cluster.
### Example
```python
import time
import flamenco.manager
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.error import Error
from flamenco.manager.model.worker_cluster import WorkerCluster
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with flamenco.manager.ApiClient() as api_client:
# Create an instance of the API class
api_instance = worker_mgt_api.WorkerMgtApi(api_client)
worker_cluster = WorkerCluster(
id="id_example",
name="name_example",
description="description_example",
) # WorkerCluster | The worker cluster.
# example passing only required values which don't have defaults set
try:
# Create a new worker cluster.
api_instance.create_worker_cluster(worker_cluster)
except flamenco.manager.ApiException as e:
print("Exception when calling WorkerMgtApi->create_worker_cluster: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**worker_cluster** | [**WorkerCluster**](WorkerCluster.md)| The worker cluster. |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | The cluster was created. | - |
**0** | Error message | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete_worker** # **delete_worker**
> delete_worker(worker_id) > delete_worker(worker_id)
@ -77,6 +153,71 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete_worker_cluster**
> delete_worker_cluster(cluster_id)
Remove this worker cluster. This unassigns all workers from the cluster and removes it.
### Example
```python
import time
import flamenco.manager
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.error import Error
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with flamenco.manager.ApiClient() as api_client:
# Create an instance of the API class
api_instance = worker_mgt_api.WorkerMgtApi(api_client)
cluster_id = "cluster_id_example" # str |
# example passing only required values which don't have defaults set
try:
# Remove this worker cluster. This unassigns all workers from the cluster and removes it.
api_instance.delete_worker_cluster(cluster_id)
except flamenco.manager.ApiException as e:
print("Exception when calling WorkerMgtApi->delete_worker_cluster: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cluster_id** | **str**| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | The cluster has been removed. | - |
**0** | Unexpected error. | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fetch_worker** # **fetch_worker**
> Worker fetch_worker(worker_id) > Worker fetch_worker(worker_id)
@ -142,6 +283,132 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fetch_worker_cluster**
> WorkerCluster fetch_worker_cluster(cluster_id)
Get a single worker cluster.
### Example
```python
import time
import flamenco.manager
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.worker_cluster import WorkerCluster
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with flamenco.manager.ApiClient() as api_client:
# Create an instance of the API class
api_instance = worker_mgt_api.WorkerMgtApi(api_client)
cluster_id = "cluster_id_example" # str |
# example passing only required values which don't have defaults set
try:
# Get a single worker cluster.
api_response = api_instance.fetch_worker_cluster(cluster_id)
pprint(api_response)
except flamenco.manager.ApiException as e:
print("Exception when calling WorkerMgtApi->fetch_worker_cluster: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cluster_id** | **str**| |
### Return type
[**WorkerCluster**](WorkerCluster.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The worker cluster. | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fetch_worker_clusters**
> WorkerClusterList fetch_worker_clusters()
Get list of worker clusters.
### Example
```python
import time
import flamenco.manager
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.worker_cluster_list import WorkerClusterList
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with flamenco.manager.ApiClient() as api_client:
# Create an instance of the API class
api_instance = worker_mgt_api.WorkerMgtApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# Get list of worker clusters.
api_response = api_instance.fetch_worker_clusters()
pprint(api_response)
except flamenco.manager.ApiException as e:
print("Exception when calling WorkerMgtApi->fetch_worker_clusters: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**WorkerClusterList**](WorkerClusterList.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Worker clusters. | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fetch_worker_sleep_schedule** # **fetch_worker_sleep_schedule**
> WorkerSleepSchedule fetch_worker_sleep_schedule(worker_id) > WorkerSleepSchedule fetch_worker_sleep_schedule(worker_id)
@ -331,6 +598,77 @@ No authorization required
- **Accept**: application/json - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Status change was accepted. | - |
**0** | Unexpected error. | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **set_worker_clusters**
> set_worker_clusters(worker_id, worker_cluster_change_request)
### Example
```python
import time
import flamenco.manager
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.error import Error
from flamenco.manager.model.worker_cluster_change_request import WorkerClusterChangeRequest
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with flamenco.manager.ApiClient() as api_client:
# Create an instance of the API class
api_instance = worker_mgt_api.WorkerMgtApi(api_client)
worker_id = "worker_id_example" # str |
worker_cluster_change_request = WorkerClusterChangeRequest(
cluster_ids=[
"cluster_ids_example",
],
) # WorkerClusterChangeRequest | The list of cluster IDs this worker should be a member of.
# example passing only required values which don't have defaults set
try:
api_instance.set_worker_clusters(worker_id, worker_cluster_change_request)
except flamenco.manager.ApiException as e:
print("Exception when calling WorkerMgtApi->set_worker_clusters: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**worker_id** | **str**| |
**worker_cluster_change_request** | [**WorkerClusterChangeRequest**](WorkerClusterChangeRequest.md)| The list of cluster IDs this worker should be a member of. |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details ### HTTP response details
| Status code | Description | Response headers | | Status code | Description | Response headers |
@ -412,3 +750,75 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_worker_cluster**
> update_worker_cluster(cluster_id, worker_cluster)
Update an existing worker cluster.
### Example
```python
import time
import flamenco.manager
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.error import Error
from flamenco.manager.model.worker_cluster import WorkerCluster
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with flamenco.manager.ApiClient() as api_client:
# Create an instance of the API class
api_instance = worker_mgt_api.WorkerMgtApi(api_client)
cluster_id = "cluster_id_example" # str |
worker_cluster = WorkerCluster(
id="id_example",
name="name_example",
description="description_example",
) # WorkerCluster | The updated worker cluster.
# example passing only required values which don't have defaults set
try:
# Update an existing worker cluster.
api_instance.update_worker_cluster(cluster_id, worker_cluster)
except flamenco.manager.ApiException as e:
print("Exception when calling WorkerMgtApi->update_worker_cluster: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cluster_id** | **str**| |
**worker_cluster** | [**WorkerCluster**](WorkerCluster.md)| The updated worker cluster. |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | The cluster update has been stored. | - |
**0** | Error message | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -110,6 +110,7 @@ class Job(ModelComposed):
'settings': (JobSettings,), # noqa: E501 'settings': (JobSettings,), # noqa: E501
'metadata': (JobMetadata,), # noqa: E501 'metadata': (JobMetadata,), # noqa: E501
'storage': (JobStorageInfo,), # noqa: E501 'storage': (JobStorageInfo,), # noqa: E501
'worker_cluster': (str,), # noqa: E501
'delete_requested_at': (datetime,), # noqa: E501 'delete_requested_at': (datetime,), # noqa: E501
} }
@ -132,6 +133,7 @@ class Job(ModelComposed):
'settings': 'settings', # noqa: E501 'settings': 'settings', # noqa: E501
'metadata': 'metadata', # noqa: E501 'metadata': 'metadata', # noqa: E501
'storage': 'storage', # noqa: E501 'storage': 'storage', # noqa: E501
'worker_cluster': 'worker_cluster', # noqa: E501
'delete_requested_at': 'delete_requested_at', # noqa: E501 'delete_requested_at': 'delete_requested_at', # noqa: E501
} }
@ -187,6 +189,7 @@ class Job(ModelComposed):
settings (JobSettings): [optional] # noqa: E501 settings (JobSettings): [optional] # noqa: E501
metadata (JobMetadata): [optional] # noqa: E501 metadata (JobMetadata): [optional] # noqa: E501
storage (JobStorageInfo): [optional] # noqa: E501 storage (JobStorageInfo): [optional] # noqa: E501
worker_cluster (str): Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job. . [optional] # noqa: E501
delete_requested_at (datetime): If job deletion was requested, this is the timestamp at which that request was stored on Flamenco Manager. . [optional] # noqa: E501 delete_requested_at (datetime): If job deletion was requested, this is the timestamp at which that request was stored on Flamenco Manager. . [optional] # noqa: E501
""" """
@ -301,6 +304,7 @@ class Job(ModelComposed):
settings (JobSettings): [optional] # noqa: E501 settings (JobSettings): [optional] # noqa: E501
metadata (JobMetadata): [optional] # noqa: E501 metadata (JobMetadata): [optional] # noqa: E501
storage (JobStorageInfo): [optional] # noqa: E501 storage (JobStorageInfo): [optional] # noqa: E501
worker_cluster (str): Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job. . [optional] # noqa: E501
delete_requested_at (datetime): If job deletion was requested, this is the timestamp at which that request was stored on Flamenco Manager. . [optional] # noqa: E501 delete_requested_at (datetime): If job deletion was requested, this is the timestamp at which that request was stored on Flamenco Manager. . [optional] # noqa: E501
""" """

View File

@ -99,6 +99,7 @@ class SubmittedJob(ModelNormal):
'settings': (JobSettings,), # noqa: E501 'settings': (JobSettings,), # noqa: E501
'metadata': (JobMetadata,), # noqa: E501 'metadata': (JobMetadata,), # noqa: E501
'storage': (JobStorageInfo,), # noqa: E501 'storage': (JobStorageInfo,), # noqa: E501
'worker_cluster': (str,), # noqa: E501
} }
@cached_property @cached_property
@ -115,6 +116,7 @@ class SubmittedJob(ModelNormal):
'settings': 'settings', # noqa: E501 'settings': 'settings', # noqa: E501
'metadata': 'metadata', # noqa: E501 'metadata': 'metadata', # noqa: E501
'storage': 'storage', # noqa: E501 'storage': 'storage', # noqa: E501
'worker_cluster': 'worker_cluster', # noqa: E501
} }
read_only_vars = { read_only_vars = {
@ -168,6 +170,7 @@ class SubmittedJob(ModelNormal):
settings (JobSettings): [optional] # noqa: E501 settings (JobSettings): [optional] # noqa: E501
metadata (JobMetadata): [optional] # noqa: E501 metadata (JobMetadata): [optional] # noqa: E501
storage (JobStorageInfo): [optional] # noqa: E501 storage (JobStorageInfo): [optional] # noqa: E501
worker_cluster (str): Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job. . [optional] # noqa: E501
""" """
priority = kwargs.get('priority', 50) priority = kwargs.get('priority', 50)
@ -264,6 +267,7 @@ class SubmittedJob(ModelNormal):
settings (JobSettings): [optional] # noqa: E501 settings (JobSettings): [optional] # noqa: E501
metadata (JobMetadata): [optional] # noqa: E501 metadata (JobMetadata): [optional] # noqa: E501
storage (JobStorageInfo): [optional] # noqa: E501 storage (JobStorageInfo): [optional] # noqa: E501
worker_cluster (str): Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job. . [optional] # noqa: E501
""" """
priority = kwargs.get('priority', 50) priority = kwargs.get('priority', 50)

View File

@ -31,11 +31,13 @@ from flamenco.manager.exceptions import ApiAttributeError
def lazy_import(): def lazy_import():
from flamenco.manager.model.worker_all_of import WorkerAllOf from flamenco.manager.model.worker_all_of import WorkerAllOf
from flamenco.manager.model.worker_cluster import WorkerCluster
from flamenco.manager.model.worker_status import WorkerStatus from flamenco.manager.model.worker_status import WorkerStatus
from flamenco.manager.model.worker_status_change_request import WorkerStatusChangeRequest from flamenco.manager.model.worker_status_change_request import WorkerStatusChangeRequest
from flamenco.manager.model.worker_summary import WorkerSummary from flamenco.manager.model.worker_summary import WorkerSummary
from flamenco.manager.model.worker_task import WorkerTask from flamenco.manager.model.worker_task import WorkerTask
globals()['WorkerAllOf'] = WorkerAllOf globals()['WorkerAllOf'] = WorkerAllOf
globals()['WorkerCluster'] = WorkerCluster
globals()['WorkerStatus'] = WorkerStatus globals()['WorkerStatus'] = WorkerStatus
globals()['WorkerStatusChangeRequest'] = WorkerStatusChangeRequest globals()['WorkerStatusChangeRequest'] = WorkerStatusChangeRequest
globals()['WorkerSummary'] = WorkerSummary globals()['WorkerSummary'] = WorkerSummary
@ -105,6 +107,7 @@ class Worker(ModelComposed):
'status_change': (WorkerStatusChangeRequest,), # noqa: E501 'status_change': (WorkerStatusChangeRequest,), # noqa: E501
'last_seen': (datetime,), # noqa: E501 'last_seen': (datetime,), # noqa: E501
'task': (WorkerTask,), # noqa: E501 'task': (WorkerTask,), # noqa: E501
'clusters': ([WorkerCluster],), # noqa: E501
} }
@cached_property @cached_property
@ -123,6 +126,7 @@ class Worker(ModelComposed):
'status_change': 'status_change', # noqa: E501 'status_change': 'status_change', # noqa: E501
'last_seen': 'last_seen', # noqa: E501 'last_seen': 'last_seen', # noqa: E501
'task': 'task', # noqa: E501 'task': 'task', # noqa: E501
'clusters': 'clusters', # noqa: E501
} }
read_only_vars = { read_only_vars = {
@ -174,6 +178,7 @@ class Worker(ModelComposed):
status_change (WorkerStatusChangeRequest): [optional] # noqa: E501 status_change (WorkerStatusChangeRequest): [optional] # noqa: E501
last_seen (datetime): Last time this worker was seen by the Manager.. [optional] # noqa: E501 last_seen (datetime): Last time this worker was seen by the Manager.. [optional] # noqa: E501
task (WorkerTask): [optional] # noqa: E501 task (WorkerTask): [optional] # noqa: E501
clusters ([WorkerCluster]): Clusters of which this Worker is a member.. [optional] # noqa: E501
""" """
_check_type = kwargs.pop('_check_type', True) _check_type = kwargs.pop('_check_type', True)
@ -283,6 +288,7 @@ class Worker(ModelComposed):
status_change (WorkerStatusChangeRequest): [optional] # noqa: E501 status_change (WorkerStatusChangeRequest): [optional] # noqa: E501
last_seen (datetime): Last time this worker was seen by the Manager.. [optional] # noqa: E501 last_seen (datetime): Last time this worker was seen by the Manager.. [optional] # noqa: E501
task (WorkerTask): [optional] # noqa: E501 task (WorkerTask): [optional] # noqa: E501
clusters ([WorkerCluster]): Clusters of which this Worker is a member.. [optional] # noqa: E501
""" """
_check_type = kwargs.pop('_check_type', True) _check_type = kwargs.pop('_check_type', True)

View File

@ -30,7 +30,9 @@ from flamenco.manager.exceptions import ApiAttributeError
def lazy_import(): def lazy_import():
from flamenco.manager.model.worker_cluster import WorkerCluster
from flamenco.manager.model.worker_task import WorkerTask from flamenco.manager.model.worker_task import WorkerTask
globals()['WorkerCluster'] = WorkerCluster
globals()['WorkerTask'] = WorkerTask globals()['WorkerTask'] = WorkerTask
@ -91,6 +93,7 @@ class WorkerAllOf(ModelNormal):
'platform': (str,), # noqa: E501 'platform': (str,), # noqa: E501
'supported_task_types': ([str],), # noqa: E501 'supported_task_types': ([str],), # noqa: E501
'task': (WorkerTask,), # noqa: E501 'task': (WorkerTask,), # noqa: E501
'clusters': ([WorkerCluster],), # noqa: E501
} }
@cached_property @cached_property
@ -103,6 +106,7 @@ class WorkerAllOf(ModelNormal):
'platform': 'platform', # noqa: E501 'platform': 'platform', # noqa: E501
'supported_task_types': 'supported_task_types', # noqa: E501 'supported_task_types': 'supported_task_types', # noqa: E501
'task': 'task', # noqa: E501 'task': 'task', # noqa: E501
'clusters': 'clusters', # noqa: E501
} }
read_only_vars = { read_only_vars = {
@ -152,6 +156,7 @@ class WorkerAllOf(ModelNormal):
through its discriminator because we passed in through its discriminator because we passed in
_visited_composed_classes = (Animal,) _visited_composed_classes = (Animal,)
task (WorkerTask): [optional] # noqa: E501 task (WorkerTask): [optional] # noqa: E501
clusters ([WorkerCluster]): Clusters of which this Worker is a member.. [optional] # noqa: E501
""" """
_check_type = kwargs.pop('_check_type', True) _check_type = kwargs.pop('_check_type', True)
@ -242,6 +247,7 @@ class WorkerAllOf(ModelNormal):
through its discriminator because we passed in through its discriminator because we passed in
_visited_composed_classes = (Animal,) _visited_composed_classes = (Animal,)
task (WorkerTask): [optional] # noqa: E501 task (WorkerTask): [optional] # noqa: E501
clusters ([WorkerCluster]): Clusters of which this Worker is a member.. [optional] # noqa: E501
""" """
_check_type = kwargs.pop('_check_type', True) _check_type = kwargs.pop('_check_type', True)

View File

@ -0,0 +1,269 @@
"""
Flamenco manager
Render Farm manager API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from flamenco.manager.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from flamenco.manager.exceptions import ApiAttributeError
class WorkerCluster(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'name': (str,), # noqa: E501
'id': (str,), # noqa: E501
'description': (str,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'name': 'name', # noqa: E501
'id': 'id', # noqa: E501
'description': 'description', # noqa: E501
}
read_only_vars = {
}
_composed_schemas = {}
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501
"""WorkerCluster - a model defined in OpenAPI
Args:
name (str):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
id (str): UUID of the cluster. Can be ommitted when creating a new cluster, in which case a random UUID will be assigned. . [optional] # noqa: E501
description (str): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
self = super(OpenApiModel, cls).__new__(cls)
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.name = name
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, name, *args, **kwargs): # noqa: E501
"""WorkerCluster - a model defined in OpenAPI
Args:
name (str):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
id (str): UUID of the cluster. Can be ommitted when creating a new cluster, in which case a random UUID will be assigned. . [optional] # noqa: E501
description (str): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.name = name
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")

View File

@ -0,0 +1,261 @@
"""
Flamenco manager
Render Farm manager API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from flamenco.manager.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from flamenco.manager.exceptions import ApiAttributeError
class WorkerClusterChangeRequest(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'cluster_ids': ([str],), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'cluster_ids': 'cluster_ids', # noqa: E501
}
read_only_vars = {
}
_composed_schemas = {}
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, cluster_ids, *args, **kwargs): # noqa: E501
"""WorkerClusterChangeRequest - a model defined in OpenAPI
Args:
cluster_ids ([str]):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
self = super(OpenApiModel, cls).__new__(cls)
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.cluster_ids = cluster_ids
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, cluster_ids, *args, **kwargs): # noqa: E501
"""WorkerClusterChangeRequest - a model defined in OpenAPI
Args:
cluster_ids ([str]):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.cluster_ids = cluster_ids
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")

View File

@ -0,0 +1,261 @@
"""
Flamenco manager
Render Farm manager API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from flamenco.manager.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from flamenco.manager.exceptions import ApiAttributeError
def lazy_import():
from flamenco.manager.model.worker_cluster import WorkerCluster
globals()['WorkerCluster'] = WorkerCluster
class WorkerClusterList(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'clusters': ([WorkerCluster],), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'clusters': 'clusters', # noqa: E501
}
read_only_vars = {
}
_composed_schemas = {}
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
"""WorkerClusterList - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
clusters ([WorkerCluster]): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
self = super(OpenApiModel, cls).__new__(cls)
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""WorkerClusterList - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
clusters ([WorkerCluster]): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")

View File

@ -74,6 +74,9 @@ from flamenco.manager.model.task_update import TaskUpdate
from flamenco.manager.model.task_worker import TaskWorker from flamenco.manager.model.task_worker import TaskWorker
from flamenco.manager.model.worker import Worker from flamenco.manager.model.worker import Worker
from flamenco.manager.model.worker_all_of import WorkerAllOf from flamenco.manager.model.worker_all_of import WorkerAllOf
from flamenco.manager.model.worker_cluster import WorkerCluster
from flamenco.manager.model.worker_cluster_change_request import WorkerClusterChangeRequest
from flamenco.manager.model.worker_cluster_list import WorkerClusterList
from flamenco.manager.model.worker_list import WorkerList from flamenco.manager.model.worker_list import WorkerList
from flamenco.manager.model.worker_registration import WorkerRegistration from flamenco.manager.model.worker_registration import WorkerRegistration
from flamenco.manager.model.worker_sign_on import WorkerSignOn from flamenco.manager.model.worker_sign_on import WorkerSignOn

View File

@ -116,12 +116,18 @@ Class | Method | HTTP request | Description
*WorkerApi* | [**task_update**](flamenco/manager/docs/WorkerApi.md#task_update) | **POST** /api/v3/worker/task/{task_id} | Update the task, typically to indicate progress, completion, or failure. *WorkerApi* | [**task_update**](flamenco/manager/docs/WorkerApi.md#task_update) | **POST** /api/v3/worker/task/{task_id} | Update the task, typically to indicate progress, completion, or failure.
*WorkerApi* | [**worker_state**](flamenco/manager/docs/WorkerApi.md#worker_state) | **GET** /api/v3/worker/state | *WorkerApi* | [**worker_state**](flamenco/manager/docs/WorkerApi.md#worker_state) | **GET** /api/v3/worker/state |
*WorkerApi* | [**worker_state_changed**](flamenco/manager/docs/WorkerApi.md#worker_state_changed) | **POST** /api/v3/worker/state-changed | Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals. *WorkerApi* | [**worker_state_changed**](flamenco/manager/docs/WorkerApi.md#worker_state_changed) | **POST** /api/v3/worker/state-changed | Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
*WorkerMgtApi* | [**create_worker_cluster**](flamenco/manager/docs/WorkerMgtApi.md#create_worker_cluster) | **POST** /api/v3/worker-mgt/clusters | Create a new worker cluster.
*WorkerMgtApi* | [**delete_worker**](flamenco/manager/docs/WorkerMgtApi.md#delete_worker) | **DELETE** /api/v3/worker-mgt/workers/{worker_id} | Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued. *WorkerMgtApi* | [**delete_worker**](flamenco/manager/docs/WorkerMgtApi.md#delete_worker) | **DELETE** /api/v3/worker-mgt/workers/{worker_id} | Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued.
*WorkerMgtApi* | [**delete_worker_cluster**](flamenco/manager/docs/WorkerMgtApi.md#delete_worker_cluster) | **DELETE** /api/v3/worker-mgt/cluster/{cluster_id} | Remove this worker cluster. This unassigns all workers from the cluster and removes it.
*WorkerMgtApi* | [**fetch_worker**](flamenco/manager/docs/WorkerMgtApi.md#fetch_worker) | **GET** /api/v3/worker-mgt/workers/{worker_id} | Fetch info about the worker. *WorkerMgtApi* | [**fetch_worker**](flamenco/manager/docs/WorkerMgtApi.md#fetch_worker) | **GET** /api/v3/worker-mgt/workers/{worker_id} | Fetch info about the worker.
*WorkerMgtApi* | [**fetch_worker_cluster**](flamenco/manager/docs/WorkerMgtApi.md#fetch_worker_cluster) | **GET** /api/v3/worker-mgt/cluster/{cluster_id} | Get a single worker cluster.
*WorkerMgtApi* | [**fetch_worker_clusters**](flamenco/manager/docs/WorkerMgtApi.md#fetch_worker_clusters) | **GET** /api/v3/worker-mgt/clusters | Get list of worker clusters.
*WorkerMgtApi* | [**fetch_worker_sleep_schedule**](flamenco/manager/docs/WorkerMgtApi.md#fetch_worker_sleep_schedule) | **GET** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule | *WorkerMgtApi* | [**fetch_worker_sleep_schedule**](flamenco/manager/docs/WorkerMgtApi.md#fetch_worker_sleep_schedule) | **GET** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule |
*WorkerMgtApi* | [**fetch_workers**](flamenco/manager/docs/WorkerMgtApi.md#fetch_workers) | **GET** /api/v3/worker-mgt/workers | Get list of workers. *WorkerMgtApi* | [**fetch_workers**](flamenco/manager/docs/WorkerMgtApi.md#fetch_workers) | **GET** /api/v3/worker-mgt/workers | Get list of workers.
*WorkerMgtApi* | [**request_worker_status_change**](flamenco/manager/docs/WorkerMgtApi.md#request_worker_status_change) | **POST** /api/v3/worker-mgt/workers/{worker_id}/setstatus | *WorkerMgtApi* | [**request_worker_status_change**](flamenco/manager/docs/WorkerMgtApi.md#request_worker_status_change) | **POST** /api/v3/worker-mgt/workers/{worker_id}/setstatus |
*WorkerMgtApi* | [**set_worker_clusters**](flamenco/manager/docs/WorkerMgtApi.md#set_worker_clusters) | **POST** /api/v3/worker-mgt/workers/{worker_id}/setclusters |
*WorkerMgtApi* | [**set_worker_sleep_schedule**](flamenco/manager/docs/WorkerMgtApi.md#set_worker_sleep_schedule) | **POST** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule | *WorkerMgtApi* | [**set_worker_sleep_schedule**](flamenco/manager/docs/WorkerMgtApi.md#set_worker_sleep_schedule) | **POST** /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule |
*WorkerMgtApi* | [**update_worker_cluster**](flamenco/manager/docs/WorkerMgtApi.md#update_worker_cluster) | **PUT** /api/v3/worker-mgt/cluster/{cluster_id} | Update an existing worker cluster.
## Documentation For Models ## Documentation For Models
@ -191,6 +197,9 @@ Class | Method | HTTP request | Description
- [TaskWorker](flamenco/manager/docs/TaskWorker.md) - [TaskWorker](flamenco/manager/docs/TaskWorker.md)
- [Worker](flamenco/manager/docs/Worker.md) - [Worker](flamenco/manager/docs/Worker.md)
- [WorkerAllOf](flamenco/manager/docs/WorkerAllOf.md) - [WorkerAllOf](flamenco/manager/docs/WorkerAllOf.md)
- [WorkerCluster](flamenco/manager/docs/WorkerCluster.md)
- [WorkerClusterChangeRequest](flamenco/manager/docs/WorkerClusterChangeRequest.md)
- [WorkerClusterList](flamenco/manager/docs/WorkerClusterList.md)
- [WorkerList](flamenco/manager/docs/WorkerList.md) - [WorkerList](flamenco/manager/docs/WorkerList.md)
- [WorkerRegistration](flamenco/manager/docs/WorkerRegistration.md) - [WorkerRegistration](flamenco/manager/docs/WorkerRegistration.md)
- [WorkerSignOn](flamenco/manager/docs/WorkerSignOn.md) - [WorkerSignOn](flamenco/manager/docs/WorkerSignOn.md)

View File

@ -10,7 +10,7 @@ from urllib3.exceptions import HTTPError, MaxRetryError
import bpy import bpy
from . import job_types, job_submission, preferences from . import job_types, job_submission, preferences, worker_clusters
from .job_types_propgroup import JobTypePropertyGroup from .job_types_propgroup import JobTypePropertyGroup
from .bat.submodules import bpathlib from .bat.submodules import bpathlib
@ -83,6 +83,37 @@ class FLAMENCO_OT_fetch_job_types(FlamencoOpMixin, bpy.types.Operator):
return {"FINISHED"} return {"FINISHED"}
class FLAMENCO_OT_fetch_worker_clusters(FlamencoOpMixin, bpy.types.Operator):
bl_idname = "flamenco.fetch_worker_clusters"
bl_label = "Fetch Worker Clusters"
bl_description = "Query Flamenco Manager to obtain the available worker clusters"
def execute(self, context: bpy.types.Context) -> set[str]:
api_client = self.get_api_client(context)
from flamenco.manager import ApiException
scene = context.scene
old_cluster = getattr(scene, "flamenco_worker_cluster", "")
try:
worker_clusters.refresh(context, api_client)
except ApiException as ex:
self.report({"ERROR"}, "Error getting job types: %s" % ex)
return {"CANCELLED"}
except MaxRetryError as ex:
# This is the common error, when for example the port number is
# incorrect and nothing is listening.
self.report({"ERROR"}, "Unable to reach Manager")
return {"CANCELLED"}
if old_cluster:
# TODO: handle cases where the old cluster no longer exists.
scene.flamenco_worker_cluster = old_cluster
return {"FINISHED"}
class FLAMENCO_OT_ping_manager(FlamencoOpMixin, bpy.types.Operator): class FLAMENCO_OT_ping_manager(FlamencoOpMixin, bpy.types.Operator):
bl_idname = "flamenco.ping_manager" bl_idname = "flamenco.ping_manager"
bl_label = "Flamenco: Ping Manager" bl_label = "Flamenco: Ping Manager"
@ -165,7 +196,9 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator):
if not context.blend_data.filepath: if not context.blend_data.filepath:
# The file path needs to be known before the file can be submitted. # The file path needs to be known before the file can be submitted.
self.report({"ERROR"}, "Please save your .blend file before submitting to Flamenco") self.report(
{"ERROR"}, "Please save your .blend file before submitting to Flamenco"
)
return {"CANCELLED"} return {"CANCELLED"}
filepath = self._save_blendfile(context) filepath = self._save_blendfile(context)
@ -633,6 +666,7 @@ class FLAMENCO3_OT_explore_file_path(bpy.types.Operator):
classes = ( classes = (
FLAMENCO_OT_fetch_job_types, FLAMENCO_OT_fetch_job_types,
FLAMENCO_OT_fetch_worker_clusters,
FLAMENCO_OT_ping_manager, FLAMENCO_OT_ping_manager,
FLAMENCO_OT_eval_setting, FLAMENCO_OT_eval_setting,
FLAMENCO_OT_submit_job, FLAMENCO_OT_submit_job,

View File

@ -34,6 +34,12 @@ def _manager_url_updated(prefs, context):
comms.ping_manager_with_report(context.window_manager, api_client, prefs) comms.ping_manager_with_report(context.window_manager, api_client, prefs)
class WorkerCluster(bpy.types.PropertyGroup):
id: bpy.props.StringProperty(name="id")
name: bpy.props.StringProperty(name="Name")
description: bpy.props.StringProperty(name="Description")
class FlamencoPreferences(bpy.types.AddonPreferences): class FlamencoPreferences(bpy.types.AddonPreferences):
bl_idname = "flamenco" bl_idname = "flamenco"
@ -71,6 +77,13 @@ class FlamencoPreferences(bpy.types.AddonPreferences):
get=lambda prefs: prefs.job_storage, get=lambda prefs: prefs.job_storage,
) )
worker_clusters: bpy.props.CollectionProperty( # type: ignore
type=WorkerCluster,
name="Worker Clusters",
description="Cache for the worker clusters available on the configured Manager",
options={"HIDDEN"},
)
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None:
layout = self.layout layout = self.layout
layout.use_property_decorate = False layout.use_property_decorate = False
@ -117,7 +130,10 @@ def manager_url(context: bpy.types.Context) -> str:
return str(prefs.manager_url) return str(prefs.manager_url)
classes = (FlamencoPreferences,) classes = (
WorkerCluster,
FlamencoPreferences,
)
_register, _unregister = bpy.utils.register_classes_factory(classes) _register, _unregister = bpy.utils.register_classes_factory(classes)

View File

@ -0,0 +1,74 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from typing import TYPE_CHECKING, Union
import bpy
from . import preferences
if TYPE_CHECKING:
from flamenco.manager import ApiClient as _ApiClient
else:
_ApiClient = object
_enum_items: list[Union[tuple[str, str, str], tuple[str, str, str, int, int]]] = []
def refresh(context: bpy.types.Context, api_client: _ApiClient) -> None:
"""Fetch the available worker clusters from the Manager."""
from flamenco.manager import ApiClient
from flamenco.manager.api import worker_mgt_api
from flamenco.manager.model.worker_cluster_list import WorkerClusterList
assert isinstance(api_client, ApiClient)
api = worker_mgt_api.WorkerMgtApi(api_client)
response: WorkerClusterList = api.fetch_worker_clusters()
# Store on the preferences, so a cached version persists until the next refresh.
prefs = preferences.get(context)
prefs.worker_clusters.clear()
for cluster in response.clusters:
rna_cluster = prefs.worker_clusters.add()
rna_cluster.id = cluster.id
rna_cluster.name = cluster.name
rna_cluster.description = getattr(cluster, "description", "")
def _get_enum_items(self, context):
global _enum_items
prefs = preferences.get(context)
_enum_items = [
("-", "No Cluster", "No cluster assigned, any worker can handle this job"),
]
_enum_items.extend(
(cluster.id, cluster.name, cluster.description)
for cluster in prefs.worker_clusters
)
return _enum_items
def register() -> None:
bpy.types.Scene.flamenco_worker_cluster = bpy.props.EnumProperty(
name="Worker Cluster",
items=_get_enum_items,
description="The set of Workers that can handle tasks of this job",
)
def unregister() -> None:
to_del = ((bpy.types.Scene, "flamenco_worker_cluster"),)
for ob, attr in to_del:
try:
delattr(ob, attr)
except AttributeError:
pass
if __name__ == "__main__":
import doctest
print(doctest.testmod())

View File

@ -10,10 +10,18 @@ import (
"github.com/adrg/xdg" "github.com/adrg/xdg"
) )
// customHome can be set at link time to specify the home directory for the worker.
// This can be overruled at runtime by setting the FLAMENCO_HOME enviroment variable.
// Only used in InFlamencoHome() function.
var customHome = ""
// InFlamencoHome returns the filename in the 'flamenco home' dir, and ensures // InFlamencoHome returns the filename in the 'flamenco home' dir, and ensures
// that the directory exists. // that the directory exists.
func InFlamencoHome(filename string) (string, error) { func InFlamencoHome(filename string) (string, error) {
flamencoHome := os.Getenv("FLAMENCO_HOME") flamencoHome := customHome
if envHome, ok := os.LookupEnv("FLAMENCO_HOME"); ok {
flamencoHome = envHome
}
if flamencoHome == "" { if flamencoHome == "" {
return xdg.DataFile(path.Join(xdgApplicationName, filename)) return xdg.DataFile(path.Join(xdgApplicationName, filename))
} }

View File

@ -65,6 +65,14 @@ type PersistenceService interface {
RemoveFromJobBlocklist(ctx context.Context, jobUUID, workerUUID, taskType string) error RemoveFromJobBlocklist(ctx context.Context, jobUUID, workerUUID, taskType string) error
ClearJobBlocklist(ctx context.Context, job *persistence.Job) error ClearJobBlocklist(ctx context.Context, job *persistence.Job) error
// Worker cluster management.
WorkerSetClusters(ctx context.Context, worker *persistence.Worker, clusterUUIDs []string) error
CreateWorkerCluster(ctx context.Context, cluster *persistence.WorkerCluster) error
FetchWorkerCluster(ctx context.Context, uuid string) (*persistence.WorkerCluster, error)
FetchWorkerClusters(ctx context.Context) ([]*persistence.WorkerCluster, error)
DeleteWorkerCluster(ctx context.Context, uuid string) error
SaveWorkerCluster(ctx context.Context, cluster *persistence.WorkerCluster) error
// WorkersLeftToRun returns a set of worker UUIDs that can run tasks of the given type on the given job. // WorkersLeftToRun returns a set of worker UUIDs that can run tasks of the given type on the given job.
WorkersLeftToRun(ctx context.Context, job *persistence.Job, taskType string) (map[string]bool, error) WorkersLeftToRun(ctx context.Context, job *persistence.Job, taskType string) (map[string]bool, error)
// CountTaskFailuresOfWorker returns the number of task failures of this worker, on this particular job and task type. // CountTaskFailuresOfWorker returns the number of task failures of this worker, on this particular job and task type.

View File

@ -618,6 +618,9 @@ func jobDBtoAPI(dbJob *persistence.Job) api.Job {
if dbJob.DeleteRequestedAt.Valid { if dbJob.DeleteRequestedAt.Valid {
apiJob.DeleteRequestedAt = &dbJob.DeleteRequestedAt.Time apiJob.DeleteRequestedAt = &dbJob.DeleteRequestedAt.Time
} }
if dbJob.WorkerCluster != nil {
apiJob.WorkerCluster = &dbJob.WorkerCluster.UUID
}
return apiJob return apiJob
} }

View File

@ -17,6 +17,7 @@ import (
"git.blender.org/flamenco/pkg/moremock" "git.blender.org/flamenco/pkg/moremock"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) )
func ptr[T any](value T) *T { func ptr[T any](value T) *T {
@ -319,6 +320,103 @@ func TestSubmitJobWithShamanCheckoutID(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
} }
func TestSubmitJobWithWorkerCluster(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
mf := newMockedFlamenco(mockCtrl)
worker := testWorker()
workerClusterUUID := "04435762-9dc8-4f13-80b7-643a6fa5b6fd"
cluster := persistence.WorkerCluster{
Model: persistence.Model{ID: 47},
UUID: workerClusterUUID,
Name: "first cluster",
Description: "my first cluster",
}
submittedJob := api.SubmittedJob{
Name: "поднео посао",
Type: "test",
Priority: 50,
SubmitterPlatform: worker.Platform,
WorkerCluster: &workerClusterUUID,
}
mf.expectConvertTwoWayVariables(t,
config.VariableAudienceWorkers,
config.VariablePlatform(worker.Platform),
map[string]string{},
)
// Expect the job compiler to be called.
authoredJob := job_compilers.AuthoredJob{
JobID: "afc47568-bd9d-4368-8016-e91d945db36d",
WorkerClusterUUID: workerClusterUUID,
Name: submittedJob.Name,
JobType: submittedJob.Type,
Priority: submittedJob.Priority,
Status: api.JobStatusUnderConstruction,
Created: mf.clock.Now(),
}
mf.jobCompiler.EXPECT().Compile(gomock.Any(), submittedJob).Return(&authoredJob, nil)
// Expect the job to be saved with 'queued' status:
queuedJob := authoredJob
queuedJob.Status = api.JobStatusQueued
mf.persistence.EXPECT().StoreAuthoredJob(gomock.Any(), queuedJob).Return(nil)
// Expect the job to be fetched from the database again:
dbJob := persistence.Job{
Model: persistence.Model{
ID: 47,
CreatedAt: mf.clock.Now(),
UpdatedAt: mf.clock.Now(),
},
UUID: queuedJob.JobID,
Name: queuedJob.Name,
JobType: queuedJob.JobType,
Priority: queuedJob.Priority,
Status: queuedJob.Status,
Settings: persistence.StringInterfaceMap{},
Metadata: persistence.StringStringMap{},
WorkerClusterID: &cluster.ID,
WorkerCluster: &cluster,
}
mf.persistence.EXPECT().FetchJob(gomock.Any(), queuedJob.JobID).Return(&dbJob, nil)
// Expect the new job to be broadcast.
jobUpdate := api.SocketIOJobUpdate{
Id: dbJob.UUID,
Name: &dbJob.Name,
Priority: dbJob.Priority,
Status: dbJob.Status,
Type: dbJob.JobType,
Updated: dbJob.UpdatedAt,
}
mf.broadcaster.EXPECT().BroadcastNewJob(jobUpdate)
// Do the call.
echoCtx := mf.prepareMockedJSONRequest(submittedJob)
requestWorkerStore(echoCtx, &worker)
require.NoError(t, mf.flamenco.SubmitJob(echoCtx))
submittedJob.Metadata = new(api.JobMetadata)
submittedJob.Settings = new(api.JobSettings)
submittedJob.SubmitterPlatform = "" // Not persisted in the database.
assertResponseJSON(t, echoCtx, http.StatusOK, api.Job{
SubmittedJob: submittedJob,
Id: dbJob.UUID,
Created: dbJob.CreatedAt,
Updated: dbJob.UpdatedAt,
DeleteRequestedAt: nil,
Activity: "",
Status: api.JobStatusQueued,
})
}
func TestGetJobTypeHappy(t *testing.T) { func TestGetJobTypeHappy(t *testing.T) {
mockCtrl := gomock.NewController(t) mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish() defer mockCtrl.Finish()

View File

@ -141,6 +141,20 @@ func (mr *MockPersistenceServiceMockRecorder) CreateWorker(arg0, arg1 interface{
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorker", reflect.TypeOf((*MockPersistenceService)(nil).CreateWorker), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorker", reflect.TypeOf((*MockPersistenceService)(nil).CreateWorker), arg0, arg1)
} }
// CreateWorkerCluster mocks base method.
func (m *MockPersistenceService) CreateWorkerCluster(arg0 context.Context, arg1 *persistence.WorkerCluster) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateWorkerCluster", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CreateWorkerCluster indicates an expected call of CreateWorkerCluster.
func (mr *MockPersistenceServiceMockRecorder) CreateWorkerCluster(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkerCluster", reflect.TypeOf((*MockPersistenceService)(nil).CreateWorkerCluster), arg0, arg1)
}
// DeleteWorker mocks base method. // DeleteWorker mocks base method.
func (m *MockPersistenceService) DeleteWorker(arg0 context.Context, arg1 string) error { func (m *MockPersistenceService) DeleteWorker(arg0 context.Context, arg1 string) error {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -155,6 +169,20 @@ func (mr *MockPersistenceServiceMockRecorder) DeleteWorker(arg0, arg1 interface{
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorker", reflect.TypeOf((*MockPersistenceService)(nil).DeleteWorker), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorker", reflect.TypeOf((*MockPersistenceService)(nil).DeleteWorker), arg0, arg1)
} }
// DeleteWorkerCluster mocks base method.
func (m *MockPersistenceService) DeleteWorkerCluster(arg0 context.Context, arg1 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteWorkerCluster", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteWorkerCluster indicates an expected call of DeleteWorkerCluster.
func (mr *MockPersistenceServiceMockRecorder) DeleteWorkerCluster(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkerCluster", reflect.TypeOf((*MockPersistenceService)(nil).DeleteWorkerCluster), arg0, arg1)
}
// FetchJob mocks base method. // FetchJob mocks base method.
func (m *MockPersistenceService) FetchJob(arg0 context.Context, arg1 string) (*persistence.Job, error) { func (m *MockPersistenceService) FetchJob(arg0 context.Context, arg1 string) (*persistence.Job, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -230,6 +258,36 @@ func (mr *MockPersistenceServiceMockRecorder) FetchWorker(arg0, arg1 interface{}
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchWorker", reflect.TypeOf((*MockPersistenceService)(nil).FetchWorker), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchWorker", reflect.TypeOf((*MockPersistenceService)(nil).FetchWorker), arg0, arg1)
} }
// FetchWorkerCluster mocks base method.
func (m *MockPersistenceService) FetchWorkerCluster(arg0 context.Context, arg1 string) (*persistence.WorkerCluster, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FetchWorkerCluster", arg0, arg1)
ret0, _ := ret[0].(*persistence.WorkerCluster)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FetchWorkerCluster indicates an expected call of FetchWorkerCluster.
func (mr *MockPersistenceServiceMockRecorder) FetchWorkerCluster(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchWorkerCluster", reflect.TypeOf((*MockPersistenceService)(nil).FetchWorkerCluster), arg0, arg1)
}
// FetchWorkerClusters mocks base method.
func (m *MockPersistenceService) FetchWorkerClusters(arg0 context.Context) ([]*persistence.WorkerCluster, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FetchWorkerClusters", arg0)
ret0, _ := ret[0].([]*persistence.WorkerCluster)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FetchWorkerClusters indicates an expected call of FetchWorkerClusters.
func (mr *MockPersistenceServiceMockRecorder) FetchWorkerClusters(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchWorkerClusters", reflect.TypeOf((*MockPersistenceService)(nil).FetchWorkerClusters), arg0)
}
// FetchWorkerTask mocks base method. // FetchWorkerTask mocks base method.
func (m *MockPersistenceService) FetchWorkerTask(arg0 context.Context, arg1 *persistence.Worker) (*persistence.Task, error) { func (m *MockPersistenceService) FetchWorkerTask(arg0 context.Context, arg1 *persistence.Worker) (*persistence.Task, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -375,6 +433,20 @@ func (mr *MockPersistenceServiceMockRecorder) SaveWorker(arg0, arg1 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveWorker", reflect.TypeOf((*MockPersistenceService)(nil).SaveWorker), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveWorker", reflect.TypeOf((*MockPersistenceService)(nil).SaveWorker), arg0, arg1)
} }
// SaveWorkerCluster mocks base method.
func (m *MockPersistenceService) SaveWorkerCluster(arg0 context.Context, arg1 *persistence.WorkerCluster) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SaveWorkerCluster", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// SaveWorkerCluster indicates an expected call of SaveWorkerCluster.
func (mr *MockPersistenceServiceMockRecorder) SaveWorkerCluster(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveWorkerCluster", reflect.TypeOf((*MockPersistenceService)(nil).SaveWorkerCluster), arg0, arg1)
}
// SaveWorkerStatus mocks base method. // SaveWorkerStatus mocks base method.
func (m *MockPersistenceService) SaveWorkerStatus(arg0 context.Context, arg1 *persistence.Worker) error { func (m *MockPersistenceService) SaveWorkerStatus(arg0 context.Context, arg1 *persistence.Worker) error {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -460,6 +532,20 @@ func (mr *MockPersistenceServiceMockRecorder) WorkerSeen(arg0, arg1 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkerSeen", reflect.TypeOf((*MockPersistenceService)(nil).WorkerSeen), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkerSeen", reflect.TypeOf((*MockPersistenceService)(nil).WorkerSeen), arg0, arg1)
} }
// WorkerSetClusters mocks base method.
func (m *MockPersistenceService) WorkerSetClusters(arg0 context.Context, arg1 *persistence.Worker, arg2 []string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WorkerSetClusters", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// WorkerSetClusters indicates an expected call of WorkerSetClusters.
func (mr *MockPersistenceServiceMockRecorder) WorkerSetClusters(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkerSetClusters", reflect.TypeOf((*MockPersistenceService)(nil).WorkerSetClusters), arg0, arg1, arg2)
}
// WorkersLeftToRun mocks base method. // WorkersLeftToRun mocks base method.
func (m *MockPersistenceService) WorkersLeftToRun(arg0 context.Context, arg1 *persistence.Job, arg2 string) (map[string]bool, error) { func (m *MockPersistenceService) WorkersLeftToRun(arg0 context.Context, arg1 *persistence.Job, arg2 string) (map[string]bool, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()

View File

@ -182,6 +182,202 @@ func (f *Flamenco) RequestWorkerStatusChange(e echo.Context, workerUUID string)
return e.NoContent(http.StatusNoContent) return e.NoContent(http.StatusNoContent)
} }
func (f *Flamenco) SetWorkerClusters(e echo.Context, workerUUID string) error {
ctx := e.Request().Context()
logger := requestLogger(e)
logger = logger.With().Str("worker", workerUUID).Logger()
if !uuid.IsValid(workerUUID) {
return sendAPIError(e, http.StatusBadRequest, "not a valid UUID")
}
// Decode the request body.
var change api.WorkerClusterChangeRequest
if err := e.Bind(&change); err != nil {
logger.Warn().Err(err).Msg("bad request received")
return sendAPIError(e, http.StatusBadRequest, "invalid format")
}
// Fetch the worker.
dbWorker, err := f.persist.FetchWorker(ctx, workerUUID)
if errors.Is(err, persistence.ErrWorkerNotFound) {
logger.Debug().Msg("non-existent worker requested")
return sendAPIError(e, http.StatusNotFound, "worker %q not found", workerUUID)
}
if err != nil {
logger.Error().Err(err).Msg("fetching worker")
return sendAPIError(e, http.StatusInternalServerError, "error fetching worker: %v", err)
}
logger = logger.With().
Strs("clusters", change.ClusterIds).
Logger()
logger.Info().Msg("worker cluster change requested")
// Store the new cluster assignment.
if err := f.persist.WorkerSetClusters(ctx, dbWorker, change.ClusterIds); err != nil {
logger.Error().Err(err).Msg("saving worker after cluster change request")
return sendAPIError(e, http.StatusInternalServerError, "error saving worker: %v", err)
}
// Broadcast the change.
update := webupdates.NewWorkerUpdate(dbWorker)
f.broadcaster.BroadcastWorkerUpdate(update)
return e.NoContent(http.StatusNoContent)
}
func (f *Flamenco) DeleteWorkerCluster(e echo.Context, clusterUUID string) error {
ctx := e.Request().Context()
logger := requestLogger(e)
logger = logger.With().Str("cluster", clusterUUID).Logger()
if !uuid.IsValid(clusterUUID) {
return sendAPIError(e, http.StatusBadRequest, "not a valid UUID")
}
err := f.persist.DeleteWorkerCluster(ctx, clusterUUID)
switch {
case errors.Is(err, persistence.ErrWorkerClusterNotFound):
logger.Debug().Msg("non-existent worker cluster requested")
return sendAPIError(e, http.StatusNotFound, "worker cluster %q not found", clusterUUID)
case err != nil:
logger.Error().Err(err).Msg("deleting worker cluster")
return sendAPIError(e, http.StatusInternalServerError, "error deleting worker cluster: %v", err)
}
// TODO: SocketIO broadcast of cluster deletion.
logger.Info().Msg("worker cluster deleted")
return e.NoContent(http.StatusNoContent)
}
func (f *Flamenco) FetchWorkerCluster(e echo.Context, clusterUUID string) error {
ctx := e.Request().Context()
logger := requestLogger(e)
logger = logger.With().Str("cluster", clusterUUID).Logger()
if !uuid.IsValid(clusterUUID) {
return sendAPIError(e, http.StatusBadRequest, "not a valid UUID")
}
cluster, err := f.persist.FetchWorkerCluster(ctx, clusterUUID)
switch {
case errors.Is(err, persistence.ErrWorkerClusterNotFound):
logger.Debug().Msg("non-existent worker cluster requested")
return sendAPIError(e, http.StatusNotFound, "worker cluster %q not found", clusterUUID)
case err != nil:
logger.Error().Err(err).Msg("fetching worker cluster")
return sendAPIError(e, http.StatusInternalServerError, "error fetching worker cluster: %v", err)
}
return e.JSON(http.StatusOK, workerClusterDBtoAPI(*cluster))
}
func (f *Flamenco) UpdateWorkerCluster(e echo.Context, clusterUUID string) error {
ctx := e.Request().Context()
logger := requestLogger(e)
logger = logger.With().Str("cluster", clusterUUID).Logger()
if !uuid.IsValid(clusterUUID) {
return sendAPIError(e, http.StatusBadRequest, "not a valid UUID")
}
// Decode the request body.
var update api.UpdateWorkerClusterJSONBody
if err := e.Bind(&update); err != nil {
logger.Warn().Err(err).Msg("bad request received")
return sendAPIError(e, http.StatusBadRequest, "invalid format")
}
dbCluster, err := f.persist.FetchWorkerCluster(ctx, clusterUUID)
switch {
case errors.Is(err, persistence.ErrWorkerClusterNotFound):
logger.Debug().Msg("non-existent worker cluster requested")
return sendAPIError(e, http.StatusNotFound, "worker cluster %q not found", clusterUUID)
case err != nil:
logger.Error().Err(err).Msg("fetching worker cluster")
return sendAPIError(e, http.StatusInternalServerError, "error fetching worker cluster: %v", err)
}
// Update the cluster.
dbCluster.Name = update.Name
if update.Description == nil {
dbCluster.Description = ""
} else {
dbCluster.Description = *update.Description
}
if err := f.persist.SaveWorkerCluster(ctx, dbCluster); err != nil {
logger.Error().Err(err).Msg("saving worker cluster")
return sendAPIError(e, http.StatusInternalServerError, "error saving worker cluster")
}
// TODO: SocketIO broadcast of cluster update.
return e.NoContent(http.StatusNoContent)
}
func (f *Flamenco) FetchWorkerClusters(e echo.Context) error {
ctx := e.Request().Context()
logger := requestLogger(e)
dbClusters, err := f.persist.FetchWorkerClusters(ctx)
if err != nil {
logger.Error().Err(err).Msg("fetching worker clusters")
return sendAPIError(e, http.StatusInternalServerError, "error saving worker cluster")
}
apiClusters := []api.WorkerCluster{}
for _, dbCluster := range dbClusters {
apiCluster := workerClusterDBtoAPI(*dbCluster)
apiClusters = append(apiClusters, apiCluster)
}
clusterList := api.WorkerClusterList{
Clusters: &apiClusters,
}
return e.JSON(http.StatusOK, &clusterList)
}
func (f *Flamenco) CreateWorkerCluster(e echo.Context) error {
ctx := e.Request().Context()
logger := requestLogger(e)
// Decode the request body.
var apiCluster api.CreateWorkerClusterJSONBody
if err := e.Bind(&apiCluster); err != nil {
logger.Warn().Err(err).Msg("bad request received")
return sendAPIError(e, http.StatusBadRequest, "invalid format")
}
// Convert to persistence layer model.
var clusterUUID string
if apiCluster.Id != nil && *apiCluster.Id != "" {
clusterUUID = *apiCluster.Id
} else {
clusterUUID = uuid.New()
}
dbCluster := persistence.WorkerCluster{
UUID: clusterUUID,
Name: apiCluster.Name,
}
if apiCluster.Description != nil {
dbCluster.Description = *apiCluster.Description
}
// Store in the database.
if err := f.persist.CreateWorkerCluster(ctx, &dbCluster); err != nil {
logger.Error().Err(err).Msg("creating worker cluster")
return sendAPIError(e, http.StatusInternalServerError, "error creating worker cluster")
}
// TODO: SocketIO broadcast of cluster creation.
return e.JSON(http.StatusOK, workerClusterDBtoAPI(dbCluster))
}
func workerSummary(w persistence.Worker) api.WorkerSummary { func workerSummary(w persistence.Worker) api.WorkerSummary {
summary := api.WorkerSummary{ summary := api.WorkerSummary{
Id: w.UUID, Id: w.UUID,
@ -211,5 +407,26 @@ func workerDBtoAPI(w persistence.Worker) api.Worker {
SupportedTaskTypes: w.TaskTypes(), SupportedTaskTypes: w.TaskTypes(),
} }
if len(w.Clusters) > 0 {
clusters := []api.WorkerCluster{}
for i := range w.Clusters {
clusters = append(clusters, workerClusterDBtoAPI(*w.Clusters[i]))
}
apiWorker.Clusters = &clusters
}
return apiWorker return apiWorker
} }
func workerClusterDBtoAPI(wc persistence.WorkerCluster) api.WorkerCluster {
uuid := wc.UUID // Take a copy for safety.
apiCluster := api.WorkerCluster{
Id: &uuid,
Name: wc.Name,
}
if len(wc.Description) > 0 {
apiCluster.Description = &wc.Description
}
return apiCluster
}

View File

@ -10,6 +10,7 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"git.blender.org/flamenco/internal/manager/persistence" "git.blender.org/flamenco/internal/manager/persistence"
"git.blender.org/flamenco/pkg/api" "git.blender.org/flamenco/pkg/api"
@ -260,3 +261,59 @@ func TestRequestWorkerStatusChangeRevert(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
assertResponseNoContent(t, echo) assertResponseNoContent(t, echo)
} }
func TestWorkerClusterCRUDHappyFlow(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
mf := newMockedFlamenco(mockCtrl)
// Create a cluster.
UUID := "18d9234e-5135-458f-a1ba-a350c3d4e837"
apiCluster := api.WorkerCluster{
Id: &UUID,
Name: "ʻO nā manu ʻino",
Description: ptr("Ke aloha"),
}
expectDBCluster := persistence.WorkerCluster{
UUID: UUID,
Name: apiCluster.Name,
Description: *apiCluster.Description,
}
mf.persistence.EXPECT().CreateWorkerCluster(gomock.Any(), &expectDBCluster)
// TODO: expect SocketIO broadcast of the cluster creation.
echo := mf.prepareMockedJSONRequest(apiCluster)
require.NoError(t, mf.flamenco.CreateWorkerCluster(echo))
assertResponseJSON(t, echo, http.StatusOK, &apiCluster)
// Fetch the cluster
mf.persistence.EXPECT().FetchWorkerCluster(gomock.Any(), UUID).Return(&expectDBCluster, nil)
echo = mf.prepareMockedRequest(nil)
require.NoError(t, mf.flamenco.FetchWorkerCluster(echo, UUID))
assertResponseJSON(t, echo, http.StatusOK, &apiCluster)
// Update & save.
newUUID := "60442762-83d3-4fc3-bf75-6ab5799cdbaa"
newAPICluster := api.WorkerCluster{
Id: &newUUID, // Intentionally change the UUID. This should just be ignored.
Name: "updated name",
}
expectNewDBCluster := persistence.WorkerCluster{
UUID: UUID,
Name: newAPICluster.Name,
Description: "",
}
// TODO: expect SocketIO broadcast of the cluster update.
mf.persistence.EXPECT().FetchWorkerCluster(gomock.Any(), UUID).Return(&expectDBCluster, nil)
mf.persistence.EXPECT().SaveWorkerCluster(gomock.Any(), &expectNewDBCluster)
echo = mf.prepareMockedJSONRequest(newAPICluster)
require.NoError(t, mf.flamenco.UpdateWorkerCluster(echo, UUID))
assertResponseNoContent(t, echo)
// Delete.
mf.persistence.EXPECT().DeleteWorkerCluster(gomock.Any(), UUID)
// TODO: expect SocketIO broadcast of the cluster deletion.
echo = mf.prepareMockedJSONRequest(newAPICluster)
require.NoError(t, mf.flamenco.DeleteWorkerCluster(echo, UUID))
assertResponseNoContent(t, echo)
}

View File

@ -33,8 +33,12 @@ func (f *Flamenco) RegisterWorker(e echo.Context) error {
} }
// TODO: validate the request, should at least have non-empty name, secret, and platform. // TODO: validate the request, should at least have non-empty name, secret, and platform.
workerUUID := uuid.New()
logger.Info().Str("name", req.Name).Msg("registering new worker") logger = logger.With().
Str("name", req.Name).
Str("uuid", workerUUID).
Logger()
logger.Info().Msg("registering new worker")
hashedPassword, err := passwordHasher.GenerateHashedPassword([]byte(req.Secret)) hashedPassword, err := passwordHasher.GenerateHashedPassword([]byte(req.Secret))
if err != nil { if err != nil {
@ -43,7 +47,7 @@ func (f *Flamenco) RegisterWorker(e echo.Context) error {
} }
dbWorker := persistence.Worker{ dbWorker := persistence.Worker{
UUID: uuid.New(), UUID: workerUUID,
Name: req.Name, Name: req.Name,
Secret: string(hashedPassword), Secret: string(hashedPassword),
Platform: req.Platform, Platform: req.Platform,

View File

@ -25,9 +25,12 @@ import (
shaman_config "git.blender.org/flamenco/pkg/shaman/config" shaman_config "git.blender.org/flamenco/pkg/shaman/config"
) )
const ( // configFilename is used to specify where flamenco will write its config file.
configFilename = "flamenco-manager.yaml" // If the path is not absolute, it will use the flamenco binary location as the
// relative root path. This is not intended to be changed during runtime.
var configFilename = "flamenco-manager.yaml"
const (
latestConfigVersion = 3 latestConfigVersion = 3
// // relative to the Flamenco Server Base URL: // // relative to the Flamenco Server Base URL:

View File

@ -20,7 +20,9 @@ type Author struct {
} }
type AuthoredJob struct { type AuthoredJob struct {
JobID string JobID string
WorkerClusterUUID string
Name string Name string
JobType string JobType string
Priority int Priority int

View File

@ -127,6 +127,10 @@ func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJo
aj.Storage.ShamanCheckoutID = *sj.Storage.ShamanCheckoutId aj.Storage.ShamanCheckoutID = *sj.Storage.ShamanCheckoutId
} }
if sj.WorkerCluster != nil {
aj.WorkerClusterUUID = *sj.WorkerCluster
}
compiler, err := vm.getCompileJob() compiler, err := vm.getCompileJob()
if err != nil { if err != nil {
return nil, err return nil, err
@ -139,12 +143,13 @@ func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJo
Int("num_tasks", len(aj.Tasks)). Int("num_tasks", len(aj.Tasks)).
Str("name", aj.Name). Str("name", aj.Name).
Str("jobtype", aj.JobType). Str("jobtype", aj.JobType).
Str("job", aj.JobID).
Msg("job compiled") Msg("job compiled")
return &aj, nil return &aj, nil
} }
// ListJobTypes returns the list of available job types. // ListJobTypes returns the list of available job types.
func (s *Service) ListJobTypes() api.AvailableJobTypes { func (s *Service) ListJobTypes() api.AvailableJobTypes {
jobTypes := make([]api.AvailableJobType, 0) jobTypes := make([]api.AvailableJobType, 0)

View File

@ -45,11 +45,12 @@ func exampleSubmittedJob() api.SubmittedJob {
"user.name": "Sybren Stüvel", "user.name": "Sybren Stüvel",
}} }}
sj := api.SubmittedJob{ sj := api.SubmittedJob{
Name: "3Д рендеринг", Name: "3Д рендеринг",
Priority: 50, Priority: 50,
Type: "simple-blender-render", Type: "simple-blender-render",
Settings: &settings, Settings: &settings,
Metadata: &metadata, Metadata: &metadata,
WorkerCluster: ptr("acce9983-e663-4210-b3cc-f7bfa629cb21"),
} }
return sj return sj
} }
@ -79,6 +80,7 @@ func TestSimpleBlenderRenderHappy(t *testing.T) {
// Properties should be copied as-is. // Properties should be copied as-is.
assert.Equal(t, sj.Name, aj.Name) assert.Equal(t, sj.Name, aj.Name)
assert.Equal(t, *sj.WorkerCluster, aj.WorkerClusterUUID)
assert.Equal(t, sj.Type, aj.JobType) assert.Equal(t, sj.Type, aj.JobType)
assert.Equal(t, sj.Priority, aj.Priority) assert.Equal(t, sj.Priority, aj.Priority)
assert.EqualValues(t, sj.Settings.AdditionalProperties, aj.Settings) assert.EqualValues(t, sj.Settings.AdditionalProperties, aj.Settings)
@ -137,6 +139,35 @@ func TestSimpleBlenderRenderHappy(t *testing.T) {
assert.Equal(t, expectDeps, tVideo.Dependencies) assert.Equal(t, expectDeps, tVideo.Dependencies)
} }
func TestJobWithoutCluster(t *testing.T) {
c := mockedClock(t)
s, err := Load(c)
require.NoError(t, err)
// Compiling a job should be really fast.
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)
defer cancel()
sj := exampleSubmittedJob()
// Try with nil WorkerCluster.
{
sj.WorkerCluster = nil
aj, err := s.Compile(ctx, sj)
require.NoError(t, err)
assert.Zero(t, aj.WorkerClusterUUID)
}
// Try with empty WorkerCluster.
{
sj.WorkerCluster = ptr("")
aj, err := s.Compile(ctx, sj)
require.NoError(t, err)
assert.Zero(t, aj.WorkerClusterUUID)
}
}
func TestSimpleBlenderRenderWindowsPaths(t *testing.T) { func TestSimpleBlenderRenderWindowsPaths(t *testing.T) {
c := mockedClock(t) c := mockedClock(t)

View File

@ -16,6 +16,7 @@ func (db *DB) migrate() error {
&Task{}, &Task{},
&TaskFailure{}, &TaskFailure{},
&Worker{}, &Worker{},
&WorkerCluster{},
) )
if err != nil { if err != nil {
return fmt.Errorf("failed to automigrate database: %v", err) return fmt.Errorf("failed to automigrate database: %v", err)

View File

@ -9,9 +9,10 @@ import (
) )
var ( var (
ErrJobNotFound = PersistenceError{Message: "job not found", Err: gorm.ErrRecordNotFound} ErrJobNotFound = PersistenceError{Message: "job not found", Err: gorm.ErrRecordNotFound}
ErrTaskNotFound = PersistenceError{Message: "task not found", Err: gorm.ErrRecordNotFound} ErrTaskNotFound = PersistenceError{Message: "task not found", Err: gorm.ErrRecordNotFound}
ErrWorkerNotFound = PersistenceError{Message: "worker not found", Err: gorm.ErrRecordNotFound} ErrWorkerNotFound = PersistenceError{Message: "worker not found", Err: gorm.ErrRecordNotFound}
ErrWorkerClusterNotFound = PersistenceError{Message: "worker cluster not found", Err: gorm.ErrRecordNotFound}
) )
type PersistenceError struct { type PersistenceError struct {
@ -39,6 +40,10 @@ func workerError(errorToWrap error, message string, msgArgs ...interface{}) erro
return wrapError(translateGormWorkerError(errorToWrap), message, msgArgs...) return wrapError(translateGormWorkerError(errorToWrap), message, msgArgs...)
} }
func workerClusterError(errorToWrap error, message string, msgArgs ...interface{}) error {
return wrapError(translateGormWorkerClusterError(errorToWrap), message, msgArgs...)
}
func wrapError(errorToWrap error, message string, format ...interface{}) error { func wrapError(errorToWrap error, message string, format ...interface{}) error {
// Only format if there are arguments for formatting. // Only format if there are arguments for formatting.
var formattedMsg string var formattedMsg string
@ -80,3 +85,12 @@ func translateGormWorkerError(gormError error) error {
} }
return gormError return gormError
} }
// translateGormWorkerClusterError translates a Gorm error to a persistence layer error.
// This helps to keep Gorm as "implementation detail" of the persistence layer.
func translateGormWorkerClusterError(gormError error) error {
if errors.Is(gormError, gorm.ErrRecordNotFound) {
return ErrWorkerClusterNotFound
}
return gormError
}

View File

@ -35,6 +35,9 @@ type Job struct {
DeleteRequestedAt sql.NullTime DeleteRequestedAt sql.NullTime
Storage JobStorageInfo `gorm:"embedded;embeddedPrefix:storage_"` Storage JobStorageInfo `gorm:"embedded;embeddedPrefix:storage_"`
WorkerClusterID *uint
WorkerCluster *WorkerCluster `gorm:"foreignkey:WorkerClusterID;references:ID;constraint:OnDelete:SET NULL"`
} }
type StringInterfaceMap map[string]interface{} type StringInterfaceMap map[string]interface{}
@ -145,6 +148,16 @@ func (db *DB) StoreAuthoredJob(ctx context.Context, authoredJob job_compilers.Au
}, },
} }
// Find and assign the worker cluster.
if authoredJob.WorkerClusterUUID != "" {
dbCluster, err := fetchWorkerCluster(tx, authoredJob.WorkerClusterUUID)
if err != nil {
return err
}
dbJob.WorkerClusterID = &dbCluster.ID
dbJob.WorkerCluster = dbCluster
}
if err := tx.Create(&dbJob).Error; err != nil { if err := tx.Create(&dbJob).Error; err != nil {
return jobError(err, "storing job") return jobError(err, "storing job")
} }
@ -212,6 +225,7 @@ func (db *DB) FetchJob(ctx context.Context, jobUUID string) (*Job, error) {
dbJob := Job{} dbJob := Job{}
findResult := db.gormDB.WithContext(ctx). findResult := db.gormDB.WithContext(ctx).
Limit(1). Limit(1).
Preload("WorkerCluster").
Find(&dbJob, "uuid = ?", jobUUID) Find(&dbJob, "uuid = ?", jobUUID)
if findResult.Error != nil { if findResult.Error != nil {
return nil, jobError(findResult.Error, "fetching job") return nil, jobError(findResult.Error, "fetching job")

View File

@ -103,13 +103,27 @@ func (db *DB) WorkersLeftToRun(ctx context.Context, job *Job, taskType string) (
Where("JB.job_id = ?", job.ID). Where("JB.job_id = ?", job.ID).
Where("JB.task_type = ?", taskType) Where("JB.task_type = ?", taskType)
// Find the workers NOT blocked. query := db.gormDB.WithContext(ctx).
workers := []*Worker{}
tx := db.gormDB.WithContext(ctx).
Model(&Worker{}). Model(&Worker{}).
Select("uuid"). Select("uuid").
Where("id not in (?)", blockedWorkers). Where("id not in (?)", blockedWorkers)
Scan(&workers)
if job.WorkerClusterID != nil {
// Count workers not in any cluster + workers in the job's cluster.
clusterless := db.gormDB.
Table("worker_cluster_membership").
Select("worker_id")
jobCluster := db.gormDB.
Table("worker_cluster_membership").
Select("worker_id").
Where("worker_cluster_id = ?", *job.WorkerClusterID)
query = query.
Where("id not in (?) or id in (?)", clusterless, jobCluster)
}
// Find the workers NOT blocked.
workers := []*Worker{}
tx := query.Scan(&workers)
if tx.Error != nil { if tx.Error != nil {
return nil, tx.Error return nil, tx.Error
} }

View File

@ -4,6 +4,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) )
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
@ -160,6 +161,71 @@ func TestWorkersLeftToRun(t *testing.T) {
} }
} }
func TestWorkersLeftToRunWithClusters(t *testing.T) {
ctx, cancel, db := persistenceTestFixtures(t, schedulerTestTimeout)
defer cancel()
// Create clusters.
cluster1 := WorkerCluster{UUID: "11157623-4b14-4801-bee2-271dddab6309", Name: "Cluster 1"}
cluster2 := WorkerCluster{UUID: "22257623-4b14-4801-bee2-271dddab6309", Name: "Cluster 2"}
cluster3 := WorkerCluster{UUID: "33357623-4b14-4801-bee2-271dddab6309", Name: "Cluster 3"}
require.NoError(t, db.CreateWorkerCluster(ctx, &cluster1))
require.NoError(t, db.CreateWorkerCluster(ctx, &cluster2))
require.NoError(t, db.CreateWorkerCluster(ctx, &cluster3))
// Create a job in cluster1.
authoredJob := createTestAuthoredJobWithTasks()
authoredJob.WorkerClusterUUID = cluster1.UUID
job := persistAuthoredJob(t, ctx, db, authoredJob)
// Clusters 1 + 3
workerC13 := createWorker(ctx, t, db, func(w *Worker) {
w.UUID = "c13c1313-0000-1111-2222-333333333333"
w.Clusters = []*WorkerCluster{&cluster1, &cluster3}
})
// Cluster 1
workerC1 := createWorker(ctx, t, db, func(w *Worker) {
w.UUID = "c1c1c1c1-0000-1111-2222-333333333333"
w.Clusters = []*WorkerCluster{&cluster1}
})
// Cluster 2 worker, this one should never appear.
createWorker(ctx, t, db, func(w *Worker) {
w.UUID = "c2c2c2c2-0000-1111-2222-333333333333"
w.Clusters = []*WorkerCluster{&cluster2}
})
// No clusters, so should be able to run all.
workerCNone := createWorker(ctx, t, db, func(w *Worker) {
w.UUID = "00000000-0000-1111-2222-333333333333"
w.Clusters = nil
})
uuidMap := func(workers ...*Worker) map[string]bool {
theMap := map[string]bool{}
for _, worker := range workers {
theMap[worker.UUID] = true
}
return theMap
}
// All Cluster 1 workers + clusterless worker, no blocklist.
left, err := db.WorkersLeftToRun(ctx, job, "blender")
require.NoError(t, err)
assert.Equal(t, uuidMap(workerC13, workerC1, workerCNone), left)
// One worker blocked, two workers remain.
_ = db.AddWorkerToJobBlocklist(ctx, job, workerC1, "blender")
left, err = db.WorkersLeftToRun(ctx, job, "blender")
require.NoError(t, err)
assert.Equal(t, uuidMap(workerC13, workerCNone), left)
// All workers blocked.
_ = db.AddWorkerToJobBlocklist(ctx, job, workerC13, "blender")
_ = db.AddWorkerToJobBlocklist(ctx, job, workerCNone, "blender")
left, err = db.WorkersLeftToRun(ctx, job, "blender")
assert.NoError(t, err)
assert.Empty(t, left)
}
func TestCountTaskFailuresOfWorker(t *testing.T) { func TestCountTaskFailuresOfWorker(t *testing.T) {
ctx, close, db, dbJob, authoredJob := jobTasksTestFixtures(t) ctx, close, db, dbJob, authoredJob := jobTasksTestFixtures(t)
defer close() defer close()

View File

@ -64,6 +64,8 @@ func (db *DB) QueryJobs(ctx context.Context, apiQ api.JobsQuery) ([]*Job, error)
} }
} }
q.Preload("Cluster")
result := []*Job{} result := []*Job{}
tx := q.Scan(&result) tx := q.Scan(&result)
return result, tx.Error return result, tx.Error

View File

@ -676,7 +676,7 @@ func jobTasksTestFixtures(t *testing.T) (context.Context, context.CancelFunc, *D
return ctx, cancel, db, dbJob, authoredJob return ctx, cancel, db, dbJob, authoredJob
} }
func createWorker(ctx context.Context, t *testing.T, db *DB) *Worker { func createWorker(ctx context.Context, t *testing.T, db *DB, updaters ...func(*Worker)) *Worker {
w := Worker{ w := Worker{
UUID: "f0a123a9-ab05-4ce2-8577-94802cfe74a4", UUID: "f0a123a9-ab05-4ce2-8577-94802cfe74a4",
Name: "дрон", Name: "дрон",
@ -685,6 +685,11 @@ func createWorker(ctx context.Context, t *testing.T, db *DB) *Worker {
Software: "3.0", Software: "3.0",
Status: api.WorkerStatusAwake, Status: api.WorkerStatusAwake,
SupportedTaskTypes: "blender,ffmpeg,file-management", SupportedTaskTypes: "blender,ffmpeg,file-management",
Clusters: nil,
}
for _, updater := range updaters {
updater(&w)
} }
err := db.CreateWorker(ctx, &w) err := db.CreateWorker(ctx, &w)

View File

@ -26,13 +26,18 @@ func (db *DB) ScheduleTask(ctx context.Context, w *Worker) (*Task, error) {
logger := log.With().Str("worker", w.UUID).Logger() logger := log.With().Str("worker", w.UUID).Logger()
logger.Trace().Msg("finding task for worker") logger.Trace().Msg("finding task for worker")
hasWorkerClusters, err := db.HasWorkerClusters(ctx)
if err != nil {
return nil, err
}
// Run two queries in one transaction: // Run two queries in one transaction:
// 1. find task, and // 1. find task, and
// 2. assign the task to the worker. // 2. assign the task to the worker.
var task *Task var task *Task
txErr := db.gormDB.WithContext(ctx).Transaction(func(tx *gorm.DB) error { txErr := db.gormDB.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
var err error var err error
task, err = findTaskForWorker(tx, w) task, err = findTaskForWorker(tx, w, hasWorkerClusters)
if err != nil { if err != nil {
if isDatabaseBusyError(err) { if isDatabaseBusyError(err) {
logger.Trace().Err(err).Msg("database busy while finding task for worker") logger.Trace().Err(err).Msg("database busy while finding task for worker")
@ -79,7 +84,7 @@ func (db *DB) ScheduleTask(ctx context.Context, w *Worker) (*Task, error) {
return task, nil return task, nil
} }
func findTaskForWorker(tx *gorm.DB, w *Worker) (*Task, error) { func findTaskForWorker(tx *gorm.DB, w *Worker, checkWorkerClusters bool) (*Task, error) {
task := Task{} task := Task{}
// If a task is alreay active & assigned to this worker, return just that. // If a task is alreay active & assigned to this worker, return just that.
@ -114,18 +119,37 @@ func findTaskForWorker(tx *gorm.DB, w *Worker) (*Task, error) {
// a 'schedulable' status might have been assigned to a worker, representing // a 'schedulable' status might have been assigned to a worker, representing
// the last worker to touch it -- it's not meant to indicate "ownership" of // the last worker to touch it -- it's not meant to indicate "ownership" of
// the task. // the task.
findTaskResult := tx. findTaskQuery := tx.Model(&task).
Model(&task).
Joins("left join jobs on tasks.job_id = jobs.id"). Joins("left join jobs on tasks.job_id = jobs.id").
Joins("left join task_failures TF on tasks.id = TF.task_id and TF.worker_id=?", w.ID). Joins("left join task_failures TF on tasks.id = TF.task_id and TF.worker_id=?", w.ID).
Where("tasks.status in ?", schedulableTaskStatuses). // Schedulable task statuses Where("tasks.status in ?", schedulableTaskStatuses). // Schedulable task statuses
Where("jobs.status in ?", schedulableJobStatuses). // Schedulable job statuses Where("jobs.status in ?", schedulableJobStatuses). // Schedulable job statuses
Where("tasks.type in ?", w.TaskTypes()). // Supported task types Where("tasks.type in ?", w.TaskTypes()). // Supported task types
Where("tasks.id not in (?)", incompleteDepsQuery). // Dependencies completed Where("tasks.id not in (?)", incompleteDepsQuery). // Dependencies completed
Where("TF.worker_id is NULL"). // Not failed before Where("TF.worker_id is NULL"). // Not failed before
Where("tasks.type not in (?)", blockedTaskTypesQuery). // Non-blocklisted Where("tasks.type not in (?)", blockedTaskTypesQuery) // Non-blocklisted
Order("jobs.priority desc"). // Highest job priority
Order("tasks.priority desc"). // Highest task priority if checkWorkerClusters {
// The system has one or more clusters, so limit the available jobs to those
// that have no cluster, or overlap with the Worker's clusters.
if len(w.Clusters) == 0 {
// Clusterless workers only get clusterless jobs.
findTaskQuery = findTaskQuery.
Where("jobs.worker_cluster_id is NULL")
} else {
// Clustered workers get clusterless jobs AND jobs of their own clusters.
clusterIDs := []uint{}
for _, cluster := range w.Clusters {
clusterIDs = append(clusterIDs, cluster.ID)
}
findTaskQuery = findTaskQuery.
Where("jobs.worker_cluster_id is NULL or worker_cluster_id in ?", clusterIDs)
}
}
findTaskResult := findTaskQuery.
Order("jobs.priority desc"). // Highest job priority
Order("tasks.priority desc"). // Highest task priority
Limit(1). Limit(1).
Preload("Job"). Preload("Job").
Find(&task) Find(&task)

View File

@ -8,6 +8,7 @@ import (
"time" "time"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"git.blender.org/flamenco/internal/manager/job_compilers" "git.blender.org/flamenco/internal/manager/job_compilers"
"git.blender.org/flamenco/internal/uuid" "git.blender.org/flamenco/internal/uuid"
@ -289,6 +290,90 @@ func TestPreviouslyFailed(t *testing.T) {
assert.Equal(t, att2.Name, task.Name, "the second task should have been chosen") assert.Equal(t, att2.Name, task.Name, "the second task should have been chosen")
} }
func TestWorkerClusterJobWithCluster(t *testing.T) {
ctx, cancel, db := persistenceTestFixtures(t, schedulerTestTimeout)
defer cancel()
// Create worker clusters:
cluster1 := WorkerCluster{UUID: "f0157623-4b14-4801-bee2-271dddab6309", Name: "Cluster 1"}
cluster2 := WorkerCluster{UUID: "2f71dba1-cf92-4752-8386-f5926affabd5", Name: "Cluster 2"}
require.NoError(t, db.CreateWorkerCluster(ctx, &cluster1))
require.NoError(t, db.CreateWorkerCluster(ctx, &cluster2))
// Create a worker in cluster1:
workerC := linuxWorker(t, db, func(w *Worker) {
w.Clusters = []*WorkerCluster{&cluster1}
})
// Create a worker without cluster:
workerNC := linuxWorker(t, db, func(w *Worker) {
w.UUID = "c53f8f68-4149-4790-991c-ba73a326551e"
w.Clusters = nil
})
{ // Test job with different cluster:
authTask := authorTestTask("the task", "blender")
job := authorTestJob("499cf0f8-e83d-4cb1-837a-df94789d07db", "simple-blender-render", authTask)
job.WorkerClusterUUID = cluster2.UUID
constructTestJob(ctx, t, db, job)
task, err := db.ScheduleTask(ctx, &workerC)
require.NoError(t, err)
assert.Nil(t, task, "job with different cluster should not be scheduled")
}
{ // Test job with matching cluster:
authTask := authorTestTask("the task", "blender")
job := authorTestJob("5d4c2321-0bb7-4c13-a9dd-32a2c0cd156e", "simple-blender-render", authTask)
job.WorkerClusterUUID = cluster1.UUID
constructTestJob(ctx, t, db, job)
task, err := db.ScheduleTask(ctx, &workerC)
require.NoError(t, err)
require.NotNil(t, task, "job with matching cluster should be scheduled")
assert.Equal(t, authTask.UUID, task.UUID)
task, err = db.ScheduleTask(ctx, &workerNC)
require.NoError(t, err)
assert.Nil(t, task, "job with cluster should not be scheduled for worker without cluster")
}
}
func TestWorkerClusterJobWithoutCluster(t *testing.T) {
ctx, cancel, db := persistenceTestFixtures(t, schedulerTestTimeout)
defer cancel()
// Create worker cluster:
cluster1 := WorkerCluster{UUID: "f0157623-4b14-4801-bee2-271dddab6309", Name: "Cluster 1"}
require.NoError(t, db.CreateWorkerCluster(ctx, &cluster1))
// Create a worker in cluster1:
workerC := linuxWorker(t, db, func(w *Worker) {
w.Clusters = []*WorkerCluster{&cluster1}
})
// Create a worker without cluster:
workerNC := linuxWorker(t, db, func(w *Worker) {
w.UUID = "c53f8f68-4149-4790-991c-ba73a326551e"
w.Clusters = nil
})
// Test cluster-less job:
authTask := authorTestTask("the task", "blender")
job := authorTestJob("b6a1d859-122f-4791-8b78-b943329a9989", "simple-blender-render", authTask)
constructTestJob(ctx, t, db, job)
task, err := db.ScheduleTask(ctx, &workerC)
require.NoError(t, err)
require.NotNil(t, task, "job without cluster should always be scheduled to worker in some cluster")
assert.Equal(t, authTask.UUID, task.UUID)
task, err = db.ScheduleTask(ctx, &workerNC)
require.NoError(t, err)
require.NotNil(t, task, "job without cluster should always be scheduled to worker without cluster")
assert.Equal(t, authTask.UUID, task.UUID)
}
func TestBlocklisted(t *testing.T) { func TestBlocklisted(t *testing.T) {
ctx, cancel, db := persistenceTestFixtures(t, schedulerTestTimeout) ctx, cancel, db := persistenceTestFixtures(t, schedulerTestTimeout)
defer cancel() defer cancel()
@ -383,7 +468,7 @@ func setTaskStatus(t *testing.T, db *DB, taskUUID string, status api.TaskStatus)
} }
} }
func linuxWorker(t *testing.T, db *DB) Worker { func linuxWorker(t *testing.T, db *DB, updaters ...func(worker *Worker)) Worker {
w := Worker{ w := Worker{
UUID: "b13b8322-3e96-41c3-940a-3d581008a5f8", UUID: "b13b8322-3e96-41c3-940a-3d581008a5f8",
Name: "Linux", Name: "Linux",
@ -392,6 +477,10 @@ func linuxWorker(t *testing.T, db *DB) Worker {
SupportedTaskTypes: "blender,ffmpeg,file-management,misc", SupportedTaskTypes: "blender,ffmpeg,file-management,misc",
} }
for _, updater := range updaters {
updater(&w)
}
err := db.gormDB.Save(&w).Error err := db.gormDB.Save(&w).Error
if err != nil { if err != nil {
t.Logf("cannot save Linux worker: %v", err) t.Logf("cannot save Linux worker: %v", err)

View File

@ -10,9 +10,12 @@ import (
"testing" "testing"
"time" "time"
"git.blender.org/flamenco/internal/uuid"
"git.blender.org/flamenco/pkg/api"
"github.com/glebarez/sqlite" "github.com/glebarez/sqlite"
"github.com/rs/zerolog" "github.com/rs/zerolog"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/stretchr/testify/require"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -87,3 +90,44 @@ func persistenceTestFixtures(t *testing.T, testContextTimeout time.Duration) (co
return ctx, cancel, db return ctx, cancel, db
} }
type WorkerTestFixture struct {
db *DB
ctx context.Context
done func()
worker *Worker
cluster *WorkerCluster
}
func workerTestFixtures(t *testing.T, testContextTimeout time.Duration) WorkerTestFixture {
ctx, cancel, db := persistenceTestFixtures(t, testContextTimeout)
w := Worker{
UUID: uuid.New(),
Name: "дрон",
Address: "fe80::5054:ff:fede:2ad7",
Platform: "linux",
Software: "3.0",
Status: api.WorkerStatusAwake,
SupportedTaskTypes: "blender,ffmpeg,file-management",
}
wc := WorkerCluster{
UUID: uuid.New(),
Name: "arbejdsklynge",
Description: "Worker cluster in Danish",
}
require.NoError(t, db.CreateWorker(ctx, &w))
require.NoError(t, db.CreateWorkerCluster(ctx, &wc))
return WorkerTestFixture{
db: db,
ctx: ctx,
done: cancel,
worker: &w,
cluster: &wc,
}
}

View File

@ -47,7 +47,7 @@ func TestFetchTimedOutTasks(t *testing.T) {
// tests that the expected task is returned. // tests that the expected task is returned.
assert.Equal(t, task.UUID, timedout[0].UUID) assert.Equal(t, task.UUID, timedout[0].UUID)
assert.Equal(t, job, timedout[0].Job, "the job should be included in the result as well") assert.Equal(t, job, timedout[0].Job, "the job should be included in the result as well")
assert.Equal(t, w, timedout[0].Worker, "the worker should be included in the result as well") assert.Equal(t, w.UUID, timedout[0].Worker.UUID, "the worker should be included in the result as well")
} }
} }

View File

@ -0,0 +1,112 @@
package persistence
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"context"
"fmt"
"gorm.io/gorm"
)
type WorkerCluster struct {
Model
UUID string `gorm:"type:char(36);default:'';unique;index"`
Name string `gorm:"type:varchar(64);default:'';unique"`
Description string `gorm:"type:varchar(255);default:''"`
Workers []*Worker `gorm:"many2many:worker_cluster_membership;constraint:OnDelete:CASCADE"`
}
func (db *DB) CreateWorkerCluster(ctx context.Context, wc *WorkerCluster) error {
if err := db.gormDB.WithContext(ctx).Create(wc).Error; err != nil {
return fmt.Errorf("creating new worker cluster: %w", err)
}
return nil
}
// HasWorkerClusters returns whether there are any clusters defined at all.
func (db *DB) HasWorkerClusters(ctx context.Context) (bool, error) {
var count int64
tx := db.gormDB.WithContext(ctx).
Model(&WorkerCluster{}).
Count(&count)
if err := tx.Error; err != nil {
return false, workerClusterError(err, "counting worker clusters")
}
return count > 0, nil
}
func (db *DB) FetchWorkerCluster(ctx context.Context, uuid string) (*WorkerCluster, error) {
tx := db.gormDB.WithContext(ctx)
return fetchWorkerCluster(tx, uuid)
}
// fetchWorkerCluster fetches the worker cluster using the given database instance.
func fetchWorkerCluster(gormDB *gorm.DB, uuid string) (*WorkerCluster, error) {
w := WorkerCluster{}
tx := gormDB.First(&w, "uuid = ?", uuid)
if tx.Error != nil {
return nil, workerClusterError(tx.Error, "fetching worker cluster")
}
return &w, nil
}
func (db *DB) SaveWorkerCluster(ctx context.Context, cluster *WorkerCluster) error {
if err := db.gormDB.WithContext(ctx).Save(cluster).Error; err != nil {
return workerClusterError(err, "saving worker cluster")
}
return nil
}
// DeleteWorkerCluster deletes the given cluster, after unassigning all workers from it.
func (db *DB) DeleteWorkerCluster(ctx context.Context, uuid string) error {
tx := db.gormDB.WithContext(ctx).
Where("uuid = ?", uuid).
Delete(&WorkerCluster{})
if tx.Error != nil {
return workerClusterError(tx.Error, "deleting worker cluster")
}
if tx.RowsAffected == 0 {
return ErrWorkerClusterNotFound
}
return nil
}
func (db *DB) FetchWorkerClusters(ctx context.Context) ([]*WorkerCluster, error) {
clusters := make([]*WorkerCluster, 0)
tx := db.gormDB.WithContext(ctx).Model(&WorkerCluster{}).Scan(&clusters)
if tx.Error != nil {
return nil, workerClusterError(tx.Error, "fetching all worker clusters")
}
return clusters, nil
}
func (db *DB) fetchWorkerClustersWithUUID(ctx context.Context, clusterUUIDs []string) ([]*WorkerCluster, error) {
clusters := make([]*WorkerCluster, 0)
tx := db.gormDB.WithContext(ctx).
Model(&WorkerCluster{}).
Where("uuid in ?", clusterUUIDs).
Scan(&clusters)
if tx.Error != nil {
return nil, workerClusterError(tx.Error, "fetching all worker clusters")
}
return clusters, nil
}
func (db *DB) WorkerSetClusters(ctx context.Context, worker *Worker, clusterUUIDs []string) error {
clusters, err := db.fetchWorkerClustersWithUUID(ctx, clusterUUIDs)
if err != nil {
return workerClusterError(err, "fetching worker clusters")
}
err = db.gormDB.WithContext(ctx).
Model(worker).
Association("Clusters").
Replace(clusters)
if err != nil {
return workerClusterError(err, "updating worker clusters")
}
return nil
}

View File

@ -0,0 +1,165 @@
package persistence
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"testing"
"time"
"git.blender.org/flamenco/internal/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestCreateFetchCluster(t *testing.T) {
f := workerTestFixtures(t, 1*time.Second)
defer f.done()
// Test fetching non-existent cluster
fetchedCluster, err := f.db.FetchWorkerCluster(f.ctx, "7ee21bc8-ff1a-42d2-a6b6-cc4b529b189f")
assert.ErrorIs(t, err, ErrWorkerClusterNotFound)
assert.Nil(t, fetchedCluster)
// New cluster creation is already done in the workerTestFixtures() call.
assert.NotNil(t, f.cluster)
fetchedCluster, err = f.db.FetchWorkerCluster(f.ctx, f.cluster.UUID)
require.NoError(t, err)
assert.NotNil(t, fetchedCluster)
// Test contents of fetched cluster.
assert.Equal(t, f.cluster.UUID, fetchedCluster.UUID)
assert.Equal(t, f.cluster.Name, fetchedCluster.Name)
assert.Equal(t, f.cluster.Description, fetchedCluster.Description)
assert.Zero(t, fetchedCluster.Workers)
}
func TestFetchDeleteClusters(t *testing.T) {
f := workerTestFixtures(t, 1*time.Second)
defer f.done()
// Single cluster was created by fixture.
has, err := f.db.HasWorkerClusters(f.ctx)
require.NoError(t, err)
assert.True(t, has, "expecting HasWorkerClusters to return true")
secondCluster := WorkerCluster{
UUID: uuid.New(),
Name: "arbeiderscluster",
Description: "Worker cluster in Dutch",
}
require.NoError(t, f.db.CreateWorkerCluster(f.ctx, &secondCluster))
allClusters, err := f.db.FetchWorkerClusters(f.ctx)
require.NoError(t, err)
require.Len(t, allClusters, 2)
var allClusterIDs [2]string
for idx := range allClusters {
allClusterIDs[idx] = allClusters[idx].UUID
}
assert.Contains(t, allClusterIDs, f.cluster.UUID)
assert.Contains(t, allClusterIDs, secondCluster.UUID)
has, err = f.db.HasWorkerClusters(f.ctx)
require.NoError(t, err)
assert.True(t, has, "expecting HasWorkerClusters to return true")
// Test deleting the 2nd cluster.
require.NoError(t, f.db.DeleteWorkerCluster(f.ctx, secondCluster.UUID))
allClusters, err = f.db.FetchWorkerClusters(f.ctx)
require.NoError(t, err)
require.Len(t, allClusters, 1)
assert.Equal(t, f.cluster.UUID, allClusters[0].UUID)
// Test deleting the 1st cluster.
require.NoError(t, f.db.DeleteWorkerCluster(f.ctx, f.cluster.UUID))
has, err = f.db.HasWorkerClusters(f.ctx)
require.NoError(t, err)
assert.False(t, has, "expecting HasWorkerClusters to return false")
}
func TestAssignUnassignWorkerClusters(t *testing.T) {
f := workerTestFixtures(t, 1*time.Second)
defer f.done()
assertClusters := func(msgLabel string, clusterUUIDs ...string) {
w, err := f.db.FetchWorker(f.ctx, f.worker.UUID)
require.NoError(t, err)
// Catch doubly-reported clusters, as the maps below would hide those cases.
assert.Len(t, w.Clusters, len(clusterUUIDs), msgLabel)
expectClusters := make(map[string]bool)
for _, cid := range clusterUUIDs {
expectClusters[cid] = true
}
actualClusters := make(map[string]bool)
for _, c := range w.Clusters {
actualClusters[c.UUID] = true
}
assert.Equal(t, expectClusters, actualClusters, msgLabel)
}
secondCluster := WorkerCluster{
UUID: uuid.New(),
Name: "arbeiderscluster",
Description: "Worker cluster in Dutch",
}
require.NoError(t, f.db.CreateWorkerCluster(f.ctx, &secondCluster))
// By default the Worker should not be part of a cluster.
assertClusters("default cluster assignment")
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{f.cluster.UUID}))
assertClusters("setting one cluster", f.cluster.UUID)
// Double assignments should also just work.
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{f.cluster.UUID, f.cluster.UUID}))
assertClusters("setting twice the same cluster", f.cluster.UUID)
// Multiple cluster memberships.
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{f.cluster.UUID, secondCluster.UUID}))
assertClusters("setting two different clusters", f.cluster.UUID, secondCluster.UUID)
// Remove memberships.
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{secondCluster.UUID}))
assertClusters("unassigning from first cluster", secondCluster.UUID)
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{}))
assertClusters("unassigning from second cluster")
}
func TestSaveWorkerCluster(t *testing.T) {
f := workerTestFixtures(t, 1*time.Second)
defer f.done()
f.cluster.Name = "übercluster"
f.cluster.Description = "ʻO kēlā hui ma laila"
require.NoError(t, f.db.SaveWorkerCluster(f.ctx, f.cluster))
fetched, err := f.db.FetchWorkerCluster(f.ctx, f.cluster.UUID)
require.NoError(t, err)
assert.Equal(t, f.cluster.Name, fetched.Name)
assert.Equal(t, f.cluster.Description, fetched.Description)
}
func TestDeleteWorkerClusterWithWorkersAssigned(t *testing.T) {
f := workerTestFixtures(t, 1*time.Second)
defer f.done()
// Assign the worker.
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{f.cluster.UUID}))
// Delete the cluster.
require.NoError(t, f.db.DeleteWorkerCluster(f.ctx, f.cluster.UUID))
// Check the Worker has been unassigned from the cluster.
w, err := f.db.FetchWorker(f.ctx, f.worker.UUID)
require.NoError(t, err)
assert.Empty(t, w.Clusters)
}

View File

@ -30,6 +30,8 @@ type Worker struct {
LazyStatusRequest bool `gorm:"type:smallint;default:0"` LazyStatusRequest bool `gorm:"type:smallint;default:0"`
SupportedTaskTypes string `gorm:"type:varchar(255);default:''"` // comma-separated list of task types. SupportedTaskTypes string `gorm:"type:varchar(255);default:''"` // comma-separated list of task types.
Clusters []*WorkerCluster `gorm:"many2many:worker_cluster_membership;constraint:OnDelete:CASCADE"`
} }
func (w *Worker) Identifier() string { func (w *Worker) Identifier() string {
@ -71,6 +73,7 @@ func (db *DB) CreateWorker(ctx context.Context, w *Worker) error {
func (db *DB) FetchWorker(ctx context.Context, uuid string) (*Worker, error) { func (db *DB) FetchWorker(ctx context.Context, uuid string) (*Worker, error) {
w := Worker{} w := Worker{}
tx := db.gormDB.WithContext(ctx). tx := db.gormDB.WithContext(ctx).
Preload("Clusters").
First(&w, "uuid = ?", uuid) First(&w, "uuid = ?", uuid)
if tx.Error != nil { if tx.Error != nil {
return nil, workerError(tx.Error, "fetching worker") return nil, workerError(tx.Error, "fetching worker")

View File

@ -8,6 +8,7 @@ import (
"time" "time"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"git.blender.org/flamenco/internal/uuid" "git.blender.org/flamenco/internal/uuid"
"git.blender.org/flamenco/pkg/api" "git.blender.org/flamenco/pkg/api"
@ -317,3 +318,19 @@ func TestDeleteWorker(t *testing.T) {
assert.True(t, fetchedTask.Worker.DeletedAt.Valid) assert.True(t, fetchedTask.Worker.DeletedAt.Valid)
} }
} }
func TestDeleteWorkerWithClusterAssigned(t *testing.T) {
f := workerTestFixtures(t, 1*time.Second)
defer f.done()
// Assign the worker.
require.NoError(t, f.db.WorkerSetClusters(f.ctx, f.worker, []string{f.cluster.UUID}))
// Delete the Worker.
require.NoError(t, f.db.DeleteWorker(f.ctx, f.worker.UUID))
// Check the Worker has been unassigned from the cluster.
cluster, err := f.db.FetchWorkerCluster(f.ctx, f.cluster.UUID)
require.NoError(t, err)
assert.Empty(t, cluster.Workers)
}

View File

@ -32,6 +32,8 @@ func NewWorkerUpdate(worker *persistence.Worker) api.SocketIOWorkerUpdate {
workerUpdate.LastSeen = &worker.LastSeenAt workerUpdate.LastSeen = &worker.LastSeenAt
} }
// TODO: add cluster IDs.
return workerUpdate return workerUpdate
} }

View File

@ -22,7 +22,11 @@ var (
errURLWithoutHostName = errors.New("manager URL should contain a host name") errURLWithoutHostName = errors.New("manager URL should contain a host name")
) )
const ( var (
// config- and credentialsFilename are used to specify where flamenco will
// write its config/credentials file. If the path is not absolute, it will
// use the flamenco binary location as the relative root path. These are not
// intended to be changed during runtime.
credentialsFilename = "flamenco-worker-credentials.yaml" credentialsFilename = "flamenco-worker-credentials.yaml"
configFilename = "flamenco-worker.yaml" configFilename = "flamenco-worker.yaml"
) )

View File

@ -116,6 +116,46 @@ func (mr *MockFlamencoClientMockRecorder) CheckSharedStoragePathWithResponse(arg
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckSharedStoragePathWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).CheckSharedStoragePathWithResponse), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckSharedStoragePathWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).CheckSharedStoragePathWithResponse), varargs...)
} }
// CreateWorkerClusterWithBodyWithResponse mocks base method.
func (m *MockFlamencoClient) CreateWorkerClusterWithBodyWithResponse(arg0 context.Context, arg1 string, arg2 io.Reader, arg3 ...api.RequestEditorFn) (*api.CreateWorkerClusterResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CreateWorkerClusterWithBodyWithResponse", varargs...)
ret0, _ := ret[0].(*api.CreateWorkerClusterResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateWorkerClusterWithBodyWithResponse indicates an expected call of CreateWorkerClusterWithBodyWithResponse.
func (mr *MockFlamencoClientMockRecorder) CreateWorkerClusterWithBodyWithResponse(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkerClusterWithBodyWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).CreateWorkerClusterWithBodyWithResponse), varargs...)
}
// CreateWorkerClusterWithResponse mocks base method.
func (m *MockFlamencoClient) CreateWorkerClusterWithResponse(arg0 context.Context, arg1 api.CreateWorkerClusterJSONRequestBody, arg2 ...api.RequestEditorFn) (*api.CreateWorkerClusterResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CreateWorkerClusterWithResponse", varargs...)
ret0, _ := ret[0].(*api.CreateWorkerClusterResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateWorkerClusterWithResponse indicates an expected call of CreateWorkerClusterWithResponse.
func (mr *MockFlamencoClientMockRecorder) CreateWorkerClusterWithResponse(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkerClusterWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).CreateWorkerClusterWithResponse), varargs...)
}
// DeleteJobWhatWouldItDoWithResponse mocks base method. // DeleteJobWhatWouldItDoWithResponse mocks base method.
func (m *MockFlamencoClient) DeleteJobWhatWouldItDoWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.DeleteJobWhatWouldItDoResponse, error) { func (m *MockFlamencoClient) DeleteJobWhatWouldItDoWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.DeleteJobWhatWouldItDoResponse, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -156,6 +196,26 @@ func (mr *MockFlamencoClientMockRecorder) DeleteJobWithResponse(arg0, arg1 inter
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteJobWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).DeleteJobWithResponse), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteJobWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).DeleteJobWithResponse), varargs...)
} }
// DeleteWorkerClusterWithResponse mocks base method.
func (m *MockFlamencoClient) DeleteWorkerClusterWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.DeleteWorkerClusterResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DeleteWorkerClusterWithResponse", varargs...)
ret0, _ := ret[0].(*api.DeleteWorkerClusterResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteWorkerClusterWithResponse indicates an expected call of DeleteWorkerClusterWithResponse.
func (mr *MockFlamencoClientMockRecorder) DeleteWorkerClusterWithResponse(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkerClusterWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).DeleteWorkerClusterWithResponse), varargs...)
}
// DeleteWorkerWithResponse mocks base method. // DeleteWorkerWithResponse mocks base method.
func (m *MockFlamencoClient) DeleteWorkerWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.DeleteWorkerResponse, error) { func (m *MockFlamencoClient) DeleteWorkerWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.DeleteWorkerResponse, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -336,6 +396,46 @@ func (mr *MockFlamencoClientMockRecorder) FetchTaskWithResponse(arg0, arg1 inter
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchTaskWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).FetchTaskWithResponse), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchTaskWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).FetchTaskWithResponse), varargs...)
} }
// FetchWorkerClusterWithResponse mocks base method.
func (m *MockFlamencoClient) FetchWorkerClusterWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.FetchWorkerClusterResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "FetchWorkerClusterWithResponse", varargs...)
ret0, _ := ret[0].(*api.FetchWorkerClusterResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FetchWorkerClusterWithResponse indicates an expected call of FetchWorkerClusterWithResponse.
func (mr *MockFlamencoClientMockRecorder) FetchWorkerClusterWithResponse(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchWorkerClusterWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).FetchWorkerClusterWithResponse), varargs...)
}
// FetchWorkerClustersWithResponse mocks base method.
func (m *MockFlamencoClient) FetchWorkerClustersWithResponse(arg0 context.Context, arg1 ...api.RequestEditorFn) (*api.FetchWorkerClustersResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "FetchWorkerClustersWithResponse", varargs...)
ret0, _ := ret[0].(*api.FetchWorkerClustersResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FetchWorkerClustersWithResponse indicates an expected call of FetchWorkerClustersWithResponse.
func (mr *MockFlamencoClientMockRecorder) FetchWorkerClustersWithResponse(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchWorkerClustersWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).FetchWorkerClustersWithResponse), varargs...)
}
// FetchWorkerSleepScheduleWithResponse mocks base method. // FetchWorkerSleepScheduleWithResponse mocks base method.
func (m *MockFlamencoClient) FetchWorkerSleepScheduleWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.FetchWorkerSleepScheduleResponse, error) { func (m *MockFlamencoClient) FetchWorkerSleepScheduleWithResponse(arg0 context.Context, arg1 string, arg2 ...api.RequestEditorFn) (*api.FetchWorkerSleepScheduleResponse, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -916,6 +1016,46 @@ func (mr *MockFlamencoClientMockRecorder) SetTaskStatusWithResponse(arg0, arg1,
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTaskStatusWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).SetTaskStatusWithResponse), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTaskStatusWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).SetTaskStatusWithResponse), varargs...)
} }
// SetWorkerClustersWithBodyWithResponse mocks base method.
func (m *MockFlamencoClient) SetWorkerClustersWithBodyWithResponse(arg0 context.Context, arg1, arg2 string, arg3 io.Reader, arg4 ...api.RequestEditorFn) (*api.SetWorkerClustersResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1, arg2, arg3}
for _, a := range arg4 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SetWorkerClustersWithBodyWithResponse", varargs...)
ret0, _ := ret[0].(*api.SetWorkerClustersResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SetWorkerClustersWithBodyWithResponse indicates an expected call of SetWorkerClustersWithBodyWithResponse.
func (mr *MockFlamencoClientMockRecorder) SetWorkerClustersWithBodyWithResponse(arg0, arg1, arg2, arg3 interface{}, arg4 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1, arg2, arg3}, arg4...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWorkerClustersWithBodyWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).SetWorkerClustersWithBodyWithResponse), varargs...)
}
// SetWorkerClustersWithResponse mocks base method.
func (m *MockFlamencoClient) SetWorkerClustersWithResponse(arg0 context.Context, arg1 string, arg2 api.SetWorkerClustersJSONRequestBody, arg3 ...api.RequestEditorFn) (*api.SetWorkerClustersResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SetWorkerClustersWithResponse", varargs...)
ret0, _ := ret[0].(*api.SetWorkerClustersResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SetWorkerClustersWithResponse indicates an expected call of SetWorkerClustersWithResponse.
func (mr *MockFlamencoClientMockRecorder) SetWorkerClustersWithResponse(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWorkerClustersWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).SetWorkerClustersWithResponse), varargs...)
}
// SetWorkerSleepScheduleWithBodyWithResponse mocks base method. // SetWorkerSleepScheduleWithBodyWithResponse mocks base method.
func (m *MockFlamencoClient) SetWorkerSleepScheduleWithBodyWithResponse(arg0 context.Context, arg1, arg2 string, arg3 io.Reader, arg4 ...api.RequestEditorFn) (*api.SetWorkerSleepScheduleResponse, error) { func (m *MockFlamencoClient) SetWorkerSleepScheduleWithBodyWithResponse(arg0 context.Context, arg1, arg2 string, arg3 io.Reader, arg4 ...api.RequestEditorFn) (*api.SetWorkerSleepScheduleResponse, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -1276,6 +1416,46 @@ func (mr *MockFlamencoClientMockRecorder) TaskUpdateWithResponse(arg0, arg1, arg
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaskUpdateWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).TaskUpdateWithResponse), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaskUpdateWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).TaskUpdateWithResponse), varargs...)
} }
// UpdateWorkerClusterWithBodyWithResponse mocks base method.
func (m *MockFlamencoClient) UpdateWorkerClusterWithBodyWithResponse(arg0 context.Context, arg1, arg2 string, arg3 io.Reader, arg4 ...api.RequestEditorFn) (*api.UpdateWorkerClusterResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1, arg2, arg3}
for _, a := range arg4 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateWorkerClusterWithBodyWithResponse", varargs...)
ret0, _ := ret[0].(*api.UpdateWorkerClusterResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateWorkerClusterWithBodyWithResponse indicates an expected call of UpdateWorkerClusterWithBodyWithResponse.
func (mr *MockFlamencoClientMockRecorder) UpdateWorkerClusterWithBodyWithResponse(arg0, arg1, arg2, arg3 interface{}, arg4 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1, arg2, arg3}, arg4...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkerClusterWithBodyWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).UpdateWorkerClusterWithBodyWithResponse), varargs...)
}
// UpdateWorkerClusterWithResponse mocks base method.
func (m *MockFlamencoClient) UpdateWorkerClusterWithResponse(arg0 context.Context, arg1 string, arg2 api.UpdateWorkerClusterJSONRequestBody, arg3 ...api.RequestEditorFn) (*api.UpdateWorkerClusterResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateWorkerClusterWithResponse", varargs...)
ret0, _ := ret[0].(*api.UpdateWorkerClusterResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateWorkerClusterWithResponse indicates an expected call of UpdateWorkerClusterWithResponse.
func (mr *MockFlamencoClientMockRecorder) UpdateWorkerClusterWithResponse(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkerClusterWithResponse", reflect.TypeOf((*MockFlamencoClient)(nil).UpdateWorkerClusterWithResponse), varargs...)
}
// WorkerStateChangedWithBodyWithResponse mocks base method. // WorkerStateChangedWithBodyWithResponse mocks base method.
func (m *MockFlamencoClient) WorkerStateChangedWithBodyWithResponse(arg0 context.Context, arg1 string, arg2 io.Reader, arg3 ...api.RequestEditorFn) (*api.WorkerStateChangedResponse, error) { func (m *MockFlamencoClient) WorkerStateChangedWithBodyWithResponse(arg0 context.Context, arg1 string, arg2 io.Reader, arg3 ...api.RequestEditorFn) (*api.WorkerStateChangedResponse, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()

View File

@ -534,6 +534,33 @@ paths:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/api/v3/worker-mgt/workers/{worker_id}/setclusters:
summary: Update the cluster membership of this Worker.
post:
operationId: setWorkerClusters
tags: [worker-mgt]
parameters:
- name: worker_id
in: path
required: true
schema: { type: string, format: uuid }
requestBody:
description: The list of cluster IDs this worker should be a member of.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/WorkerClusterChangeRequest"
responses:
"204":
description: Status change was accepted.
default:
description: Unexpected error.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/v3/worker-mgt/workers/{worker_id}/sleep-schedule: /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule:
summary: Get or update the worker's sleep schedule. summary: Get or update the worker's sleep schedule.
get: get:
@ -584,6 +611,91 @@ paths:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/api/v3/worker-mgt/clusters:
summary: Manage worker clusters.
get:
operationId: fetchWorkerClusters
summary: Get list of worker clusters.
tags: [worker-mgt]
responses:
"200":
description: Worker clusters.
content:
application/json:
schema: { $ref: "#/components/schemas/WorkerClusterList" }
post:
operationId: createWorkerCluster
summary: Create a new worker cluster.
tags: [worker-mgt]
requestBody:
description: The worker cluster.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/WorkerCluster"
responses:
"200":
description: The cluster was created. The created cluster is returned, so that the caller can know its UUID.
content:
application/json:
schema: { $ref: "#/components/schemas/WorkerCluster" }
default:
description: Error message
content:
application/json:
schema: { $ref: "#/components/schemas/Error" }
/api/v3/worker-mgt/cluster/{cluster_id}:
summary: Get, update, or delete a worker cluster.
parameters:
- name: cluster_id
in: path
required: true
schema: { type: string, format: uuid }
get:
operationId: fetchWorkerCluster
summary: Get a single worker cluster.
tags: [worker-mgt]
responses:
"200":
description: The worker cluster.
content:
application/json:
schema: { $ref: "#/components/schemas/WorkerCluster" }
put:
operationId: updateWorkerCluster
summary: Update an existing worker cluster.
tags: [worker-mgt]
requestBody:
description: The updated worker cluster.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/WorkerCluster"
responses:
"204":
description: The cluster update has been stored.
default:
description: Error message
content:
application/json:
schema: { $ref: "#/components/schemas/Error" }
delete:
operationId: deleteWorkerCluster
summary: Remove this worker cluster. This unassigns all workers from the cluster and removes it.
tags: [worker-mgt]
responses:
"204":
description: The cluster has been removed.
default:
description: Unexpected error.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
## Jobs ## Jobs
/api/v3/jobs/types: /api/v3/jobs/types:
@ -1363,6 +1475,12 @@ components:
type: array type: array
items: { type: string } items: { type: string }
name: { type: string } name: { type: string }
example:
"name": "example-worker"
"secret": "do-not-tell-anyone"
"platform": "linux"
"software": "3.2"
"supported_task_types": ["blender", "ffmpeg", "file-management", "misc"]
RegisteredWorker: RegisteredWorker:
type: object type: object
@ -1636,6 +1754,13 @@ components:
test/debug scripts easier, as they can use a static document on all test/debug scripts easier, as they can use a static document on all
platforms. platforms.
"storage": { $ref: "#/components/schemas/JobStorageInfo" } "storage": { $ref: "#/components/schemas/JobStorageInfo" }
"worker_cluster":
type: string
format: uuid
description: >
Worker Cluster that should execute this job. When a cluster ID is
given, only Workers in that cluster will be scheduled to work on it.
If empty or ommitted, all workers can work on this job.
required: [name, type, priority, submitter_platform] required: [name, type, priority, submitter_platform]
example: example:
type: "simple-blender-render" type: "simple-blender-render"
@ -1749,7 +1874,7 @@ components:
description: Filter by job settings, using `LIKE` notation. description: Filter by job settings, using `LIKE` notation.
example: example:
"limit": 5 "limit": 5
"order_by": ["updated", "status"] "order_by": ["updated_at", "status"]
"status_in": ["active", "queued", "failed"] "status_in": ["active", "queued", "failed"]
"metadata": { project: "Sprite Fright" } "metadata": { project: "Sprite Fright" }
@ -2235,6 +2360,10 @@ components:
type: array type: array
items: { type: string } items: { type: string }
"task": { $ref: "#/components/schemas/WorkerTask" } "task": { $ref: "#/components/schemas/WorkerTask" }
"clusters":
type: array
items: { $ref: "#/components/schemas/WorkerCluster" }
description: Clusters of which this Worker is a member.
required: required:
- id - id
- name - name
@ -2288,6 +2417,47 @@ components:
start_time: "09:00" start_time: "09:00"
end_time: "18:00" end_time: "18:00"
WorkerCluster:
type: object
description: >
Cluster of workers. A job can optionally specify which cluster it should
be limited to. Workers can be part of multiple clusters simultaneously.
properties:
"id":
type: string
format: uuid
description: >
UUID of the cluster. Can be ommitted when creating a new cluster, in
which case a random UUID will be assigned.
"name":
type: string
"description":
type: string
required: [name]
example:
name: GPU-EEVEE
description: All workers that can do GPU rendering with EEVEE.
WorkerClusterList:
type: object
properties:
"clusters":
type: array
items: { $ref: "#/components/schemas/WorkerCluster" }
WorkerClusterChangeRequest:
type: object
description: Request to change which clusters this Worker is assigned to.
properties:
"cluster_ids":
type: array
items:
type: string
format: uuid
required: [cluster_ids]
example:
"cluster_ids": ["4312d68c-ea6d-4566-9bf6-e9f09be48ceb"]
securitySchemes: securitySchemes:
worker_auth: worker_auth:
description: Username is the worker ID, password is the secret given at worker registration. description: Username is the worker ID, password is the secret given at worker registration.

View File

@ -212,6 +212,25 @@ type ClientInterface interface {
// GetVersion request // GetVersion request
GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteWorkerCluster request
DeleteWorkerCluster(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// FetchWorkerCluster request
FetchWorkerCluster(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateWorkerCluster request with any body
UpdateWorkerClusterWithBody(ctx context.Context, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateWorkerCluster(ctx context.Context, clusterId string, body UpdateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// FetchWorkerClusters request
FetchWorkerClusters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateWorkerCluster request with any body
CreateWorkerClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateWorkerCluster(ctx context.Context, body CreateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// FetchWorkers request // FetchWorkers request
FetchWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) FetchWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
@ -221,6 +240,11 @@ type ClientInterface interface {
// FetchWorker request // FetchWorker request
FetchWorker(ctx context.Context, workerId string, reqEditors ...RequestEditorFn) (*http.Response, error) FetchWorker(ctx context.Context, workerId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetWorkerClusters request with any body
SetWorkerClustersWithBody(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SetWorkerClusters(ctx context.Context, workerId string, body SetWorkerClustersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RequestWorkerStatusChange request with any body // RequestWorkerStatusChange request with any body
RequestWorkerStatusChangeWithBody(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) RequestWorkerStatusChangeWithBody(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
@ -798,6 +822,90 @@ func (c *Client) GetVersion(ctx context.Context, reqEditors ...RequestEditorFn)
return c.Client.Do(req) return c.Client.Do(req)
} }
func (c *Client) DeleteWorkerCluster(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteWorkerClusterRequest(c.Server, clusterId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) FetchWorkerCluster(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFetchWorkerClusterRequest(c.Server, clusterId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) UpdateWorkerClusterWithBody(ctx context.Context, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdateWorkerClusterRequestWithBody(c.Server, clusterId, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) UpdateWorkerCluster(ctx context.Context, clusterId string, body UpdateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdateWorkerClusterRequest(c.Server, clusterId, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) FetchWorkerClusters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFetchWorkerClustersRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) CreateWorkerClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateWorkerClusterRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) CreateWorkerCluster(ctx context.Context, body CreateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateWorkerClusterRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) FetchWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { func (c *Client) FetchWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFetchWorkersRequest(c.Server) req, err := NewFetchWorkersRequest(c.Server)
if err != nil { if err != nil {
@ -834,6 +942,30 @@ func (c *Client) FetchWorker(ctx context.Context, workerId string, reqEditors ..
return c.Client.Do(req) return c.Client.Do(req)
} }
func (c *Client) SetWorkerClustersWithBody(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetWorkerClustersRequestWithBody(c.Server, workerId, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) SetWorkerClusters(ctx context.Context, workerId string, body SetWorkerClustersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetWorkerClustersRequest(c.Server, workerId, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) RequestWorkerStatusChangeWithBody(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { func (c *Client) RequestWorkerStatusChangeWithBody(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRequestWorkerStatusChangeRequestWithBody(c.Server, workerId, contentType, body) req, err := NewRequestWorkerStatusChangeRequestWithBody(c.Server, workerId, contentType, body)
if err != nil { if err != nil {
@ -2248,6 +2380,188 @@ func NewGetVersionRequest(server string) (*http.Request, error) {
return req, nil return req, nil
} }
// NewDeleteWorkerClusterRequest generates requests for DeleteWorkerCluster
func NewDeleteWorkerClusterRequest(server string, clusterId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cluster_id", runtime.ParamLocationPath, clusterId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/v3/worker-mgt/cluster/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewFetchWorkerClusterRequest generates requests for FetchWorkerCluster
func NewFetchWorkerClusterRequest(server string, clusterId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cluster_id", runtime.ParamLocationPath, clusterId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/v3/worker-mgt/cluster/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewUpdateWorkerClusterRequest calls the generic UpdateWorkerCluster builder with application/json body
func NewUpdateWorkerClusterRequest(server string, clusterId string, body UpdateWorkerClusterJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewUpdateWorkerClusterRequestWithBody(server, clusterId, "application/json", bodyReader)
}
// NewUpdateWorkerClusterRequestWithBody generates requests for UpdateWorkerCluster with any type of body
func NewUpdateWorkerClusterRequestWithBody(server string, clusterId string, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "cluster_id", runtime.ParamLocationPath, clusterId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/v3/worker-mgt/cluster/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("PUT", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewFetchWorkerClustersRequest generates requests for FetchWorkerClusters
func NewFetchWorkerClustersRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/v3/worker-mgt/clusters")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewCreateWorkerClusterRequest calls the generic CreateWorkerCluster builder with application/json body
func NewCreateWorkerClusterRequest(server string, body CreateWorkerClusterJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCreateWorkerClusterRequestWithBody(server, "application/json", bodyReader)
}
// NewCreateWorkerClusterRequestWithBody generates requests for CreateWorkerCluster with any type of body
func NewCreateWorkerClusterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/v3/worker-mgt/clusters")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewFetchWorkersRequest generates requests for FetchWorkers // NewFetchWorkersRequest generates requests for FetchWorkers
func NewFetchWorkersRequest(server string) (*http.Request, error) { func NewFetchWorkersRequest(server string) (*http.Request, error) {
var err error var err error
@ -2343,6 +2657,53 @@ func NewFetchWorkerRequest(server string, workerId string) (*http.Request, error
return req, nil return req, nil
} }
// NewSetWorkerClustersRequest calls the generic SetWorkerClusters builder with application/json body
func NewSetWorkerClustersRequest(server string, workerId string, body SetWorkerClustersJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewSetWorkerClustersRequestWithBody(server, workerId, "application/json", bodyReader)
}
// NewSetWorkerClustersRequestWithBody generates requests for SetWorkerClusters with any type of body
func NewSetWorkerClustersRequestWithBody(server string, workerId string, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, workerId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/v3/worker-mgt/workers/%s/setclusters", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewRequestWorkerStatusChangeRequest calls the generic RequestWorkerStatusChange builder with application/json body // NewRequestWorkerStatusChangeRequest calls the generic RequestWorkerStatusChange builder with application/json body
func NewRequestWorkerStatusChangeRequest(server string, workerId string, body RequestWorkerStatusChangeJSONRequestBody) (*http.Request, error) { func NewRequestWorkerStatusChangeRequest(server string, workerId string, body RequestWorkerStatusChangeJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader var bodyReader io.Reader
@ -2952,6 +3313,25 @@ type ClientWithResponsesInterface interface {
// GetVersion request // GetVersion request
GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error)
// DeleteWorkerCluster request
DeleteWorkerClusterWithResponse(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*DeleteWorkerClusterResponse, error)
// FetchWorkerCluster request
FetchWorkerClusterWithResponse(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*FetchWorkerClusterResponse, error)
// UpdateWorkerCluster request with any body
UpdateWorkerClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkerClusterResponse, error)
UpdateWorkerClusterWithResponse(ctx context.Context, clusterId string, body UpdateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkerClusterResponse, error)
// FetchWorkerClusters request
FetchWorkerClustersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*FetchWorkerClustersResponse, error)
// CreateWorkerCluster request with any body
CreateWorkerClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkerClusterResponse, error)
CreateWorkerClusterWithResponse(ctx context.Context, body CreateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkerClusterResponse, error)
// FetchWorkers request // FetchWorkers request
FetchWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*FetchWorkersResponse, error) FetchWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*FetchWorkersResponse, error)
@ -2961,6 +3341,11 @@ type ClientWithResponsesInterface interface {
// FetchWorker request // FetchWorker request
FetchWorkerWithResponse(ctx context.Context, workerId string, reqEditors ...RequestEditorFn) (*FetchWorkerResponse, error) FetchWorkerWithResponse(ctx context.Context, workerId string, reqEditors ...RequestEditorFn) (*FetchWorkerResponse, error)
// SetWorkerClusters request with any body
SetWorkerClustersWithBodyWithResponse(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetWorkerClustersResponse, error)
SetWorkerClustersWithResponse(ctx context.Context, workerId string, body SetWorkerClustersJSONRequestBody, reqEditors ...RequestEditorFn) (*SetWorkerClustersResponse, error)
// RequestWorkerStatusChange request with any body // RequestWorkerStatusChange request with any body
RequestWorkerStatusChangeWithBodyWithResponse(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestWorkerStatusChangeResponse, error) RequestWorkerStatusChangeWithBodyWithResponse(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestWorkerStatusChangeResponse, error)
@ -3733,6 +4118,116 @@ func (r GetVersionResponse) StatusCode() int {
return 0 return 0
} }
type DeleteWorkerClusterResponse struct {
Body []byte
HTTPResponse *http.Response
JSONDefault *Error
}
// Status returns HTTPResponse.Status
func (r DeleteWorkerClusterResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteWorkerClusterResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type FetchWorkerClusterResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *WorkerCluster
}
// Status returns HTTPResponse.Status
func (r FetchWorkerClusterResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r FetchWorkerClusterResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type UpdateWorkerClusterResponse struct {
Body []byte
HTTPResponse *http.Response
JSONDefault *Error
}
// Status returns HTTPResponse.Status
func (r UpdateWorkerClusterResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r UpdateWorkerClusterResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type FetchWorkerClustersResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *WorkerClusterList
}
// Status returns HTTPResponse.Status
func (r FetchWorkerClustersResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r FetchWorkerClustersResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type CreateWorkerClusterResponse struct {
Body []byte
HTTPResponse *http.Response
JSONDefault *Error
}
// Status returns HTTPResponse.Status
func (r CreateWorkerClusterResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CreateWorkerClusterResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type FetchWorkersResponse struct { type FetchWorkersResponse struct {
Body []byte Body []byte
HTTPResponse *http.Response HTTPResponse *http.Response
@ -3799,6 +4294,28 @@ func (r FetchWorkerResponse) StatusCode() int {
return 0 return 0
} }
type SetWorkerClustersResponse struct {
Body []byte
HTTPResponse *http.Response
JSONDefault *Error
}
// Status returns HTTPResponse.Status
func (r SetWorkerClustersResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r SetWorkerClustersResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type RequestWorkerStatusChangeResponse struct { type RequestWorkerStatusChangeResponse struct {
Body []byte Body []byte
HTTPResponse *http.Response HTTPResponse *http.Response
@ -4458,6 +4975,67 @@ func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, reqEdi
return ParseGetVersionResponse(rsp) return ParseGetVersionResponse(rsp)
} }
// DeleteWorkerClusterWithResponse request returning *DeleteWorkerClusterResponse
func (c *ClientWithResponses) DeleteWorkerClusterWithResponse(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*DeleteWorkerClusterResponse, error) {
rsp, err := c.DeleteWorkerCluster(ctx, clusterId, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteWorkerClusterResponse(rsp)
}
// FetchWorkerClusterWithResponse request returning *FetchWorkerClusterResponse
func (c *ClientWithResponses) FetchWorkerClusterWithResponse(ctx context.Context, clusterId string, reqEditors ...RequestEditorFn) (*FetchWorkerClusterResponse, error) {
rsp, err := c.FetchWorkerCluster(ctx, clusterId, reqEditors...)
if err != nil {
return nil, err
}
return ParseFetchWorkerClusterResponse(rsp)
}
// UpdateWorkerClusterWithBodyWithResponse request with arbitrary body returning *UpdateWorkerClusterResponse
func (c *ClientWithResponses) UpdateWorkerClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkerClusterResponse, error) {
rsp, err := c.UpdateWorkerClusterWithBody(ctx, clusterId, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUpdateWorkerClusterResponse(rsp)
}
func (c *ClientWithResponses) UpdateWorkerClusterWithResponse(ctx context.Context, clusterId string, body UpdateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkerClusterResponse, error) {
rsp, err := c.UpdateWorkerCluster(ctx, clusterId, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUpdateWorkerClusterResponse(rsp)
}
// FetchWorkerClustersWithResponse request returning *FetchWorkerClustersResponse
func (c *ClientWithResponses) FetchWorkerClustersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*FetchWorkerClustersResponse, error) {
rsp, err := c.FetchWorkerClusters(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseFetchWorkerClustersResponse(rsp)
}
// CreateWorkerClusterWithBodyWithResponse request with arbitrary body returning *CreateWorkerClusterResponse
func (c *ClientWithResponses) CreateWorkerClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkerClusterResponse, error) {
rsp, err := c.CreateWorkerClusterWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateWorkerClusterResponse(rsp)
}
func (c *ClientWithResponses) CreateWorkerClusterWithResponse(ctx context.Context, body CreateWorkerClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkerClusterResponse, error) {
rsp, err := c.CreateWorkerCluster(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateWorkerClusterResponse(rsp)
}
// FetchWorkersWithResponse request returning *FetchWorkersResponse // FetchWorkersWithResponse request returning *FetchWorkersResponse
func (c *ClientWithResponses) FetchWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*FetchWorkersResponse, error) { func (c *ClientWithResponses) FetchWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*FetchWorkersResponse, error) {
rsp, err := c.FetchWorkers(ctx, reqEditors...) rsp, err := c.FetchWorkers(ctx, reqEditors...)
@ -4485,6 +5063,23 @@ func (c *ClientWithResponses) FetchWorkerWithResponse(ctx context.Context, worke
return ParseFetchWorkerResponse(rsp) return ParseFetchWorkerResponse(rsp)
} }
// SetWorkerClustersWithBodyWithResponse request with arbitrary body returning *SetWorkerClustersResponse
func (c *ClientWithResponses) SetWorkerClustersWithBodyWithResponse(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetWorkerClustersResponse, error) {
rsp, err := c.SetWorkerClustersWithBody(ctx, workerId, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetWorkerClustersResponse(rsp)
}
func (c *ClientWithResponses) SetWorkerClustersWithResponse(ctx context.Context, workerId string, body SetWorkerClustersJSONRequestBody, reqEditors ...RequestEditorFn) (*SetWorkerClustersResponse, error) {
rsp, err := c.SetWorkerClusters(ctx, workerId, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetWorkerClustersResponse(rsp)
}
// RequestWorkerStatusChangeWithBodyWithResponse request with arbitrary body returning *RequestWorkerStatusChangeResponse // RequestWorkerStatusChangeWithBodyWithResponse request with arbitrary body returning *RequestWorkerStatusChangeResponse
func (c *ClientWithResponses) RequestWorkerStatusChangeWithBodyWithResponse(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestWorkerStatusChangeResponse, error) { func (c *ClientWithResponses) RequestWorkerStatusChangeWithBodyWithResponse(ctx context.Context, workerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestWorkerStatusChangeResponse, error) {
rsp, err := c.RequestWorkerStatusChangeWithBody(ctx, workerId, contentType, body, reqEditors...) rsp, err := c.RequestWorkerStatusChangeWithBody(ctx, workerId, contentType, body, reqEditors...)
@ -5594,6 +6189,136 @@ func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) {
return response, nil return response, nil
} }
// ParseDeleteWorkerClusterResponse parses an HTTP response from a DeleteWorkerClusterWithResponse call
func ParseDeleteWorkerClusterResponse(rsp *http.Response) (*DeleteWorkerClusterResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteWorkerClusterResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSONDefault = &dest
}
return response, nil
}
// ParseFetchWorkerClusterResponse parses an HTTP response from a FetchWorkerClusterWithResponse call
func ParseFetchWorkerClusterResponse(rsp *http.Response) (*FetchWorkerClusterResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &FetchWorkerClusterResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest WorkerCluster
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
}
return response, nil
}
// ParseUpdateWorkerClusterResponse parses an HTTP response from a UpdateWorkerClusterWithResponse call
func ParseUpdateWorkerClusterResponse(rsp *http.Response) (*UpdateWorkerClusterResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &UpdateWorkerClusterResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSONDefault = &dest
}
return response, nil
}
// ParseFetchWorkerClustersResponse parses an HTTP response from a FetchWorkerClustersWithResponse call
func ParseFetchWorkerClustersResponse(rsp *http.Response) (*FetchWorkerClustersResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &FetchWorkerClustersResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest WorkerClusterList
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
}
return response, nil
}
// ParseCreateWorkerClusterResponse parses an HTTP response from a CreateWorkerClusterWithResponse call
func ParseCreateWorkerClusterResponse(rsp *http.Response) (*CreateWorkerClusterResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CreateWorkerClusterResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSONDefault = &dest
}
return response, nil
}
// ParseFetchWorkersResponse parses an HTTP response from a FetchWorkersWithResponse call // ParseFetchWorkersResponse parses an HTTP response from a FetchWorkersWithResponse call
func ParseFetchWorkersResponse(rsp *http.Response) (*FetchWorkersResponse, error) { func ParseFetchWorkersResponse(rsp *http.Response) (*FetchWorkersResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body) bodyBytes, err := ioutil.ReadAll(rsp.Body)
@ -5672,6 +6397,32 @@ func ParseFetchWorkerResponse(rsp *http.Response) (*FetchWorkerResponse, error)
return response, nil return response, nil
} }
// ParseSetWorkerClustersResponse parses an HTTP response from a SetWorkerClustersWithResponse call
func ParseSetWorkerClustersResponse(rsp *http.Response) (*SetWorkerClustersResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &SetWorkerClustersResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSONDefault = &dest
}
return response, nil
}
// ParseRequestWorkerStatusChangeResponse parses an HTTP response from a RequestWorkerStatusChangeWithResponse call // ParseRequestWorkerStatusChangeResponse parses an HTTP response from a RequestWorkerStatusChangeWithResponse call
func ParseRequestWorkerStatusChangeResponse(rsp *http.Response) (*RequestWorkerStatusChangeResponse, error) { func ParseRequestWorkerStatusChangeResponse(rsp *http.Response) (*RequestWorkerStatusChangeResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body) bodyBytes, err := ioutil.ReadAll(rsp.Body)

View File

@ -110,6 +110,21 @@ type ServerInterface interface {
// Get the Flamenco version of this Manager // Get the Flamenco version of this Manager
// (GET /api/v3/version) // (GET /api/v3/version)
GetVersion(ctx echo.Context) error GetVersion(ctx echo.Context) error
// Remove this worker cluster. This unassigns all workers from the cluster and removes it.
// (DELETE /api/v3/worker-mgt/cluster/{cluster_id})
DeleteWorkerCluster(ctx echo.Context, clusterId string) error
// Get a single worker cluster.
// (GET /api/v3/worker-mgt/cluster/{cluster_id})
FetchWorkerCluster(ctx echo.Context, clusterId string) error
// Update an existing worker cluster.
// (PUT /api/v3/worker-mgt/cluster/{cluster_id})
UpdateWorkerCluster(ctx echo.Context, clusterId string) error
// Get list of worker clusters.
// (GET /api/v3/worker-mgt/clusters)
FetchWorkerClusters(ctx echo.Context) error
// Create a new worker cluster.
// (POST /api/v3/worker-mgt/clusters)
CreateWorkerCluster(ctx echo.Context) error
// Get list of workers. // Get list of workers.
// (GET /api/v3/worker-mgt/workers) // (GET /api/v3/worker-mgt/workers)
FetchWorkers(ctx echo.Context) error FetchWorkers(ctx echo.Context) error
@ -120,6 +135,9 @@ type ServerInterface interface {
// (GET /api/v3/worker-mgt/workers/{worker_id}) // (GET /api/v3/worker-mgt/workers/{worker_id})
FetchWorker(ctx echo.Context, workerId string) error FetchWorker(ctx echo.Context, workerId string) error
// (POST /api/v3/worker-mgt/workers/{worker_id}/setclusters)
SetWorkerClusters(ctx echo.Context, workerId string) error
// (POST /api/v3/worker-mgt/workers/{worker_id}/setstatus) // (POST /api/v3/worker-mgt/workers/{worker_id}/setstatus)
RequestWorkerStatusChange(ctx echo.Context, workerId string) error RequestWorkerStatusChange(ctx echo.Context, workerId string) error
@ -643,6 +661,72 @@ func (w *ServerInterfaceWrapper) GetVersion(ctx echo.Context) error {
return err return err
} }
// DeleteWorkerCluster converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteWorkerCluster(ctx echo.Context) error {
var err error
// ------------- Path parameter "cluster_id" -------------
var clusterId string
err = runtime.BindStyledParameterWithLocation("simple", false, "cluster_id", runtime.ParamLocationPath, ctx.Param("cluster_id"), &clusterId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter cluster_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteWorkerCluster(ctx, clusterId)
return err
}
// FetchWorkerCluster converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkerCluster(ctx echo.Context) error {
var err error
// ------------- Path parameter "cluster_id" -------------
var clusterId string
err = runtime.BindStyledParameterWithLocation("simple", false, "cluster_id", runtime.ParamLocationPath, ctx.Param("cluster_id"), &clusterId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter cluster_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorkerCluster(ctx, clusterId)
return err
}
// UpdateWorkerCluster converts echo context to params.
func (w *ServerInterfaceWrapper) UpdateWorkerCluster(ctx echo.Context) error {
var err error
// ------------- Path parameter "cluster_id" -------------
var clusterId string
err = runtime.BindStyledParameterWithLocation("simple", false, "cluster_id", runtime.ParamLocationPath, ctx.Param("cluster_id"), &clusterId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter cluster_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.UpdateWorkerCluster(ctx, clusterId)
return err
}
// FetchWorkerClusters converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkerClusters(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorkerClusters(ctx)
return err
}
// CreateWorkerCluster converts echo context to params.
func (w *ServerInterfaceWrapper) CreateWorkerCluster(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.CreateWorkerCluster(ctx)
return err
}
// FetchWorkers converts echo context to params. // FetchWorkers converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkers(ctx echo.Context) error { func (w *ServerInterfaceWrapper) FetchWorkers(ctx echo.Context) error {
var err error var err error
@ -684,6 +768,22 @@ func (w *ServerInterfaceWrapper) FetchWorker(ctx echo.Context) error {
return err return err
} }
// SetWorkerClusters converts echo context to params.
func (w *ServerInterfaceWrapper) SetWorkerClusters(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetWorkerClusters(ctx, workerId)
return err
}
// RequestWorkerStatusChange converts echo context to params. // RequestWorkerStatusChange converts echo context to params.
func (w *ServerInterfaceWrapper) RequestWorkerStatusChange(ctx echo.Context) error { func (w *ServerInterfaceWrapper) RequestWorkerStatusChange(ctx echo.Context) error {
var err error var err error
@ -910,9 +1010,15 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL
router.GET(baseURL+"/api/v3/tasks/:task_id/logtail", wrapper.FetchTaskLogTail) router.GET(baseURL+"/api/v3/tasks/:task_id/logtail", wrapper.FetchTaskLogTail)
router.POST(baseURL+"/api/v3/tasks/:task_id/setstatus", wrapper.SetTaskStatus) router.POST(baseURL+"/api/v3/tasks/:task_id/setstatus", wrapper.SetTaskStatus)
router.GET(baseURL+"/api/v3/version", wrapper.GetVersion) router.GET(baseURL+"/api/v3/version", wrapper.GetVersion)
router.DELETE(baseURL+"/api/v3/worker-mgt/cluster/:cluster_id", wrapper.DeleteWorkerCluster)
router.GET(baseURL+"/api/v3/worker-mgt/cluster/:cluster_id", wrapper.FetchWorkerCluster)
router.PUT(baseURL+"/api/v3/worker-mgt/cluster/:cluster_id", wrapper.UpdateWorkerCluster)
router.GET(baseURL+"/api/v3/worker-mgt/clusters", wrapper.FetchWorkerClusters)
router.POST(baseURL+"/api/v3/worker-mgt/clusters", wrapper.CreateWorkerCluster)
router.GET(baseURL+"/api/v3/worker-mgt/workers", wrapper.FetchWorkers) router.GET(baseURL+"/api/v3/worker-mgt/workers", wrapper.FetchWorkers)
router.DELETE(baseURL+"/api/v3/worker-mgt/workers/:worker_id", wrapper.DeleteWorker) router.DELETE(baseURL+"/api/v3/worker-mgt/workers/:worker_id", wrapper.DeleteWorker)
router.GET(baseURL+"/api/v3/worker-mgt/workers/:worker_id", wrapper.FetchWorker) router.GET(baseURL+"/api/v3/worker-mgt/workers/:worker_id", wrapper.FetchWorker)
router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/setclusters", wrapper.SetWorkerClusters)
router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/setstatus", wrapper.RequestWorkerStatusChange) router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/setstatus", wrapper.RequestWorkerStatusChange)
router.GET(baseURL+"/api/v3/worker-mgt/workers/:worker_id/sleep-schedule", wrapper.FetchWorkerSleepSchedule) router.GET(baseURL+"/api/v3/worker-mgt/workers/:worker_id/sleep-schedule", wrapper.FetchWorkerSleepSchedule)
router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/sleep-schedule", wrapper.SetWorkerSleepSchedule) router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/sleep-schedule", wrapper.SetWorkerSleepSchedule)

View File

@ -18,205 +18,216 @@ import (
// Base64 encoded, gzipped, json marshaled Swagger object // Base64 encoded, gzipped, json marshaled Swagger object
var swaggerSpec = []string{ var swaggerSpec = []string{
"H4sIAAAAAAAC/+y963IcN5Yg/CqImi9CdnxVRUrUxWL/WbVk2XRLFlek2rvRdJCoTFQVzCwgG0CyVK1Q", "H4sIAAAAAAAC/+y96XIcN7Yg/CqIul+E7PiqihSpxWL/GbUWm27Z4ohUeyZaDhKViaqCmQVkA0iWqhWK",
"xDzEvsnuROyPnV/7Ap432sA5ABKZiawLJVK0evqHm6rMxOXg4NwvHwaZXJRSMGH04PDDQGdztqDw5zOt", "uA8xbzJzI+bH3F/zAr5vNIFzACQyE1kLJVK0+vYPN1WZieXg4OzLh0EmF6UUTBg9OPow0NmcLSj8+VRr",
"+Uyw/JTqS/vvnOlM8dJwKQaHjaeEa0KJsX9RTbix/1YsY/yK5WSyImbOyC9SXTI1HgwHpZIlU4YzmCWT", "PhMsP6P60v47ZzpTvDRcisFR4ynhmlBi7F9UE27svxXLGL9iOZmsiJkz8otUl0yNB8NBqWTJlOEMZsnk",
"iwUVOfzNDVvAH/+fYtPB4eBf9urF7bmV7T3HDwYfhwOzKtngcECVoiv779/kxH7tftZGcTFzv5+XikvF", "YkFFDn9zwxbwx/+n2HRwNPiXvXpxe25le8/wg8HH4cCsSjY4GlCl6Mr++zc5sV+7n7VRXMzc7+el4lJx",
"zSp6gQvDZkz5N/DXxOeCLtIP1o+pDTXVxu1Y+J3gm3ZHVF/2L6SqeG4fTKVaUDM4xB+G7Rc/DgeK/b3i", "s4pe4MKwGVP+Dfw18bmgi/SD9WNqQ021cTsWfqf4pt0R1Zf9C6kqntsHU6kW1AyO8Idh+8WPw4Fif6+4",
"iuWDw7/5lyxw3F7C2qIttKAUgSRe1bA+r1/DvHLyG8uMXeCzK8oLOinYT3Jywoyxy+lgzgkXs4IRjc+J", "Yvng6G/+JQsct5ewtmgLLShFIIlXNazP69cwr5z8xjJjF/j0ivKCTgr2o5ycMmPscjqYc8rFrGBE43Mi",
"nBJKfpITYkfTCQ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pleI3i2kfJiI8W8hA0QELtmElqU3V+RWRZpWRVFnPftGylauvHuk5F3t1u6p", "YbG6CFn1iIKertoVo52nWWxr2mnoZuhMY10vQ0E3qcd4IfJScpepOHPdeDsDdnJKLeST4N2D0Js9ryr1",
"wuB7giOT41Abze5wRaaVwD67BTQC2YDeFiFSmN1b5LAfBxucb++DL4zwce+Dd5p8XEeSGsyw2cTPKuDc", "AfslF/mfQ32sEyyCcWPgTrcTS8D7paxEXS4LZODQwK3ZqfmzrAvrtCXWcRoaNi0tg18qCc2cGyf3krvc",
"ws5VGnIqXFR6oVacnTV6FxWnW47CavGJCSPnT/+Eber16w0y03SJkd0pptfSWvVAikZpkkbb3bgoif3S", "LanIQipGnr069u3D0JkCcWqaLClEuIE05beTQopS6sRJQS2lxFEBq/mzzFefDRqtmpAJsPjGaVI5XxxE",
"mQR8TRKLnKEgCZr6dtTv1i2n0a6it05JP6qGoPTdsbQuRv2fGHqNDehPQM66iE3bfEDead8CmLUaa2/I", "BmEdRIlBX5jee/N41Kgx113pz82LO8RFYlgaHOmUC3b3cOqvtODgEKUxNl0HmVp46ryqV/X4vo1rfZAb",
"SkAyGupYN1ptY9PJVAAzmVBdFxqcKLnUjfD862N8vcfdcdx3bejh/BAAjsVPboTVNzo2dg8ZmnlLlzzS", "iQpWXBhFgbtrULZRQeKLYu3JreHnPwViYqGNGiObdTg2sLsdxulFRqgtta0U8RILUX3Ske/QW+XjsDHW",
"Qc+b1DjWLAiM65WV8JB3uqh9K6q5EKuopIkGaD+8/+DmZYTTQFFDegK0Gs8l811TfRpD84VkEgPXkEZT", "ii6K5lhtuXgTgrQP4g20JrxiacGjKyesPY2nWcZ06C+fKgyfGDIEbwtpCG7sHvjcX5dMPD059inXRSGX",
"rEhesVZn1Yxm86hfPA4F90FKUkhs9n6b4hE8IL56c5MSII4R6qsbwULbdyTqORzLPtiCpDHcT82cDuYu", "KFlf+D7Me06SdAd6QUqaXdrDfif6j1szU5Uj6kuV9pOdU3rFktVRb4b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ao",
"w0wJkN7dKdsv72mS8xnT2Ka/dcbkWciRh6Cxk5+/Bzj/ePLie+JQyQ5aFlSIdNDWOoHHzKvFRFBe6L1S",
"sSvOlp4scYVl/Ty1J0j9vRgEEFVXnppXqhgcDfYGkRGqTayOmxFRnRZfHlMCO4BUlG65ix/lxJtJQUb7",
"e8UUt+hX99EbtpomjBu1HnVi0Kcnx83GY7GJTC4WlUBxE8popNp3Nxy4iQkcNvwU1kSgB3dv209suWS3",
"Ye+KkoVfUWcycDomCrpgknyYBfhEneHvIBiaof0mJ6FuWTyHS8r/+OvH/xcAAP//hNj5AroAAQA=",
} }
// GetSwagger returns the content of the embedded swagger specification file // GetSwagger returns the content of the embedded swagger specification file

View File

@ -638,6 +638,9 @@ type SubmittedJob struct {
// Hash of the job type, copied from the `AvailableJobType.etag` property of the job type. The job will be rejected if this field doesn't match the actual job type on the Manager. This prevents job submission with old settings, after the job compiler script has been updated. // Hash of the job type, copied from the `AvailableJobType.etag` property of the job type. The job will be rejected if this field doesn't match the actual job type on the Manager. This prevents job submission with old settings, after the job compiler script has been updated.
// If this field is ommitted, the check is bypassed. // If this field is ommitted, the check is bypassed.
TypeEtag *string `json:"type_etag,omitempty"` TypeEtag *string `json:"type_etag,omitempty"`
// Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job.
WorkerCluster *string `json:"worker_cluster,omitempty"`
} }
// The task as it exists in the Manager database, i.e. before variable replacement. // The task as it exists in the Manager database, i.e. before variable replacement.
@ -719,6 +722,9 @@ type Worker struct {
// Embedded struct due to allOf(#/components/schemas/WorkerSummary) // Embedded struct due to allOf(#/components/schemas/WorkerSummary)
WorkerSummary `yaml:",inline"` WorkerSummary `yaml:",inline"`
// Embedded fields due to inline allOf schema // Embedded fields due to inline allOf schema
// Clusters of which this Worker is a member.
Clusters *[]WorkerCluster `json:"clusters,omitempty"`
// IP address of the Worker // IP address of the Worker
IpAddress string `json:"ip_address"` IpAddress string `json:"ip_address"`
@ -730,6 +736,25 @@ type Worker struct {
Task *WorkerTask `json:"task,omitempty"` Task *WorkerTask `json:"task,omitempty"`
} }
// Cluster of workers. A job can optionally specify which cluster it should be limited to. Workers can be part of multiple clusters simultaneously.
type WorkerCluster struct {
Description *string `json:"description,omitempty"`
// UUID of the cluster. Can be ommitted when creating a new cluster, in which case a random UUID will be assigned.
Id *string `json:"id,omitempty"`
Name string `json:"name"`
}
// Request to change which clusters this Worker is assigned to.
type WorkerClusterChangeRequest struct {
ClusterIds []string `json:"cluster_ids"`
}
// WorkerClusterList defines model for WorkerClusterList.
type WorkerClusterList struct {
Clusters *[]WorkerCluster `json:"clusters,omitempty"`
}
// List of workers. // List of workers.
type WorkerList struct { type WorkerList struct {
Workers []WorkerSummary `json:"workers"` Workers []WorkerSummary `json:"workers"`
@ -849,6 +874,15 @@ type ShamanFileStoreParams struct {
// SetTaskStatusJSONBody defines parameters for SetTaskStatus. // SetTaskStatusJSONBody defines parameters for SetTaskStatus.
type SetTaskStatusJSONBody TaskStatusChange type SetTaskStatusJSONBody TaskStatusChange
// UpdateWorkerClusterJSONBody defines parameters for UpdateWorkerCluster.
type UpdateWorkerClusterJSONBody WorkerCluster
// CreateWorkerClusterJSONBody defines parameters for CreateWorkerCluster.
type CreateWorkerClusterJSONBody WorkerCluster
// SetWorkerClustersJSONBody defines parameters for SetWorkerClusters.
type SetWorkerClustersJSONBody WorkerClusterChangeRequest
// RequestWorkerStatusChangeJSONBody defines parameters for RequestWorkerStatusChange. // RequestWorkerStatusChangeJSONBody defines parameters for RequestWorkerStatusChange.
type RequestWorkerStatusChangeJSONBody WorkerStatusChangeRequest type RequestWorkerStatusChangeJSONBody WorkerStatusChangeRequest
@ -903,6 +937,15 @@ type ShamanCheckoutRequirementsJSONRequestBody ShamanCheckoutRequirementsJSONBod
// SetTaskStatusJSONRequestBody defines body for SetTaskStatus for application/json ContentType. // SetTaskStatusJSONRequestBody defines body for SetTaskStatus for application/json ContentType.
type SetTaskStatusJSONRequestBody SetTaskStatusJSONBody type SetTaskStatusJSONRequestBody SetTaskStatusJSONBody
// UpdateWorkerClusterJSONRequestBody defines body for UpdateWorkerCluster for application/json ContentType.
type UpdateWorkerClusterJSONRequestBody UpdateWorkerClusterJSONBody
// CreateWorkerClusterJSONRequestBody defines body for CreateWorkerCluster for application/json ContentType.
type CreateWorkerClusterJSONRequestBody CreateWorkerClusterJSONBody
// SetWorkerClustersJSONRequestBody defines body for SetWorkerClusters for application/json ContentType.
type SetWorkerClustersJSONRequestBody SetWorkerClustersJSONBody
// RequestWorkerStatusChangeJSONRequestBody defines body for RequestWorkerStatusChange for application/json ContentType. // RequestWorkerStatusChangeJSONRequestBody defines body for RequestWorkerStatusChange for application/json ContentType.
type RequestWorkerStatusChangeJSONRequestBody RequestWorkerStatusChangeJSONBody type RequestWorkerStatusChangeJSONRequestBody RequestWorkerStatusChangeJSONBody

View File

@ -7,6 +7,7 @@
*/ */
const flashAfterCopyDuration = 150; const flashAfterCopyDuration = 150;
/** /**
* Copy the inner text of an element to the clipboard. * Copy the inner text of an element to the clipboard.
* *
@ -14,9 +15,24 @@ const flashAfterCopyDuration = 150;
*/ */
export function copyElementText(clickEvent) { export function copyElementText(clickEvent) {
const sourceElement = clickEvent.target; const sourceElement = clickEvent.target;
copyElementValue(sourceElement, sourceElement.innerText);
}
/**
* Copy the inner text of an element to the clipboard.
*
* @param {Event } clickEvent the click event that triggered this function call.
*/
export function copyElementData(clickEvent) {
const sourceElement = clickEvent.target;
window.sourceElement = sourceElement;
copyElementValue(sourceElement, sourceElement.dataset.clipboard);
}
function copyElementValue(sourceElement, value) {
const inputElement = document.createElement("input"); const inputElement = document.createElement("input");
document.body.appendChild(inputElement); document.body.appendChild(inputElement);
inputElement.setAttribute("value", sourceElement.innerText); inputElement.setAttribute("value", value);
inputElement.select(); inputElement.select();
// Note that the `navigator.clipboard` interface is only available when using // Note that the `navigator.clipboard` interface is only available when using
@ -27,7 +43,6 @@ export function copyElementText(clickEvent) {
document.execCommand("copy"); document.execCommand("copy");
document.body.removeChild(inputElement); document.body.removeChild(inputElement);
flashElement(sourceElement); flashElement(sourceElement);
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<label> <label :title="title">
<span class="switch"> <span class="switch">
<input type="checkbox" :checked="isChecked" @change="$emit('switchToggle')"> <input type="checkbox" :checked="isChecked" @change="$emit('switchToggle')">
<span class="slider round"></span> <span class="slider round"></span>
@ -9,7 +9,7 @@
</template> </template>
<script setup> <script setup>
const props = defineProps(['isChecked', 'label']); const props = defineProps(['isChecked', 'label', 'title']);
</script> </script>
<style scoped> <style scoped>

View File

@ -32,6 +32,14 @@
<dt class="field-name" title="ID">ID</dt> <dt class="field-name" title="ID">ID</dt>
<dd><span @click="copyElementText" class="click-to-copy">{{ jobData.id }}</span></dd> <dd><span @click="copyElementText" class="click-to-copy">{{ jobData.id }}</span></dd>
<template v-if="workerCluster">
<!-- TODO: fetch cluster name and show that instead, and allow editing of the cluster. -->
<dt class="field-name" title="Worker Cluster">Cluster</dt>
<dd :title="workerCluster.description"><span @click="copyElementData" class="click-to-copy"
:data-clipboard="workerCluster.id">{{
workerCluster.name }}</span></dd>
</template>
<dt class="field-name" title="Name">Name</dt> <dt class="field-name" title="Name">Name</dt>
<dd>{{ jobData.name }}</dd> <dd>{{ jobData.name }}</dd>
@ -82,7 +90,8 @@ import Blocklist from './Blocklist.vue'
import TabItem from '@/components/TabItem.vue' import TabItem from '@/components/TabItem.vue'
import TabsWrapper from '@/components/TabsWrapper.vue' import TabsWrapper from '@/components/TabsWrapper.vue'
import PopoverEditableJobPriority from '@/components/PopoverEditableJobPriority.vue' import PopoverEditableJobPriority from '@/components/PopoverEditableJobPriority.vue'
import { copyElementText } from '@/clipboard'; import { copyElementText, copyElementData } from '@/clipboard';
import { useWorkers } from '@/stores/workers'
export default { export default {
props: [ props: [
@ -102,11 +111,13 @@ export default {
return { return {
datetime: datetime, // So that the template can access it. datetime: datetime, // So that the template can access it.
copyElementText: copyElementText, copyElementText: copyElementText,
copyElementData: copyElementData,
simpleSettings: null, // Object with filtered job settings, or null if there is no job. simpleSettings: null, // Object with filtered job settings, or null if there is no job.
jobsApi: new API.JobsApi(getAPIClient()), jobsApi: new API.JobsApi(getAPIClient()),
jobType: null, // API.AvailableJobType object for the current job type. jobType: null, // API.AvailableJobType object for the current job type.
jobTypeSettings: null, // Mapping from setting key to its definition in the job type. jobTypeSettings: null, // Mapping from setting key to its definition in the job type.
showAllSettings: false, showAllSettings: false,
workers: useWorkers(),
}; };
}, },
mounted() { mounted() {
@ -116,6 +127,12 @@ export default {
if (!objectEmpty(this.jobData)) { if (!objectEmpty(this.jobData)) {
this._refreshJobSettings(this.jobData); this._refreshJobSettings(this.jobData);
} }
this.workers.refreshClusters()
.catch((error) => {
const errorMsg = JSON.stringify(error); // TODO: handle API errors better.
this.notifs.add(`Error: ${errorMsg}`);
});
}, },
computed: { computed: {
hasJobData() { hasJobData() {
@ -139,6 +156,10 @@ export default {
} }
return this.jobData.settings; return this.jobData.settings;
}, },
workerCluster() {
if (!this.jobData.worker_cluster) return undefined;
return this.workers.clustersByID[this.jobData.worker_cluster];
},
}, },
watch: { watch: {
jobData(newJobData) { jobData(newJobData) {

View File

@ -34,6 +34,23 @@
</dd> </dd>
</dl> </dl>
<section class="worker-clusters" v-if="workers.clusters && workers.clusters.length">
<h3 class="sub-title">Clusters</h3>
<ul>
<li v-for="cluster in workers.clusters">
<switch-checkbox :isChecked="thisWorkerClusters[cluster.id]" :label="cluster.name" :title="cluster.description"
@switch-toggle="toggleWorkerCluster(cluster.id)">
</switch-checkbox>
</li>
</ul>
<p class="hint" v-if="hasClustersAssigned">
This worker will only pick up jobs assigned to one of its clusters, and clusterless jobs.
</p>
<p class="hint" v-else>
This worker will only pick up clusterless jobs.
</p>
</section>
<section class="sleep-schedule" :class="{ 'is-schedule-active': workerSleepSchedule.is_active }"> <section class="sleep-schedule" :class="{ 'is-schedule-active': workerSleepSchedule.is_active }">
<h3 class="sub-title"> <h3 class="sub-title">
<switch-checkbox :isChecked="workerSleepSchedule.is_active" @switch-toggle="toggleWorkerSleepSchedule"> <switch-checkbox :isChecked="workerSleepSchedule.is_active" @switch-toggle="toggleWorkerSleepSchedule">
@ -120,9 +137,10 @@
<script> <script>
import { useNotifs } from '@/stores/notifications' import { useNotifs } from '@/stores/notifications'
import { useWorkers } from '@/stores/workers'
import * as datetime from "@/datetime"; import * as datetime from "@/datetime";
import { WorkerMgtApi, WorkerSleepSchedule } from '@/manager-api'; import { WorkerMgtApi, WorkerSleepSchedule, WorkerClusterChangeRequest } from '@/manager-api';
import { getAPIClient } from "@/api-client"; import { getAPIClient } from "@/api-client";
import { workerStatus } from "../../statusindicator"; import { workerStatus } from "../../statusindicator";
import LinkWorkerTask from '@/components/LinkWorkerTask.vue'; import LinkWorkerTask from '@/components/LinkWorkerTask.vue';
@ -146,11 +164,19 @@ export default {
isScheduleEditing: false, isScheduleEditing: false,
notifs: useNotifs(), notifs: useNotifs(),
copyElementText: copyElementText, copyElementText: copyElementText,
workers: useWorkers(),
thisWorkerClusters: {}, // Mapping from UUID to 'isAssigned' boolean.
}; };
}, },
mounted() { mounted() {
// Allow testing from the JS console: // Allow testing from the JS console:
window.workerDetailsVue = this; window.workerDetailsVue = this;
this.workers.refreshClusters()
.catch((error) => {
const errorMsg = JSON.stringify(error); // TODO: handle API errors better.
this.notifs.add(`Error: ${errorMsg}`);
});
}, },
watch: { watch: {
workerData(newData, oldData) { workerData(newData, oldData) {
@ -164,6 +190,8 @@ export default {
if (((oldData && newData) && (oldData.id != newData.id)) || !oldData && newData) { if (((oldData && newData) && (oldData.id != newData.id)) || !oldData && newData) {
this.fetchWorkerSleepSchedule(); this.fetchWorkerSleepSchedule();
} }
this.updateThisWorkerClusters(newData);
}, },
}, },
computed: { computed: {
@ -182,6 +210,10 @@ export default {
workerSleepScheduleStatusLabel() { workerSleepScheduleStatusLabel() {
return this.workerSleepSchedule.is_active ? 'Enabled' : 'Disabled'; return this.workerSleepSchedule.is_active ? 'Enabled' : 'Disabled';
}, },
hasClustersAssigned() {
const clusterIDs = this.getAssignedClusterIDs();
return clusterIDs && clusterIDs.length > 0;
}
}, },
methods: { methods: {
fetchWorkerSleepSchedule() { fetchWorkerSleepSchedule() {
@ -230,6 +262,45 @@ export default {
} }
this.api.deleteWorker(this.workerData.id); this.api.deleteWorker(this.workerData.id);
}, },
updateThisWorkerClusters(newWorkerData) {
if (!newWorkerData || !newWorkerData.clusters) {
this.thisWorkerClusters = {};
return;
}
const assignedClusters = newWorkerData.clusters.reduce(
(accu, cluster) => { accu[cluster.id] = true; return accu; },
{});
this.thisWorkerClusters = assignedClusters;
},
toggleWorkerCluster(clusterID) {
console.log("Toggled", clusterID);
this.thisWorkerClusters[clusterID] = !this.thisWorkerClusters[clusterID];
console.log("New assignment:", plain(this.thisWorkerClusters))
// Construct cluster change request.
const clusterIDs = this.getAssignedClusterIDs();
const changeRequest = new WorkerClusterChangeRequest(clusterIDs);
// Send to the Manager.
this.api.setWorkerClusters(this.workerData.id, changeRequest)
.then(() => {
this.notifs.add('Cluster assignment updated');
})
.catch((error) => {
const errorMsg = JSON.stringify(error); // TODO: handle API errors better.
this.notifs.add(`Error: ${errorMsg}`);
});
},
getAssignedClusterIDs() {
const clusterIDs = [];
for (let clusterID in this.thisWorkerClusters) {
// Values can exist and be set to 'false'.
const isAssigned = this.thisWorkerClusters[clusterID];
if (isAssigned) clusterIDs.push(clusterID);
}
return clusterIDs;
}
} }
}; };
</script> </script>
@ -305,4 +376,12 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.worker-clusters ul {
list-style: none;
}
.worker-clusters ul li {
margin-bottom: 0.25rem;
}
</style> </style>

View File

@ -73,6 +73,9 @@ import TaskUpdate from './model/TaskUpdate';
import TaskWorker from './model/TaskWorker'; import TaskWorker from './model/TaskWorker';
import Worker from './model/Worker'; import Worker from './model/Worker';
import WorkerAllOf from './model/WorkerAllOf'; import WorkerAllOf from './model/WorkerAllOf';
import WorkerCluster from './model/WorkerCluster';
import WorkerClusterChangeRequest from './model/WorkerClusterChangeRequest';
import WorkerClusterList from './model/WorkerClusterList';
import WorkerList from './model/WorkerList'; import WorkerList from './model/WorkerList';
import WorkerRegistration from './model/WorkerRegistration'; import WorkerRegistration from './model/WorkerRegistration';
import WorkerSignOn from './model/WorkerSignOn'; import WorkerSignOn from './model/WorkerSignOn';
@ -489,6 +492,24 @@ export {
*/ */
WorkerAllOf, WorkerAllOf,
/**
* The WorkerCluster model constructor.
* @property {module:model/WorkerCluster}
*/
WorkerCluster,
/**
* The WorkerClusterChangeRequest model constructor.
* @property {module:model/WorkerClusterChangeRequest}
*/
WorkerClusterChangeRequest,
/**
* The WorkerClusterList model constructor.
* @property {module:model/WorkerClusterList}
*/
WorkerClusterList,
/** /**
* The WorkerList model constructor. * The WorkerList model constructor.
* @property {module:model/WorkerList} * @property {module:model/WorkerList}

View File

@ -15,6 +15,9 @@
import ApiClient from "../ApiClient"; import ApiClient from "../ApiClient";
import Error from '../model/Error'; import Error from '../model/Error';
import Worker from '../model/Worker'; import Worker from '../model/Worker';
import WorkerCluster from '../model/WorkerCluster';
import WorkerClusterChangeRequest from '../model/WorkerClusterChangeRequest';
import WorkerClusterList from '../model/WorkerClusterList';
import WorkerList from '../model/WorkerList'; import WorkerList from '../model/WorkerList';
import WorkerSleepSchedule from '../model/WorkerSleepSchedule'; import WorkerSleepSchedule from '../model/WorkerSleepSchedule';
import WorkerStatusChangeRequest from '../model/WorkerStatusChangeRequest'; import WorkerStatusChangeRequest from '../model/WorkerStatusChangeRequest';
@ -39,6 +42,51 @@ export default class WorkerMgtApi {
/**
* Create a new worker cluster.
* @param {module:model/WorkerCluster} workerCluster The worker cluster.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
createWorkerClusterWithHttpInfo(workerCluster) {
let postBody = workerCluster;
// verify the required parameter 'workerCluster' is set
if (workerCluster === undefined || workerCluster === null) {
throw new Error("Missing the required parameter 'workerCluster' when calling createWorkerCluster");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = null;
return this.apiClient.callApi(
'/api/v3/worker-mgt/clusters', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Create a new worker cluster.
* @param {module:model/WorkerCluster} workerCluster The worker cluster.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
createWorkerCluster(workerCluster) {
return this.createWorkerClusterWithHttpInfo(workerCluster)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/** /**
* Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued. * Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued.
* @param {String} workerId * @param {String} workerId
@ -85,6 +133,52 @@ export default class WorkerMgtApi {
} }
/**
* Remove this worker cluster. This unassigns all workers from the cluster and removes it.
* @param {String} clusterId
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
deleteWorkerClusterWithHttpInfo(clusterId) {
let postBody = null;
// verify the required parameter 'clusterId' is set
if (clusterId === undefined || clusterId === null) {
throw new Error("Missing the required parameter 'clusterId' when calling deleteWorkerCluster");
}
let pathParams = {
'cluster_id': clusterId
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = null;
return this.apiClient.callApi(
'/api/v3/worker-mgt/cluster/{cluster_id}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Remove this worker cluster. This unassigns all workers from the cluster and removes it.
* @param {String} clusterId
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
deleteWorkerCluster(clusterId) {
return this.deleteWorkerClusterWithHttpInfo(clusterId)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/** /**
* Fetch info about the worker. * Fetch info about the worker.
* @param {String} workerId * @param {String} workerId
@ -131,6 +225,91 @@ export default class WorkerMgtApi {
} }
/**
* Get a single worker cluster.
* @param {String} clusterId
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WorkerCluster} and HTTP response
*/
fetchWorkerClusterWithHttpInfo(clusterId) {
let postBody = null;
// verify the required parameter 'clusterId' is set
if (clusterId === undefined || clusterId === null) {
throw new Error("Missing the required parameter 'clusterId' when calling fetchWorkerCluster");
}
let pathParams = {
'cluster_id': clusterId
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = WorkerCluster;
return this.apiClient.callApi(
'/api/v3/worker-mgt/cluster/{cluster_id}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Get a single worker cluster.
* @param {String} clusterId
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WorkerCluster}
*/
fetchWorkerCluster(clusterId) {
return this.fetchWorkerClusterWithHttpInfo(clusterId)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get list of worker clusters.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WorkerClusterList} and HTTP response
*/
fetchWorkerClustersWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = WorkerClusterList;
return this.apiClient.callApi(
'/api/v3/worker-mgt/clusters', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Get list of worker clusters.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WorkerClusterList}
*/
fetchWorkerClusters() {
return this.fetchWorkerClustersWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
});
}
/** /**
* @param {String} workerId * @param {String} workerId
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WorkerSleepSchedule} and HTTP response * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WorkerSleepSchedule} and HTTP response
@ -264,6 +443,56 @@ export default class WorkerMgtApi {
} }
/**
* @param {String} workerId
* @param {module:model/WorkerClusterChangeRequest} workerClusterChangeRequest The list of cluster IDs this worker should be a member of.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
setWorkerClustersWithHttpInfo(workerId, workerClusterChangeRequest) {
let postBody = workerClusterChangeRequest;
// verify the required parameter 'workerId' is set
if (workerId === undefined || workerId === null) {
throw new Error("Missing the required parameter 'workerId' when calling setWorkerClusters");
}
// verify the required parameter 'workerClusterChangeRequest' is set
if (workerClusterChangeRequest === undefined || workerClusterChangeRequest === null) {
throw new Error("Missing the required parameter 'workerClusterChangeRequest' when calling setWorkerClusters");
}
let pathParams = {
'worker_id': workerId
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = null;
return this.apiClient.callApi(
'/api/v3/worker-mgt/workers/{worker_id}/setclusters', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* @param {String} workerId
* @param {module:model/WorkerClusterChangeRequest} workerClusterChangeRequest The list of cluster IDs this worker should be a member of.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
setWorkerClusters(workerId, workerClusterChangeRequest) {
return this.setWorkerClustersWithHttpInfo(workerId, workerClusterChangeRequest)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/** /**
* @param {String} workerId * @param {String} workerId
* @param {module:model/WorkerSleepSchedule} workerSleepSchedule The new sleep schedule. * @param {module:model/WorkerSleepSchedule} workerSleepSchedule The new sleep schedule.
@ -314,4 +543,56 @@ export default class WorkerMgtApi {
} }
/**
* Update an existing worker cluster.
* @param {String} clusterId
* @param {module:model/WorkerCluster} workerCluster The updated worker cluster.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
updateWorkerClusterWithHttpInfo(clusterId, workerCluster) {
let postBody = workerCluster;
// verify the required parameter 'clusterId' is set
if (clusterId === undefined || clusterId === null) {
throw new Error("Missing the required parameter 'clusterId' when calling updateWorkerCluster");
}
// verify the required parameter 'workerCluster' is set
if (workerCluster === undefined || workerCluster === null) {
throw new Error("Missing the required parameter 'workerCluster' when calling updateWorkerCluster");
}
let pathParams = {
'cluster_id': clusterId
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = null;
return this.apiClient.callApi(
'/api/v3/worker-mgt/cluster/{cluster_id}', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Update an existing worker cluster.
* @param {String} clusterId
* @param {module:model/WorkerCluster} workerCluster The updated worker cluster.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
updateWorkerCluster(clusterId, workerCluster) {
return this.updateWorkerClusterWithHttpInfo(clusterId, workerCluster)
.then(function(response_and_data) {
return response_and_data.data;
});
}
} }

View File

@ -97,6 +97,9 @@ class Job {
if (data.hasOwnProperty('storage')) { if (data.hasOwnProperty('storage')) {
obj['storage'] = JobStorageInfo.constructFromObject(data['storage']); obj['storage'] = JobStorageInfo.constructFromObject(data['storage']);
} }
if (data.hasOwnProperty('worker_cluster')) {
obj['worker_cluster'] = ApiClient.convertToType(data['worker_cluster'], 'String');
}
if (data.hasOwnProperty('id')) { if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String'); obj['id'] = ApiClient.convertToType(data['id'], 'String');
} }
@ -166,6 +169,12 @@ Job.prototype['submitter_platform'] = undefined;
*/ */
Job.prototype['storage'] = undefined; Job.prototype['storage'] = undefined;
/**
* Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job.
* @member {String} worker_cluster
*/
Job.prototype['worker_cluster'] = undefined;
/** /**
* UUID of the Job * UUID of the Job
* @member {String} id * @member {String} id
@ -239,6 +248,11 @@ SubmittedJob.prototype['submitter_platform'] = undefined;
* @member {module:model/JobStorageInfo} storage * @member {module:model/JobStorageInfo} storage
*/ */
SubmittedJob.prototype['storage'] = undefined; SubmittedJob.prototype['storage'] = undefined;
/**
* Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job.
* @member {String} worker_cluster
*/
SubmittedJob.prototype['worker_cluster'] = undefined;
// Implement JobAllOf interface: // Implement JobAllOf interface:
/** /**
* UUID of the Job * UUID of the Job

View File

@ -81,6 +81,9 @@ class SubmittedJob {
if (data.hasOwnProperty('storage')) { if (data.hasOwnProperty('storage')) {
obj['storage'] = JobStorageInfo.constructFromObject(data['storage']); obj['storage'] = JobStorageInfo.constructFromObject(data['storage']);
} }
if (data.hasOwnProperty('worker_cluster')) {
obj['worker_cluster'] = ApiClient.convertToType(data['worker_cluster'], 'String');
}
} }
return obj; return obj;
} }
@ -132,6 +135,12 @@ SubmittedJob.prototype['submitter_platform'] = undefined;
*/ */
SubmittedJob.prototype['storage'] = undefined; SubmittedJob.prototype['storage'] = undefined;
/**
* Worker Cluster that should execute this job. When a cluster ID is given, only Workers in that cluster will be scheduled to work on it. If empty or ommitted, all workers can work on this job.
* @member {String} worker_cluster
*/
SubmittedJob.prototype['worker_cluster'] = undefined;

View File

@ -13,6 +13,7 @@
import ApiClient from '../ApiClient'; import ApiClient from '../ApiClient';
import WorkerAllOf from './WorkerAllOf'; import WorkerAllOf from './WorkerAllOf';
import WorkerCluster from './WorkerCluster';
import WorkerStatus from './WorkerStatus'; import WorkerStatus from './WorkerStatus';
import WorkerStatusChangeRequest from './WorkerStatusChangeRequest'; import WorkerStatusChangeRequest from './WorkerStatusChangeRequest';
import WorkerSummary from './WorkerSummary'; import WorkerSummary from './WorkerSummary';
@ -101,6 +102,9 @@ class Worker {
if (data.hasOwnProperty('task')) { if (data.hasOwnProperty('task')) {
obj['task'] = WorkerTask.constructFromObject(data['task']); obj['task'] = WorkerTask.constructFromObject(data['task']);
} }
if (data.hasOwnProperty('clusters')) {
obj['clusters'] = ApiClient.convertToType(data['clusters'], [WorkerCluster]);
}
} }
return obj; return obj;
} }
@ -162,6 +166,12 @@ Worker.prototype['supported_task_types'] = undefined;
*/ */
Worker.prototype['task'] = undefined; Worker.prototype['task'] = undefined;
/**
* Clusters of which this Worker is a member.
* @member {Array.<module:model/WorkerCluster>} clusters
*/
Worker.prototype['clusters'] = undefined;
// Implement WorkerSummary interface: // Implement WorkerSummary interface:
/** /**
@ -209,6 +219,11 @@ WorkerAllOf.prototype['supported_task_types'] = undefined;
* @member {module:model/WorkerTask} task * @member {module:model/WorkerTask} task
*/ */
WorkerAllOf.prototype['task'] = undefined; WorkerAllOf.prototype['task'] = undefined;
/**
* Clusters of which this Worker is a member.
* @member {Array.<module:model/WorkerCluster>} clusters
*/
WorkerAllOf.prototype['clusters'] = undefined;

View File

@ -12,6 +12,7 @@
*/ */
import ApiClient from '../ApiClient'; import ApiClient from '../ApiClient';
import WorkerCluster from './WorkerCluster';
import WorkerTask from './WorkerTask'; import WorkerTask from './WorkerTask';
/** /**
@ -66,6 +67,9 @@ class WorkerAllOf {
if (data.hasOwnProperty('task')) { if (data.hasOwnProperty('task')) {
obj['task'] = WorkerTask.constructFromObject(data['task']); obj['task'] = WorkerTask.constructFromObject(data['task']);
} }
if (data.hasOwnProperty('clusters')) {
obj['clusters'] = ApiClient.convertToType(data['clusters'], [WorkerCluster]);
}
} }
return obj; return obj;
} }
@ -95,6 +99,12 @@ WorkerAllOf.prototype['supported_task_types'] = undefined;
*/ */
WorkerAllOf.prototype['task'] = undefined; WorkerAllOf.prototype['task'] = undefined;
/**
* Clusters of which this Worker is a member.
* @member {Array.<module:model/WorkerCluster>} clusters
*/
WorkerAllOf.prototype['clusters'] = undefined;

View File

@ -0,0 +1,91 @@
/**
* Flamenco manager
* Render Farm manager API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The WorkerCluster model module.
* @module model/WorkerCluster
* @version 0.0.0
*/
class WorkerCluster {
/**
* Constructs a new <code>WorkerCluster</code>.
* Cluster of workers. A job can optionally specify which cluster it should be limited to. Workers can be part of multiple clusters simultaneously.
* @alias module:model/WorkerCluster
* @param name {String}
*/
constructor(name) {
WorkerCluster.initialize(this, name);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, name) {
obj['name'] = name;
}
/**
* Constructs a <code>WorkerCluster</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/WorkerCluster} obj Optional instance to populate.
* @return {module:model/WorkerCluster} The populated <code>WorkerCluster</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new WorkerCluster();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('description')) {
obj['description'] = ApiClient.convertToType(data['description'], 'String');
}
}
return obj;
}
}
/**
* UUID of the cluster. Can be ommitted when creating a new cluster, in which case a random UUID will be assigned.
* @member {String} id
*/
WorkerCluster.prototype['id'] = undefined;
/**
* @member {String} name
*/
WorkerCluster.prototype['name'] = undefined;
/**
* @member {String} description
*/
WorkerCluster.prototype['description'] = undefined;
export default WorkerCluster;

View File

@ -0,0 +1,74 @@
/**
* Flamenco manager
* Render Farm manager API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The WorkerClusterChangeRequest model module.
* @module model/WorkerClusterChangeRequest
* @version 0.0.0
*/
class WorkerClusterChangeRequest {
/**
* Constructs a new <code>WorkerClusterChangeRequest</code>.
* Request to change which clusters this Worker is assigned to.
* @alias module:model/WorkerClusterChangeRequest
* @param clusterIds {Array.<String>}
*/
constructor(clusterIds) {
WorkerClusterChangeRequest.initialize(this, clusterIds);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, clusterIds) {
obj['cluster_ids'] = clusterIds;
}
/**
* Constructs a <code>WorkerClusterChangeRequest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/WorkerClusterChangeRequest} obj Optional instance to populate.
* @return {module:model/WorkerClusterChangeRequest} The populated <code>WorkerClusterChangeRequest</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new WorkerClusterChangeRequest();
if (data.hasOwnProperty('cluster_ids')) {
obj['cluster_ids'] = ApiClient.convertToType(data['cluster_ids'], ['String']);
}
}
return obj;
}
}
/**
* @member {Array.<String>} cluster_ids
*/
WorkerClusterChangeRequest.prototype['cluster_ids'] = undefined;
export default WorkerClusterChangeRequest;

View File

@ -0,0 +1,72 @@
/**
* Flamenco manager
* Render Farm manager API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import WorkerCluster from './WorkerCluster';
/**
* The WorkerClusterList model module.
* @module model/WorkerClusterList
* @version 0.0.0
*/
class WorkerClusterList {
/**
* Constructs a new <code>WorkerClusterList</code>.
* @alias module:model/WorkerClusterList
*/
constructor() {
WorkerClusterList.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>WorkerClusterList</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/WorkerClusterList} obj Optional instance to populate.
* @return {module:model/WorkerClusterList} The populated <code>WorkerClusterList</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new WorkerClusterList();
if (data.hasOwnProperty('clusters')) {
obj['clusters'] = ApiClient.convertToType(data['clusters'], [WorkerCluster]);
}
}
return obj;
}
}
/**
* @member {Array.<module:model/WorkerCluster>} clusters
*/
WorkerClusterList.prototype['clusters'] = undefined;
export default WorkerClusterList;

View File

@ -1,5 +1,8 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { WorkerMgtApi } from '@/manager-api';
import { getAPIClient } from "@/api-client";
// 'use' prefix is idiomatic for Pinia stores. // 'use' prefix is idiomatic for Pinia stores.
// See https://pinia.vuejs.org/core-concepts/ // See https://pinia.vuejs.org/core-concepts/
export const useWorkers = defineStore('workers', { export const useWorkers = defineStore('workers', {
@ -11,6 +14,12 @@ export const useWorkers = defineStore('workers', {
* @type {string} * @type {string}
*/ */
activeWorkerID: "", activeWorkerID: "",
/** @type {API.WorkerCluster[]} */
clusters: [],
/* Mapping from cluster UUID to API.WorkerCluster. */
clustersByID: {},
}), }),
actions: { actions: {
setActiveWorkerID(workerID) { setActiveWorkerID(workerID) {
@ -37,5 +46,23 @@ export const useWorkers = defineStore('workers', {
activeWorkerID: "", activeWorkerID: "",
}); });
}, },
/**
* Fetch the available worker clusters from the Manager.
*
* @returns a promise.
*/
refreshClusters() {
const api = new WorkerMgtApi(getAPIClient());
return api.fetchWorkerClusters()
.then((resp) => {
this.clusters = resp.clusters;
let clustersByID = {};
for (let cluster of this.clusters) {
clustersByID[cluster.id] = cluster;
}
this.clustersByID = clustersByID;
})
},
}, },
}) })