SDK library for building services for the IVCAP platform
Project description
ivcap_sdk_service
SDK library for building services for the IVCAP platform
Installation
pip install ivcap_sdk_service
Usage
Below is the obligatory hello world service which simply writes a few messages to logging.
from typing import Dict
from ivcap_sdk_service import Service, Parameter, PythonWorkflow, Type, register_service
import logging
SERVICE = Service(
name = "HelloWorld",
description = "Simple service which does a few simple things",
parameters = [
Parameter(name="msg", type=Type.STRING, description="Message to echo"),
Parameter(name="times", type=Type.INT, default=2, description="Times to repeat"),
],
workflow = PythonWorkflow(min_memory='2Gi', min_cpu='500m', min_ephemeral_storage='4Gi')
)
def hello_world(args: Dict, logger: logging):
for i in range(args.times):
logger.info(f"({i + 1}) Hello {args.msg}")
register_service(SERVICE, hello_world)
For more useful examples see the examples directory.
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
ivcap_sdk_service
was created by Max Ott max.ott@csiro.au, Tim Erwin tim.erwin@csiro.au. See LICENSE for licensing terms.
Credits
ivcap_sdk_service
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
Development
Setup
conda create --name ivcap_service python=3.7 -y
conda activate ivcap_service
pip install poetry
Adding dependencies
For testing:
poetry add --group dev _lib_name_
Project details
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
Hashes for ivcap_sdk_service-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 387272298dc540c9c78bfe36f86f8d403ce5cad587279306d702f6abf2bc992b |
|
MD5 | b2d9a1d6043339b22a3796c44ce6e593 |
|
BLAKE2b-256 | 18de89752b26b4008b0e8ce761c9475b9c76f5bd9d2b1e734882f223558f829b |