Where are Node apps deployed using gcloud SDK? - google-app-engine

I've deployed a Node app to Google Cloud. It works beautifully.
However, where is the app running? Where in the directory structure of my instance is it stored?
I'd also like to identify where stdout is on that process. The logging solution in the GAE console is powerful but excessive for some of the simple debugging tasks I have.

Your application runs inside a Docker container and hosted on one or more instances that AppEngine provisioned for you when you deployed your application. AppEngine is managed runtime environment and thus you are not supposed to access the instance/container directly. The internal directory structure is exactly the same as you've built it during the development process.
The stdout is redirected to Google Cloud Logging. You can filter the log by severity (debug, errors, everything etc..) to reduce the amount of data you need to read.

Related

Google App Engine CLI - list project directory

Is there a way to print the contents of my project directory using the google app engine cloud shell?
In my local terminal that would look like typing 'ls'
What command would I use in the shell?
The cloud shell is fundamentally just a shell running on a generic virtual machine in the cloud.
That machine does NOT have any special attributes (compared to your local machine) except maybe that it comes with some tools (like the google cloud SDK) already installed. It has no implicit knowledge about or access to your cloud products/projects themselves.
So, by default, the cloud shell doesn't know which/where your GAE project is. You'd have to pull a copy of your project repository/code on that instance and, when in that project's directory, you could list the project's content using ls, just like on your local machine. See also the somehow related Google Cloud: How to deploy mirrored Repository
The machine on which the cloud shell runs is also unrelated to the instances on which GAE apps are running, so you can't directly list on it the directory content of the actually deployed GAE project. If that's what you're after see Where are appengine projects located normally in the file system of the server via ssh?

Local or development Google Cloud Firestore database with App Engine

In my previous App Engine projects I used the Cloud Datastore, and during development I could debug my app on the local server and it would use a local database, stored in a file I could wipe out if I wanted to start from scratch.
With Cloud Firestore, even when I'm running locally it's talking to my real cloud database. Is there still a local option? Note that I'm not talking about client-side persistence, I'm talking about a mock development DB.
Google recommends setting up multiple projects if you want dev/staging/production, and I'm guessing that's the answer, but I'd like to know before adjusting my workflow.
I think (now only a few months later) that this is supported. When I run my app, using dev_appserver.py, I see a message
INFO 2019-02-14 00:08:56,030 admin_server.py:150] Starting admin server at: http://localhost:8000
Going to that URL shows me all the instances I have been seeing. These seem to persist even when the dev_appserver is restarted. Reading this and other posts I was convinced that my development was using my actual cloud database, but going to https://console.firebase.google.com/project/myproject was showing completely different content.
Just to be sure (because google is google and everything is named the same) I'm using an appengine app and a gcloud project, storing things to Firestore using ndb.Models...
Oh, but careful. My app I was also using the cloudstorage (blobstore?) and even though the localhost:8000 showed these, THESE WERE THE REMOTE INSTANCES.
There is a local emulator for Firestore when using the Firebase CLI:
https://firebase.google.com/docs/rules/emulator-setup

Google Cloud Shell unable to display files present in Google Storage

Image1 available clearly shows that the bucket contains a folder namely cloudml-samples-master and a file namely setup.py
However on entering the command ls in Google Cloud Shell, it is giving no output. I am stuck at this problem and I have tried almost everything but I am unable to find the reason behind this.
Also when I am trying to access these files through my API, I get an error displaying that these files could not be found.
Both the files present in the directory were uploaded using WebUI.
To add my opinion, what I understood till now is that the files being uploaded using WebUI and those uploaded using command line are acting independently. Because I have seen that the files which I am uploading using command line are not showing in UI. Is there some error from my side or is it an issue related with Cloud Google Storage?
As you can see below from https://cloud.google.com/shell/docs/features, Google Cloud Shell is not connected directly with Google Cloud Storage. It gives you possibility to connect with that storage eg. via gsutil
When you start Cloud Shell, it provisions a g1-small Google Compute
Engine virtual machine running a Debian-based Linux operating system.
Cloud Shell instances are provisioned on a per-user, per-session
basis.
Also:
Cloud Shell provides the following:
A temporary Compute Engine virtual machine instance Command-line
access to the instance from a web browser Built-in code editor BETA
5 GB of persistent disk storage Pre-installed Google Cloud SDK and other tools Language support for Java, Go, Python, Node.js, PHP, Ruby
and .NET Web preview functionality Built-in authorization for access
to GCP Console projects and resources

Error message "service cloudbuilt.googleapis.com is not for consumer..." when deploying App Engine application

My team and I are working on the Trendy Lights Tutorial.
We have set up all the files and also have converted the .p12 key to .pem key but failed to run the app on the Google Cloud Platform and constantly got the error message saying:
You do not have permission to access project [...] and service
"cloudbuilt.googleapis.com" is not for consumer..."
We have already whitelisted our service account for the use of Earth Engine. Does anyone know what the problem might be?
Thank you so much!
I see that you are attempting to deploy your application to the App Engine Flexible Environment.
The Flexible environment differs from the Standard environment in that it gives you more control over the individual instances that are running your deployed application. It does this by hosting your application within Docker on Compute Engine virtual machines.
Therefore, you will need to enable the Compute Engine API for your project so that the GCloud tool can start new Compute Engine virtual machines when you deploy your application.
Note: Since the Flexible environment uses Compute Engine resources, you will also need to enable billing for your project.
If after performing the above you still experience the 'cloudbuild.googleapis.com' error, I ask that you run gcloud components update, then ensure that the value of account seen in the output of the command gcloud info has Owner or Editor permissions in your project.
If it still persists after all of the above, you should then open a Public Issue Tracker to inform our backend team of the issue.

Deploying BPEL process on the Google App Engine

Usually we deploy BPEL business processes on Apache ODE or WSO2 BPS Server included in Tomcat server, can I deploy a business process on Google App Engine's Web Server? Actually I haven't any idea about that!
There is a lot more to running a BPEL process than it seems. You would not deploy the BPEL process, you would deploy Apache ODE to Google App Engine.
Unfortunately, last I checked App Engine has stringent restrictions on the number of threads a program can spawn, making Apache ODE unusable (see 0(their doc)):
The secured "sandbox" environment isolates your application for service and security. It ensures that apps can only perform actions that do not interfere with the performance and scalability of other apps. For instance, an app cannot spawn threads in some ways, write data to the local file system or make arbitrary network connections. An app also cannot use JNI or other native code. The JVM can execute any Java bytecode that operates within the sandbox restrictions.
you can't. See Google app engine's documentation.
[1] https://developers.google.com/appengine/docs/
[2] https://developers.google.com/search/results?q=BPEL&p=%2Fappengine

Resources