Installing a package using Apt get for Google App Engine - google-app-engine

I was deploying an optical character recognition web application. However, I realized that one of the packages needed to be installed through apt-get rather than pip. I was wondering how I would go about doing this through google app engine? Just for reference, I would like to install:
sudo apt-get install tesseract-ocr

Have you tried to install pytesseract via pip and include it in you requirements.txt for the application you're planning to deploy on app engine (Standard or Flexible)?
If the utilization of the pytesseract package is not enough, you can try to deploy an App Engine Flex Custom Runtime service and specify the installation of this package in the Dockerfile for this service

Related

Best practice for installing node_modules for a reactjs app on Azure Linux Web App

I have a react(specifically NextJS) web app running on a Linux Azure Web App Server. I have it deployed and working correctly via GitHub Actions. However, I'm having issues finding the most efficient way to deploy the node_modules.
Here's what I've tried.
I've ran the install and build within GitHub Actions and deployed the package as a zip artifact. However, the file was huge due to the node_modules and takes 10+ minutes to deploy.
I've created a postDeploy script to run after deployment that runs an npm install. Not sure if this is the best way to go about it so I reverted this.
For the startup command, I have azure running npm run start:prod. I thought about changing this to npm install && npm run start:prod . I'm not sure if this is a good idea either
What I've settled on so far is I just manually get on the server and run npm install after a deployment. This won't work for CI/CD though.
I've read that azure kudu supposedly detects package.json within the wwwroot folder and will automagically install dependencies but I haven't seen this work, nor could I find any documentation on it. So far, my best idea seems to be to change my startup command to run an install before starting the app but I'm not sure.
Any advice?
There shouldn't be a big difference between GitHub Action and Azure DevOps in that terms. But what should you do actually on your pipeline is run npm run build command and publish only produced output.
Please take a look here how it looks on Azure DevOps.

How can i install software in Google App Engine Standard Environment

I want to install libmagickwand-dev inside google app engine standard environment
sudo apt-get install libmagickwand-dev
is it possible to install a standard environment? or other environments?
package details: Installation
Not possible in the standard environment, in which you can only use language-specific libraries that can be installed by your language-specific installer (like pip for python).
But you can do that in the flexible environment. From Choosing an App Engine environment:
Runs in a Docker container that includes a custom runtime or source
code written in other programming languages.
See also Building Custom Runtimes.

Deploying ReactJs app in my machine through localhost

I create a reactJs App. But for now I run this app through Intellij idea and I would like to deploy it and run permanently in my machine without turning on through Intellij idea. How I could deploy react app and run it as deployment in my machine
If you created your app with create-react-app, you should be able to start local development server from the command line. To do this, open you project's root directory in the terminal and type npm start.
If you would like to create and serve a production bundle, you should build your project with npm run build and then serve build directory with a web server. The easiest way to do this is install serve via npm (npm install -g serve) and run serve -s build
For this purpose only webservers available like Tomcat, Payara, Whildfly, etc. You can install any one of those servers and deploy your application into that. As on when you started the server your application will be accessible.
Approach 1:
You can set up the server into your IDE and simply run the project on server mode.
Approach 2:
By using your project code, create a war file with the help of any build tool like MAVEN/GRADLE, etc. Then login into the server manager(Tomcat Manager) and deploy the generated .war file in deployment section.
Note: With the 2nd approach, you can access the application as on when you start the server.

Difference between 'goapp deploy' and 'appcf.py' to deploy my app on Google App Engine?

I don't understand the difference between
goapp deploy -application <YOUR_PROJECT_ID> myapp/
and
appcfg.py -A <YOUR_PROJECT_ID_> -V v1 update myapp/
when trying to deploy my app in google app engine. Can somebody enlighten me please?
Documented in Uploading, Downloading, and Managing a Go App:
goapp deploy wraps the appcfg.py python tool provided in the SDK. You can also invoke this tool directly if you need greater control over the deployment.
goapp deploy is equivalent to appcfg.py update myapp/.
These commands get application ID and other configuration from app.yaml automatically. You can use -application param of goapp, or -A of appcfg.py to override the application ID.
So goapp deploy calls appcfg.py under the hood, it is a convenient method to hide appcfg.py.
goapp deploy -application <YOUR_PROJECT_ID> myapp/
Deploys the application located in the myapp folder. Configuration will be read from the app.yaml file that must be at myapp/app.yaml. The command also overrides the application ID (if present in app.yaml), and <YOUR_PROJECT_ID> will be used instead.
appcfg.py -A <YOUR_PROJECT_ID> -V v1 update myapp/
This also deploys the application, but the -V overrides the version that may be present in myapp/app.yaml, and will use the version v1. -A is used to override the ID from app.yaml, will be <YOUR_PROJECT_ID> in this case.
goapp is a general tool for the whole Go-on-App-Engine workflow from build to deployment; you can use the same tool to install dependences (get), build your app, run locally (serve) and then deploy it (as well as run tests, format code, etc).
Some of these wrap other tools: goapp fmt probably just wraps gofmt, whilst goapp deploy just wraps appcfg.py update (see docs)

Does Google App Engine's git Push-to-Deploy also work with git submodules?

I've got an appengine Python app which takes advantage of endpoints-proto-datastore. I did install endpoints-proto-datastore using:
git submodule add https://github.com/GoogleCloudPlatform/endpoints-proto-datastore
It does work when I deploy my app through PyCharm (using Google Appengine Python SDK).
It does not work when I push to google's repository (Push-to-Deploy). When using Push-to-Deploy I get the following log message:
ImportError: No module named endpoints_proto_datastore.ndb
Do I have to download the endpoints_proto_datastore library and unzip it in the root directory to get Push-to-Deploy working? I wanted to be up-to-date, that's why I did use the git submodule.
It looks like this does not work as stated here

Resources