Uploading app on google app engine - google-app-engine

I am new to python and google app. I have an already created application in python and
google app engine. I have downloaded source code of the app and customized it. The source
code which i downloaded doesn't have app.yaml and index.yaml in it. Now i want to know that if i upload my app on google app engine without app.yaml and index.yaml then is there any chance that my data on live server get lost. Please show me right path i am doing any
thing wrong. Also i dont know how to upload a single file on google app engine. Should i have to upload whole app ?
i have used following command for downloading source code on localhost:
appcfg.py download_app -A <your_app_id> -V <your_app_version> <output-dir>

You cannot upload an application without an app.yaml. The app.yaml file contains the necessary configurations to run your application like handlers to use, application ID, runtime, and so on.
Also, you cannot upload a single file to App Engine, you always upload the entire app.
I strongly suggest you do the "Getting Started" guide:
https://developers.google.com/appengine/docs/python/gettingstartedpython27/
before you invest more time in trying to figure out why things don't work.

Related

Stuck on "Get Started" page of Google App Engine. "gcloud app deploy" fails

I am stuck on the first page of instructions for Google App Engine
https://console.cloud.google.com/appengine/start/reception
I downloaded and installed the cloud SDK.
"gcloud init" worked.
I am stuck at "Deploy to App Engine".
When I type "gcloud app deploy" in Terminal, I get two errors.
"ERROR: An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application. Create an app.yaml file using the directions at https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml"
The page it says to go to does not give directions for creating the file. What is the command? Also, why is this error happening at all? If I follow the instructions on the Get Started page, I should not get an error. Some instructions must be missing or something not working when I install the SDK.
The second error I get is "ERROR: (gcloud.app.deploy) [/Users/chucky] could not be identified as a valid source directory or file."
Again, there must be instructions missing because I am following them.
Screen Shot
gcloud app deploy is for deploying a project. This means you need to have a folder with a sample project. The project will need to have an app.yaml file. Essentially, the steps are
Download and install the Google Cloud SDK
Run gcloud init to initialize the SDK (this makes you to login to Google and grant access to gcloud to your account; also sets up your default project)
Create your project (or copy an existing one) where project is your App i.e. the application you are working on. This project should have an app.yaml file.
Then deploy your project to production by running gcloud app deploy. You first have to change directory to your project folder. If you don't want to do this, you have to specify the full path to your app.yaml file.
An alternative for steps 3 - 4 is to use a Graphical User Interface (GUI) like one from us - https://nocommandline.com . You just click a button to create a new project and it will create a shell project ('hello world') with all the necessary files. To deploy your project, you also click another button 'Deploy' and it will take care of deploying your project.
From the link:
https://console.cloud.google.com/appengine/start/reception
First, you need to download the resources. You can use the Cloud SDK, Cloud Shell, directly download from github or other terminal to download the resources files. For example, you want to deploy a Python app using Cloud SDK in Windows OS:
Install and open Cloud SDK.
Copy the resources file from github:
From Cloud SDK run:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples
Go to directory of your application files:
cd python-docs-samples/appengine/standard_python3/hello_world
Deploy and browse your application
Deploy using the command:
gcloud app deploy --project PROJECTID
Browse using the command:
gcloud app browse --project PROJECTID
If you see the Hello World! you've successfully deployed your application.

How to reduce ktor App file size for Google App Engine Deployment

I am trying to deploy app.yaml file to my Google App Engine project which I built using Ktor + gradle and I get this error,
ERROR: (gcloud.app.deploy) Cannot upload file [the file], which has size [43355410] (greater than maximum allowed size of [33554432]). Please delete the file or add to the skip_files entry in your application .yaml file and try again.
I am not using any images or videos in my projects, its pure Kotlin code but the project is 49.2MB. It seems like all the space is being occupied by the libraries I use. All of these libraries are essential to my project, how do I reduce the file size for Google App Engine since I cannot add the app.yaml file now. Strangely the project does upload when I use 'gradle appengineDeploy' command but not when I use 'gcloud app deploy app.yaml'
To resolve this issue you can set runtime in the app.yml file to java11 (I've tested it). The quote from the relevant answer:
I think this problem is related to Google App Engine Standard java 8.
When I used java11, the problem disappeared.

Is there a way to UPDATE files in google app engine

Is there a way to update files for google app engine. I deployed the google app engine. I want to update the files on the google cloud app engine but I am unsure how to do this. When I am following the django google app engine.
How I try to fix this problem is by "re-deploying " but I receive a "too many files error" I am unsure how to fix this. How do I change the source code in the google app engine with the correct code?
You update the files on App Engine by doing this command in your project root
gcloud app deploy . --version YOUR_VERSION_NAME --project YOUR_PROJECT_NAME
But it sounds like that's what you're trying to do but you're getting a "too many files error"
I think the limit is 10,000 files. There most likely is a rogue directory in your project root that is causing the problem.
In your app.yaml you can add a skip_files section for files that should not get uploaded to App Engine.
skip_files:
- ^\.git/.*
- ^node_modules/(.*/)?
https://cloud.google.com/appengine/docs/standard/python/config/appref#skip_files

Deploy and download a wordpress application to google compute engine

How to deploy a local wordpress instance to google compute engine and download the same. I manage to deploy to google app engine, looking around for the document to deploy to google compute engine and download the same. With the existing post I can see its defn possible, but not able to locate the right document.
Also is it possible to deploy using gcloud commands ?, what is the command to use ?
I tried this command gcloud preview app deploy app.yaml but it keep complaining [application] is not used by gcloud. When I remove this tag, it keeps complaning endlessly. Is there a different app.yaml structure for compute engine and app engine.
How can I generate app.yaml file that is compatible with compute engine ?. Can it be downloaded some where or using a gcloud command ?, gcloud config doesnt seem to generate one.
We just finished working on a tool and guide to help do exactly what you're asking:
https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/appengine/flexible/wordpress
Let us know if you run into any issues!

How do I clone a website that is hosted on Google App Engine?

I have a friend's website hosted on Google App Engine and he wants a some changes to be done. He wants to download the assets from there and build it from scratch into a different host provider. Thing is, when I enter in the Google App Engine Dashboard I find it so hard to export/download anything. All looks so messy. I can't even find the index.html and css files. Any answers would be really appreciated. Thanks.
You can download an application's source code by running appcfg.py with the download_app action in the Python SDK command-line tool:
appcfg.py download_app -A <your_app_id> -V <your_app_version> <output-dir>
Only the developer who uploaded the code and the application owner(s) can download it. But you can be added as admin by the current account holder and then your credentials will work on the command line.
It's possible downloading of source-code has been permanently disabled. This action is irreversible. After you prohibit code download, there is no way to re-enable this feature.
See this page for more: Python Downloading source code
Instructions above for python version. For Java look here. Others, start here.

Resources