Failure to install C extension of a third party library at GAE python Flexible Environment - google-app-engine-python

I've deployed my application on the Google App Engine python flexible runtime environment.
I thought to use a library (named as shap) which used to retrieve feature importance from the Random Forest model. I've mentioned its name in the requirement.txt while deploying to app engine.
I also noticed that the installation of c extension(dependency of shap library) has mentioned in the setup file of shap library.
Google Cloud App Engine (Flexible) is supposed to install this library with all dependencies including c extension, but when I run my application on the app engine, it starts getting following error:
name '_cext' is not defined.
here _cext is a c extension.
This library is working fine locally. It seems it has a problem with the app engine flexible environment.
Any help will be appreciated.

If the solution used locally relies exclusively on pip commands you may be able to use requirements.txt file options, see Requirements File Format.
But if you need something else besides executing pip operations then you probably have to build a custom runtime, see Up-to-date pip with AppEngine Python flex env?

Related

Using dialogflow library in App Engine Flexible Environment

I am trying to integrate Dialoogflow V2 into my Python/Django WebApp in GAE Flexible Environment. I have followed all the steps from here, here and here.
The integration works fine locally. Once deployed on the Cloud (no errors on deployment), the application doesnt seem to find the dialogflow library, and throws the error:
ModuleNotFoundError at / No module named 'dialogflow'
Is there anything missing ? How can I get the dialogflow library into GAE Flex ?
Okay.
The problem was that the appengine_config.py file was not understood by the GAE.
The documentation here (https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27#vendoring) is insufficient.
I included this (https://gist.github.com/jonparrott/4bdd7af14a676f33b099) in my appengine_config.py, excluding the imports of os.path and sys, and that did the trick !

Can a Yocto recipe be built using the SDK?

I have a Yocto project that takes quite some time to compile. The final image is meant to run my application and as such, I have a custom recipe in my own layer.
Since building the whole Yocto image takes a couple of ours, I do build an SDK so I can cross-compile my application and transfer the binary to the running device for testing.
Instead of compiling the binary and having to transfer it manually to the device,
can I use the Yocto recipe I've written for my application with the SDK so that I can "call" its do_package()? If other devs could build the .deb (assuming PACKAGE_CLASSES = "package_deb" in local.conf) simply from the SDK that could simplify greatly our workflow.
Thanks!
Huh, bluelightning beat me to the punch. That'll teach me for not hitting refresh. Anyhoo, here's my 2ยข:
Yes, have a look at devtool. The goal of the devtool script is to improve and simplify the development of software for target devices.
First, have your developers install the extensible SDK (eSDK), which is built using this command:
bitbake -c populate_sdk_ext my-image-name
Once you source this SDK, run these commands:
devtool modify my-recipe-name
...make your changes to [sdk]/workspace/source/my-recipe-name...
devtool build my-recipe-name
devtool package my-recipe-name
This should produce a package of your app in [sdk]/tmp/deploy/rpm/[arch]/my-recipe-name, which can then be deployed to the target machine.
Also, have a look at devtool deploy-target if your target machine has network connectivity.
If you give me some more details on your setup I may be able to help more. Hope this at least gets you pointed in the right direction.
This is really what the Extensible SDK is designed to do - provide a pre-built and pre-configured environment and allow you to build applications and other components in pretty much the same way they are built with the full build system. You can even deploy output files over to the target device easily if an ssh server is running on the target.
You can build the extensible SDK with the following command:
bitbake -c populate_sdk_ext <imagename>
For more information you may wish to read the new SDK manual.

How to create a UWP Package that`s shipping Microsoft.NET.CoreRuntime.1.0 with it

I`m struggling with the following issue:
I try to deploy my uwp app with a Mobile Device Management System (MobileIron). it's only accepts .appxbundle, no .appxupload files. When i try to install/deploy the app on a device, i get the error
Can not install package XY because the package xy has a dependency to Microsoft.NET.CoreRuntime.1.0. This package is needed for the installation. Deploy this Framework together with your package
(my custom translation ;) )
The problem is, I dont know how to create a package, that's shipping the needed CoreRuntime within. When i create a DEBUG Package, i get a appxbundle and a folder with the missing CoreRuntime.appx, but only the powershell script is shipping the CoreRuntime Framework to the Device, not the bundle itself.
When i create a RELEASE Package, it`s running agains .NET Native, in this case i have no CoreRuntime...
Hope i explained my problem good enought and someone can help me or give me a hind.
You need to enable .NET Native, From your Project Properties:
Make sure that your configuration is for Release. And check
Compile with .NET Native tool chain
and
Optimize code
finally make sure to create your packages from Store->Create App Packages. With the following configurations:

Parameters for release.sh to build binaries only for current platform

I'm trying to build Kubernetes from source using the release.sh script. However I can see that it build client and server binaries for many platforms which are not useful to me. How can I say release.sh to build binaries only for my platform? I can see that KUBE_SERVER_PLATFORMS and KUBE_CLIENT_PLATFORMS checks are done in hack/lib/golang.sh script. But how can I pass those values?
Unless you're looking to cross-compile, or specifically build a release, I'd recommend using hack/build-go.sh, it will pick the host platform for you and just build on that.

How do I create a build for a legacy system?

We are currently maintaining a Perl web application and we are slowly trying to bring it into the modern age.
We want to be able to build our application so that when a new developer comes along we can just give them a copy of the build and they can have a local copy of the application with minimal fuss.
Does anyone have any experience of creating a build for a legacy web application that could offer some pro tips?
Start by authoring an ordinary CPAN distribution, Perl modules go into lib etc. This is described in perlnewmod and the documents referenced in its section titled See also.
Use Module::Build as the build system. You extend it for the extra stuff you want to install, for example template files, this is described in the cookbook.