Skip to main content

Sermos Utilities

Project description

Sermos Utils

Utilities for interacting with Sermos.



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

  1. Deployment environment created and configured
  2. A deploy 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.


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

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


Programmatic Deployment

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

from sermos_utils.deploy import SermosDeploy

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

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('{abc-123}')

CLI Status Checks

honcho run -e .env sermos_status {abc-123}

Proper Python Package Structure

Assuming your package is called "my_sermos_client":

my_sermos_client/ 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 file, e.g.

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


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

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sermos-utils, version 0.12.0
Filename, size File type Python version Upload date Hashes
Filename, size sermos-utils-0.12.0.tar.gz (13.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page