All Projects → apache → openwhisk-runtime-python

apache / openwhisk-runtime-python

Licence: Apache-2.0 license
Apache OpenWhisk Runtime Python supports Apache OpenWhisk functions written in Python

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
scala
5932 projects
Dockerfile
14818 projects
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to openwhisk-runtime-python

openwhisk-runtime-go
Apache OpenWhisk Runtime Go supports Apache OpenWhisk functions written in Go
Stars: ✭ 31 (-20.51%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service, openwhisk-runtime
openwhisk-runtime-docker
Apache OpenWhisk SDK for building Docker "blackbox" runtimes
Stars: ✭ 23 (-41.03%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service, openwhisk-runtime
openwhisk-runtime-java
Apache OpenWhisk Runtime Java supports Apache OpenWhisk functions written in Java and other JVM-hosted languages
Stars: ✭ 43 (+10.26%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service, openwhisk-runtime
openwhisk-runtime-dotnet
Apache OpenWhisk Runtime .Net supports Apache OpenWhisk functions written in .Net languages
Stars: ✭ 23 (-41.03%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service, openwhisk-runtime
Openwhisk
Apache OpenWhisk is an open source serverless cloud platform
Stars: ✭ 5,499 (+14000%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service
Openwhisk Runtime Php
Apache OpenWhisk Runtime PHP supports Apache OpenWhisk functions written in PHP
Stars: ✭ 26 (-33.33%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, functions-as-a-service
Openwhisk Deploy Kube
The Apache OpenWhisk Kubernetes Deployment repository supports deploying the Apache OpenWhisk system on Kubernetes and OpenShift clusters.
Stars: ✭ 231 (+492.31%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, functions-as-a-service
Openwhisk Runtime Nodejs
Apache OpenWhisk Runtime NodeJS supports Apache OpenWhisk functions written in JavaScript for NodeJS
Stars: ✭ 43 (+10.26%)
Mutual labels:  functions, apache, faas, serverless-functions, serverless-architectures, functions-as-a-service
openwhisk-package-kafka
Apache OpenWhisk package for communicating with Kafka or Message Hub
Stars: ✭ 35 (-10.26%)
Mutual labels:  apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service
openwhisk-catalog
Curated catalog of Apache OpenWhisk packages to interface with event producers and consumers
Stars: ✭ 30 (-23.08%)
Mutual labels:  apache, faas, serverless-functions, serverless-architectures, openwhisk, functions-as-a-service
Openwhisk Devtools
Development tools for building and deploying Apache OpenWhisk
Stars: ✭ 141 (+261.54%)
Mutual labels:  functions, apache, faas, serverless-functions, functions-as-a-service
Openwhisk Apigateway
Apache OpenWhisk API Gateway service for exposing actions as REST interfaces.
Stars: ✭ 56 (+43.59%)
Mutual labels:  apache, faas, serverless-functions, serverless-architectures, functions-as-a-service
Openwhisk Cli
Apache OpenWhisk Command Line Interface (CLI)
Stars: ✭ 73 (+87.18%)
Mutual labels:  functions, apache, faas, serverless-functions, functions-as-a-service
Fission
Fast and Simple Serverless Functions for Kubernetes
Stars: ✭ 6,646 (+16941.03%)
Mutual labels:  functions, faas, serverless-functions, functions-as-a-service
Faas
OpenFaaS - Serverless Functions Made Simple
Stars: ✭ 20,820 (+53284.62%)
Mutual labels:  functions, faas, serverless-functions, functions-as-a-service
Gofn
Function process via docker provider (serverless minimalist)
Stars: ✭ 134 (+243.59%)
Mutual labels:  functions, faas, functions-as-a-service
Jazz
Platform to develop and manage serverless applications at an enterprise scale!
Stars: ✭ 254 (+551.28%)
Mutual labels:  faas, serverless-architectures, functions-as-a-service
openfaas-rstats-templates
OpenFaaS templates for R
Stars: ✭ 17 (-56.41%)
Mutual labels:  functions, faas, functions-as-a-service
Faas Netes
Serverless on Kubernetes with OpenFaaS
Stars: ✭ 1,875 (+4707.69%)
Mutual labels:  functions, faas
Composer
Composer is a new programming model for composing cloud functions built on Apache OpenWhisk.
Stars: ✭ 131 (+235.9%)
Mutual labels:  functions, faas

Apache OpenWhisk Runtimes for Python

License Build Status

This repository contains sources files needed to build the Python runtimes for Apache OpenWhisk. The build system will produce a series of docker images for each runtime version. These images are used in the platform to execute Python actions.

The following Python runtime versions (with kind & image labels) are generated by the build system:

  • Python 3.7 (python:3.7 & openwhisk/action-python-v3.7)
  • Python 3.9 (python:3.9 & openwhisk/action-python-v3.9)
  • Python 3.6 AI (python:3.6 & openwhisk/action-python-v3.6-ai)

This README documents the build, customization and testing of these runtime images.

To learn more about using Python actions to build serverless applications, check out the main project documentation here.

Build Runtimes

There are two options to build the Python runtime:

  • Building locally: tutorial
  • Using OpenWhisk Actions.

Building Python Runtime using OpenWhisk Actions

Pre-requisites

The runtimes are built using Gradle. The file settings.gradle lists the images that are built by default.

To build all those images, run the following command.

./gradlew distDocker

You can optionally build a specific image by modifying the gradle command. For example:

./gradlew core:python3Action:distDocker

The build will produce Docker images such as action-python-v3.7 and will also tag the same image with the whisk/ prefix. The latter is a convenience, which if you're testing with a local OpenWhisk stack, allows you to skip pushing the image to Docker Hub.

The image will need to be pushed to Docker Hub if you want to test it with a hosted OpenWhisk installation.

Using Gradle to push to a Docker Registry

The Gradle build parameters dockerImagePrefix and dockerRegistry can be configured for your Docker Registry. Make sure you are logged in first with the docker CLI.

  • Use the docker CLI to login. The following assumes you will substitute $DOCKER_USER with an appropriate value.

    docker login --username $DOCKER_USER
    
  • Now build, tag and push the image accordingly.

    ./gradlew distDocker -PdockerImagePrefix=$DOCKER_USER -PdockerRegistry=docker.io
    

Using Your Image as an OpenWhisk Action

You can now use this image as an OpenWhisk action. For example, to use the image action-python-v3.7 as an action runtime, you would run the following command.

wsk action update myAction myAction.py --docker $DOCKER_USER/action-python-v3.7

Test Runtimes

There are suites of tests that are generic for all runtimes, and some that are specific to a runtime version. To run all tests, there are two steps.

First, you need to create an OpenWhisk snapshot release. Do this from your OpenWhisk home directory.

./gradlew install

Now you can build and run the tests in this repository.

./gradlew tests:test

Gradle allows you to selectively run tests. For example, the following command runs tests which match the given pattern and excludes all others.

./gradlew :tests:test --tests Python*Tests

Python 3 AI Runtime

This action runtime enables developers to create AI Services with OpenWhisk. It comes with preinstalled libraries useful for running Machine Learning and Deep Learning inferences. Read more about this runtime here.

Using additional python libraries

If you need more libraries for your Python action, you can include a virtualenv in the zip file of the action.

The requirement is that the zip file must have a subfolder named virtualenv with a script virtualenv\bin\activate_this.py working in an Linux AMD64 environment. It will be executed at start time to use your extra libraries.

Using requirements.txt

Python virtual environments are typically built by installing dependencies listed in a requirements.txt file. If you have an action that requires additional libraries, you can include a requirements.txt file.

You have to create a folder myaction with at least two files:

__main__.py
requirements.txt

Then zip your action and deploy to OpenWhisk, the requirements will be installed for you at init time, creating a suitable virtualenv.

Keep in mind that resolving requirements involves downloading and install software, so your action timeout limit may need to be adjusted accordingly. Instead, you should consider using precompilation to resolve the requirements at build time.

Precompilation of a virtualenv

The action containers can actually generate a virtualenv for you, provided you have a requirements.txt.

If you have an action in the format described before (with a requirements.txt) you can build the zip file with the included files with:

zip -j -r myaction | docker run -i action-python-v3.7 -compile main > myaction.zip

You may use v3.9 or v3.6-ai as well according to your Python version needs.

The resulting action includes a virtualenv already built for you and that is fast to deploy and start as all the dependencies are already resolved. Note that there is a limit on the size of the zip file and this approach will not work for installing large libraries like Pandas or Numpy, instead use the provide "v.3.6-ai" runtime instead which provides these libraries already for you.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].