Creation pipeline ================= #) It is required a zip archive with the lambda; see `lambda creation description and requirements `_ for details. #) The first stage of lambda creation is Docker image creation. Granted zip archive will be supplemented by several files and transformed into another archive which will be stored in `s3 storage <./lambda_requirements.html#s3-storage-requirements>`_. In the next step, the archive from s3 will be used by `kaniko tool `_ which allows building images in kubernetes cluster independently on `kubernetes container runtime `_. There are resource limits for each Docker image build job, which can be specified by changing the LUNA_LAMBDA_BUILD_LIMITS setting in the `service configuration <./config.html#configuration-requirements>`_. For more information about resource limits, see `resource units in kubernetes `_. It is possible to `get lambda image creation status <./_static/api.html#operation/getLambdaImageStatus>`_ during image creation. Below is a table with possible image creation statuses: +-------------+-------------------------------------------------+ | status | description | +=============+=================================================+ | in_progress | image creation in progress | +-------------+-------------------------------------------------+ | error | an error occurred during image creation | +-------------+-------------------------------------------------+ | completed | image creation completed but not cleaned up yet | +-------------+-------------------------------------------------+ | not_found | image creation complete and cleaned up | +-------------+-------------------------------------------------+ | pending | image creation waiting for suitable conditions | +-------------+-------------------------------------------------+ If any error occurred during image creation it is possible to `get lambda image creation logs <./_static/api.html#operation/getLambdaImageCreationLogs>`_ to find and resolve the problem. It is highly recommended to `delete lambda <./_static/api.html#operation/deleteLambda>`_ before making the next attempt of lambda creation. During lambda image creation, `lambda status <./_static/api.html#operation/getLambdaStatus>`_ is `waiting`. Completely created image will be pushed to the registry (`LAMBDA_REGISTRY` specified in the `service configuration <./config.html#configuration-requirements>`_). There are several requirements to make this actions possible, see `environment requirements <./lambda_requirements.html>`_ for details. During docker image creation there will be one pod named `pod/kaniko-lambda-` in kubernetes cluster, where lambda id matches the lambda id available by user from `luna-lambda` service. #) The second stage of lambda creation is to create a service in the kubernetes cluster. It is possible to set replicas count for lambda in `pod_count` parameter in `deploy_parameters`. See `create lambda <./_static/api.html#operation/createLambda>`_ for more details. Each lambda pod is one replica, see `Kubernetes documentation `_ for more information about deployment replicas. This stage will be executed automatically after image creation is completed. During lambda creation, it is not possible to `get lambda image creation status <./_static/api.html#operation/getLambdaImageStatus>`_ or `get lambda image creation logs <./_static/api.html#operation/getLambdaImageCreationLogs>`_. During lambda creation, it is possible to `get lambda status <./_static/api.html#operation/getLambdaStatus>`_. Below is a table with possible lambda statuses: +------------+----------------------------------------+ | status | description | +============+========================================+ | running | lambda running | +------------+----------------------------------------+ | waiting | waiting for lambda to start | +------------+----------------------------------------+ | terminated | lambda stopped | +------------+----------------------------------------+ | not_found | lambda not found in kubernetes cluster | +------------+----------------------------------------+ | pending | lambda waiting for suitable conditions | +------------+----------------------------------------+ The `running` status is returned when at least one pod in lambda's replicas pods is running or when there is only one lambda pod and it's running. The `waiting` status is also returned when all pods in the lambda's replicas have been created but are still starting up. The response will include `pod_statuses` object if at least one of lambda's pods is in `running` status. If any error during lambda creation/initialization, it is possible to `get lambda logs <./_static/api.html#operation/getLambdaLogs>`_ to find and resolve the problem. If lambda status is pending it means that there is no suitable conditions for such lambda, for example lambda requires GPU and kubernetes cluster cannot provides GPU for lambda. If lambda status is terminated and no logs can be found, it is most likely that there are several problems with registry access from the kubernetes cluster and/or some permission issues. Completely created service will have `running` status. After lambda creation successfully completed kubernetes cluster will contain replicaset, deployment, service and pod named `lambda-` where lambda id matches the lambda id available by user from `luna-lambda` service.