- Notifications
You must be signed in to change notification settings - Fork13
⛔️ DEPRECATED - IBM Cloud Functions Python Runtime
License
ibm-functions/runtime-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
IBM Cloud Functions reached end of life and this repository is no longer active.
For Apache OpenWhisk visit:https://github.com/apache/openwhisk.
- The runtime providespython v3.11 with a set ofpython packages, seepython3.11/CHANGELOG.md
- The runtime providespython v3.9 with a set ofpython packages, seepython3.9/CHANGELOG.md
Some of the python packages are to be used onIBM Cloud:
- IBM DB2/DashDB and IBM Informix - Python SDKibm_db
- IBM Cloudant - Python SDKcloudant
- IBM Watson Developer Cloud - Python SDKwatson-developer-cloud
- IBM Cloud Object Storage - Python SDKibm-cos-sdk
- IBM Cloud SQL Query service - Python Clientibmcloudsql
Docker runtime is based on Debian/Ubuntu
Write a function usingApache OpenWhisk Serverless programming inteface
defmain(args):name=args.get("name","stranger")greeting="Hello "+name+"!"print(greeting)return {"greeting":greeting}
To use as a python kind action
bx wsk action update helloPython hello.py --kind python:3.11To use as a docker action
bx wsk action update helloPython hello.py --docker ibmfunctions/action-python-v3.11This works on any deployment of Apache OpenWhisk or IBM Cloud Functions
Prerequisite:Export OPENWHISK_HOME to point to youropenwhisk cloned directory.
./gradlew python3:distDockerThis will produce the imagewhisk/action-python-v3.11
Build and Push image
docker login./gradlew python3.11:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.ioDeploy OpenWhisk using ansible environment that adds the new kingpython:3Assuming you have OpenWhisk already deploy localy andOPENWHISK_HOME pointing to root directory of OpenWhisk core repository.
SetROOTDIR to the root directory of this repository.
Redeploy OpenWhisk
cd $OPENWHISK_HOME/ansibleANSIBLE_CMD="ansible-playbook -i ${ROOTDIR}/ansible/environments/local"$ANSIBLE_CMD setup.yml$ANSIBLE_CMD couchdb.yml$ANSIBLE_CMD initdb.yml$ANSIBLE_CMD wipe.yml$ANSIBLE_CMD openwhisk.ymlTo use as docker action push to your own dockerhub account
docker tag whisk/action-python-v3 $user_prefix/action-python-v3docker push $user_prefix/action-python-v3Then create the action using your the image from dockerhub
wsk action update myAction myAction.py --docker $user_prefix/action-python-v3The$user_prefix is usually your dockerhub user id.
Install dependencies from the root directory on $OPENWHISK_HOME repository
./gradlew installUsing gradle to run all tests
./gradlew :tests:testUsing gradle to run some tests
./gradlew :tests:test --tests *ActionContainerTests*Using IntelliJ:
- Import project as gradle project.
- Make sure working directory is root of the project/repo
To use as docker action push to your own dockerhub account
docker tag whisk/action-python-v3 $user_prefix/action-python-v3docker push $user_prefix/action-python-v3Then create the action using your the image from dockerhub
wsk action update myAction myAction.py --docker $user_prefix/action-python-v3The$user_prefix is usually your dockerhub user id.
- Check if there is a new version for Python 3.11python:3.11-stretch.
- If there is a new version check that the tag used inpython3.11/Dockerfile is using the latest tag foropenwhisk/actionloop-python-v3.11
- Update the ibm imagepython3.11/Dockerfile FROM usign the new upstream tag
- Check if there are new pip packages available
- Use the latest released image to check the outdated pip packages
docker run --rm -it ibmfunctions/action-python-v3.11:1.4.0 sh -c "pip list --outdated"
- Check if there are new pip packages available
- Use the latest released image to check the outdated pip packages
docker run --rm -it ibmfunctions/action-python-v3.9:1.1.0 sh -c "pip list --outdated"- Updatepython3.9/requirements.txt only minor and patch levels.
- Updatepython3.9/CHANGELOG.md
- After the PR is merged and the master pass the build, checkout master.
- Create tag for each runtime and push upstream
git tag 3.11@<new version>git push upstream 3.11@<new version>- After the image is deployed to production update the
latesttag for each runtime.
git tag 3.11@latest -fgit push upstream 3.11@latest -fAbout
⛔️ DEPRECATED - IBM Cloud Functions Python Runtime
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.