Apeman model service client SDK
Project description
This library enables you to report the status of tasks in your model at runtime
publish:
python setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
install: pip install apeman-model-client==0.1.8
How to use
export apeman_meta_server_addr='localhost:9090'
from apeman.model.openapi import apeman_open_api_client
from apeman.model.openapi.model_instance_task_status import TaskStatus
from apeman.model.openapi.model_instance_task_launch_type import TaskLaunchType
from apeman.model.openapi.model_instance_task_type import TaskType
endpoint = apeman_open_api_client.get_endpoint(model_instance_id='')
# cancel task
apeman_open_api_client.cancel_task(task_id='', force_delete=True, token='')
# report status
response = apeman_open_api_client.report_and_get_status(task_id='', status=TaskStatus.RUNNING, progress=0.1,
message='Task is running', token='')
if response.status == TaskStatus.CANCELED:
raise Exception('Task already has been canceled.')
# add instance task
apeman_open_api_client.add_model_instance_task(model_instance_id='', tenant_id='', task_token='', task_parameters='',
job_context='', start_time=1, end_time=2,
launch_type=TaskLaunchType.TASK_ADHOC, task_type=TaskType.TASK_TRAIN)
# get instance task
task = apeman_open_api_client.get_instance_task(model_instance_task_id='test', token='token')
print(task.taskProgress)
print(task.taskMessage)
print(task.taskStatus)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for apeman-model-client-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a875b0ae3c911cae05bef1fe535372c3057050a2a25b72fb1f8b3754031250 |
|
MD5 | 837b09ea870614c5be405f7d5a332568 |
|
BLAKE2b-256 | 6d5e30e8553a6ef6cf6f9343482e550651189a5ba03847ccf88e469073865be4 |
Close
Hashes for apeman_model_client-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f33db150bb91f99d144a499b4d78547b9ed6d5bad5f6948731f4d551584f8db |
|
MD5 | 747182af928f619a37c386bf87df1540 |
|
BLAKE2b-256 | 81c88f85ae43b57d328a353638b889b8f892df8d4a8fe69f38e353b1f4c2e464 |