Skip to content

Latest commit

 

History

History
85 lines (52 loc) · 2.48 KB

SUSE.rst

File metadata and controls

85 lines (52 loc) · 2.48 KB

Deployment

Pint Server is implemented as a Python Flask application. The Lambda functionality is being facilitated by the serverless-wsgi framework.

Pint Server is being deployed as an AWS Lambda function. Therefore, it will be released as a container image, which is based on SLE 15.2 with AWS Lambda Python 3.6 Runtime Interface Client (awslambdaric).

Packaging

Pint Server will be release as a typical Python package python-PintServerNG. In order to deploy it to AWS Lambda, we'll also need to package it as a container along with AWS Lambda Python runtime client. All the relevant packages are managed in the Devel:PubCloud:ProductionServices:pint project in IBS <https://build.suse.de/project/show/Devel:PubCloud:ProductionServices:pint>_.

Testing Pint Server Lamba Function Container Locally

  1. make sure both aws-sam-cli Python package is installed. If not, install it with pip.

    sudo pip install aws-sam-cli
    
  2. modify Dockerfile.sle15 file to include any local changes if necessary

  3. build the Pint Server Lambda function container image with make CLI. By default, the container image is based on the SLE 15.2 base image.

    make
    
  1. run serverless application

    ./bin/run_sam_local.sh
    
  2. open a separate terminal and test it with curl command

    .. code-black::
    
      curl http://127.0.0.1:5000/v1/providers
    
    

NOTE: to run the serverless application in debug mode, you can use the --debug flag. For example:

./bin/run_sam_local.sh --debug

How To Make A Release

  1. update pint_server/__init__.py '__VERSION__' attribute with the new version

  2. create a git annotated tag for the release version. For example:

    git tag -a v2.0.0 -m "Release 2.0.0"
    git push --tags
    
  3. checkout the python-PintServer package in Devel:PubCloud:ProductionServices:pint.

    isc bco Devel:PubCloud:ProductionServices:pint python-PintServer
    
  4. update both the version and revision values in the _service file

  5. update python-PintServer.spec with the new version and release

  6. submit the changes