Skip to main content

Sermos Utils

Utilities for interacting with Sermos.

Deployments

Prerequisites

To deploy your application to Sermos, there are a few prerequisites:

  1. Deployment environment created and configured
  2. An access key has been issued for that deployment
  3. Your app is a valid Python package with a standard structure (see below)
  4. You have a sermos.yaml file written with your defined API endpoints, workers, etc.
  5. Your application has sermos-utils as a dependency and it's installed.

Deployment

You can initiate a Sermos deployment in two ways: programmatically or using the CLI tool.

It is recommended to keep your access key in the environment and to set the client package directory in the environment as well, for convenience.

SERMOS_ACCESS_KEY=abc123
SERMOS_CLIENT_PKG_NAME=your_package

Programmatic Deployment

Invoking a pipeline programmatically (e.g. as part of a build pipeline) can be done similar to below (assumes access key/client package directory are available in the environment per note above).

from sermos_utils.deploy import SermosDeploy

sd = SermosDeploy()
status = sd.invoke_deployment()
print(status)

CLI Deployment

For a cli-based deployment, there is a sermos_deploy command installed as part of the sermos-utils package.

honcho run -e .env sermos_deploy

Deployment Status

Assuming your environment is set up per notes in the Deployment section above:

Programmatic Status Checks

from sermos_utils.deploy import SermosDeploy

sd = SermosDeploy()
status = sd.get_deployment_status()
print(status)

CLI Status Checks

honcho run -e .env sermos_status

Proper Python Package Structure

Assuming your package is called "my_sermos_client":

/path/to/codebase/
    my-sermos-client/
        setup.py
        my_sermos_client/
            __init__.py
            sermos.yaml

my_sermos_client/__init__.py has only one requirement, to contain your application's version assigned as a variable __version__, e.g.:

__version__ = '0.1.0'

Common practice is to use that value in your setup.py file, e.g.

_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('my_sermos_client/__init__.py', 'rb') as f:
    __version__ = str(ast.literal_eval(_version_re.search(
        f.read().decode('utf-8')).group(1)))

Local Development

Sermos provides a local development environment in two ways:

  1. Local 'sandbox' environment
  2. Cloud-connected environment that proxies into your deployment's databases

See sermos-utils/dev/README.md for more information.

Testing

To run the tests you need to have pyenv running on your system and tox in your environment.

Refer to RhoAI documentation for instructions on installing pyenv correctly.

After pyenv is intalled, then install tox

$ pip install tox

Then install the different python versions in pyenv

$ pyenv install 3.7.4

Now, run the tests:

$ tox

Release files for sermos-utils 0.22.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sermos-utils 0.22.1
File Size Uploaded
sermos-utils-0.22.1.tar.gz 19.1 kB Details

Release files / sermos-utils-0.22.1.tar.gz

Download URL sermos-utils-0.22.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
169f19c202a7f9683c75c656ddeb8c9eddbf243712fcda6866aadf05677fb51b
BLAKE2b-256 checksum
How to use checksums
03bbaaa9f6e78418968798a719a7cfb2d6a66595ec13e62dcfeef6c1afaf32bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.22.1 This release

1 release file

0.21.0

1 release file

0.20.0

1 release file

0.19.0

1 release file

0.18.1

1 release file

0.18.0

1 release file

0.17.0

1 release file

0.16.1

1 release file

0.16.0

1 release file

0.15.1

1 release file

0.15.0

1 release file

0.14.0

1 release file

0.13.0

1 release file

0.12.0

1 release file

0.11.0

1 release file

0.10.0

1 release file

0.9.0

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page