Comments (16)
You can try the approach outlined here (once you have a binary you can create an action from it).
EDIT: apparently forgot to provide the link. Thanks @csantanapr (See below).
from openwhisk.
@rabbah you meant to share this link Understanding and using Docker actions in IBM Bluemix OpenWhisk that explains how to create a zip with a binary exe so @firasalmanna can use it to create an exec with python.
from openwhisk.
Want to reach out to us on http://slack.openwhisk.org and we can work through it directly?
from openwhisk.
The interesting part will be handling the requirements compiling. Lambda currently punts on this and requires users to upload all the packages (compiled) as part of their code. The problem is if I'm a mac user and compile lxml, it won't run on lambda because it's Amazon Linux. At the most basic level, having whisk run a 'pip install' (maybe even create a virtualenv) of a requirements.txt to get/compile required actions for the user would be big. That's basically what cloud foundry does in it's python buildpack.
from openwhisk.
I think we can close this for now. Python has been working with basic tests for a while.
from openwhisk.
@ioana-blue Could you respond to the comment #16 (comment)
from @vmtyler about how "handling the requirements compiling"?
from openwhisk.
For now, our solution is similar to the javascript one. We support a series of packages that are (should be) documented. At some point, we may consider a more generalized solution similar to "build packs". @vmtyler
from openwhisk.
Hello,
Is it possible to use packaged python actions? if yes, any tutorials?
from openwhisk.
@firasalmanna not an official solution yet. One option is compiling the python to a native binary which you can do with bbfreeze
or maybe grumpy
(https://github.com/google/grumpy)`. Which packages are you looking at?
from openwhisk.
@rabbah
I am trying to upload a project I am working on, requirements file attached. the requirements can be reduced as I am dividing my app into microservices, so each will have a subset of these requirements.
So after compiling my app into binary, how am I going to upload it? I don't think I saw this option in the docs.
from openwhisk.
Hello guys,
I am having a problem after generating an executable and pushing it to openwhisk.
1- I made and executable out of my python app, I tested it locally and then tried to create an openwhisk action from it using the steps in the blog post. When I tried to invoke it, I got the message [Errno 2] No such file or directory
2- I tried to create a docker image, I used dockerskeleton
as the base image, I copied my exec
to action/exec
, I built the image and pushed it, then why I invoked the openwhisk action created from my image, I also received the same error [Errno 2] No such file or directory
.
I browsed the docker image files, and I found the exec
file in the action
directory.
Do you have an idea what could be the problem?
from openwhisk.
If you can exec into the container, did you run the /action/exec
directly to confirm it works?
from openwhisk.
No, I couldn't run it, I also got No such file or directory
And after some investigation, I think that the executable I generate using pyinstaller
is 32-bit
because pyinstaller
generates 32-bit
executable for python 2.7
, which I am using.
Then, I found that I can execute 32 on 64 bit if there is the dynamic loader /lib/ld-linux.so.2
. But I couldn't find it for alpine-linux
using apk add
.
The only options I have now is to find a different package for alpine
that executes 32-bit, or to try to generate a 64-bit exec again.
from openwhisk.
@firasalmanna what about using the approach of using bash script exec and then from bash script and then tun setup/unit and run python script (i.e. Not compiled)
Maybe I missed that you already tried this.
from openwhisk.
Here's another tip following Carlos: you can use this approach with nodejs actions. That is build your binary using the nodejs actio base image if it helps and then call it from a node action.
from openwhisk.
@csantanapr no I didn't try this approach. I might give it a try.
But first I am thinking if trying the approach from this link https://github.com/iainhouston/dockerPython
He is renamed his python script test.py
to exec
, and he put it in the action directory, and everything else is the same. He also copied all his other classes to the action directory.
Do you think this should work?
@rabbah do you mean running my script from nodejs? or using this approach to run a nodejs app?
from openwhisk.
Related Issues (20)
- Questions about the duration of function calls limited by the nginx gateway HOT 18
- Action failure when the function takes a long time to execute
- Memory leak in `akka.actor.LocalActorRef` HOT 14
- Multi-runtime tests keep failing HOT 5
- waht' is the rule of autoscaler HOT 1
- Error while trying to run `ansible-playbook -i environments/$ENVIRONMENT routemgmt.yml` HOT 2
- use Apache Pekko instead of Akka HOT 2
- Missed config keys on Scala 2.13.x
- Invocation-level fault tolerance guarantees HOT 6
- GPU support for OpenWhisk Actions HOT 1
- OpenWhisk Releases HOT 3
- AkkaContainerClient breaks the ConcurrentTests of nodejs runtime HOT 2
- Deployment Components HOT 5
- The openwhisk is incompatible with java version higher than 16
- Web function 400 Bad Request HOT 1
- Package-installer-pod not-completed on Minikube
- The connection failed, or timed out. (HTTP status code 500) and There was an internal server error.
- How to correctly modify OpenWhisk’s gateway blocking limit from source code (currently 60s) HOT 13
- Ubuntu 22.04 Serve Install issue HOT 1
- Local ansible deployment API gateway error 502
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openwhisk.