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).
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>_.
make sure both aws-sam-cli Python package is installed. If not, install it with pip.
sudo pip install aws-sam-cli
modify Dockerfile.sle15 file to include any local changes if necessary
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
run serverless application
./bin/run_sam_local.sh
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
update pint_server/__init__.py '__VERSION__' attribute with the new version
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
checkout the python-PintServer package in Devel:PubCloud:ProductionServices:pint.
isc bco Devel:PubCloud:ProductionServices:pint python-PintServer
update both the version and revision values in the _service file
update python-PintServer.spec with the new version and release
submit the changes