SciJob platform SDK for Python
Project description
SciJob SDK
Installation
Usages
You may first initialize a SciJob client:
from scijob import Client
cli = Client(api_key="your api key", api_base_url="your api base url")
Or go with the async version:
from scijob import AsyncClient
cli = AsyncClient(api_key="your api key", api_base_url="your api base url")
Register Functions
You may register a new function which sources from GitLab and with VolcEngine specifications as below:
from scijob.requests import *
resp = cli.register_function(
request=RegisterFunctionRequestBuilder()
.identity(key="func_key", name="some_func", module="some_module", version="0.0.1")
.description("This is a test function...")
.repo_source("gitlab")
.gitlab_repo_info(...)
.envs([("SOME_ENVIRONMENT_VARIABLE", "hello world")])
.volcengine_specs(specs=VolcEngineSpecsBuilder()
.credentials(ak="your access key", sk="your secret key")
.region("cn-beijing")
.image(...)
.num_cpus(4) # use 'num_gpus' instead if the function requires GPU resource
.vepfs(...)
.build()
)
.build()
)
print(resp.function_id)
#> 6a1b48027b0e2e9c9d3ad8c7
Call Functions
Below shows an example of calling a registered function by its ID, using with statements:
async with AsyncClient(api_key="your api key", api_base_url="your api base url") as cli:
job = await cli.call_function(
request=CallFunctionRequestBuilder()
.function_id("6a1b48027b0e2e9c9d3ad8c7")
.function_args(...)
.backend("volcengine_ml_platform")
.build()
)
res = await job.get_result()
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
scijob-0.1.0a1.tar.gz
(11.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
scijob-0.1.0a1-py3-none-any.whl
(14.9 kB
view details)
File details
Details for the file scijob-0.1.0a1.tar.gz.
File metadata
- Download URL: scijob-0.1.0a1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10ae6e7b1c1c21754d13cc9e579e0cbaf84e990ff2c1c6b656c774cb65e1a949
|
|
| MD5 |
d5560ebdd0582de4a340290d14a6ecbb
|
|
| BLAKE2b-256 |
f40df09bfeb26ce01b4ad44ad2e87fbd0104a53fc6996e2cf34fdabf8d022d97
|
File details
Details for the file scijob-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: scijob-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb60be9cd7b572ef01ce59392eb4cdad968cfd731a960bdb6d9e46530bc10016
|
|
| MD5 |
7b8e35894ef23ba78ebfd9676a5f2af1
|
|
| BLAKE2b-256 |
02642a9deab617a7237a557bfa5baf8965afdc0a3cd9f6da0765458600d56d58
|