I have been working on a website and I decieded to use google app engine to host it. I have been able use the config file to try and deploy with no errors in the config. I am using the google cloud SDK to upload and deploy my files. Whenever I try to deploy the SDK says it is uploading 30,000 files. I only have 11 files I need to upload. I think the SDK is trying to upload itself to cloud storage. My website files are in a www subfolder under my public directory where the SDK is installed. On my old computer I was able to move all the SDK files to my home directory and use my public folder as the sourse. When I try to do that now it says gcloud is not found. I am using gcloud app deploy and running windows 11. My old computer was running windows 10. I am not sure if that matters. I am also not sure if I need to specify anything in my app.yaml file. If anyone could help that would be great.
This is my app.yaml file:
runtime: php74
handlers:
- url: /www/index.html
static_files: /www/index.html
upload: /www/index.html, /www/campsite-form-results.php, /www/contact_us.php
This is the command line screenshot:
Plese let me know if there is any other information need to add.
This is expected since gcloud will upload everything that is in the path where is the app.yaml file.
I suspect that C:/Users/evanh/public contains a lot of things (even hidden folders) and not only your files for the app.
Create a new folder and put there your code, then try to deploy the app from that new folder.
EDIT
Since this was the accepted answer I'm editing this to include John's suggestion using his answer:
As a good practice, create a .gcloudignore file and specify what you do not want uploaded. You can see more info here:
gcloud topic gcloudignore
Ignoring files
Create a .gcloudignore file and specify what you do not want uploaded otherwise everything is uploaded.
gcloud topic gcloudignore
Ignoring files
Related
Trying to deploy my first Google Cloud Java app using Intellij. I've followed and read so many threads and have gotten absolutely nowhere on what is seemingly one of the simplest steps of getting this set up. I have installed gcloud CLI and followed the instructions here. After installing, I run the commands 'gcloud components update' and 'gcloud components install app-engine-java'. I see the folder located in both 'C:\Users<username>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine' and 'C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine'. I installed as multi user after hours of trying to get the single user install working, so now I have both. When in Intellij I am creating a new Google App Engine project under Java EE, it asks to specify a Google app engine SDK. There are no options so I choose to select the path. I have tried both above paths and it only tells me 'App Engine SDK path is not correct'. What am I doing wrong?? The steps seem ridiculously simple and it just doesn't work.
You stopped at the general google app engine folder
You need to specify the full path to the java-sdk folder, see the image in this question.
This is the first time I am deploying something on cloud, and I followed article.
I have created application, and want to deploy it on Google Cloud. While doing it I am getting error for app.yaml file.
My app.yaml is,
When I execute "ls" command, it display only 1 file,
The problem is that the command gcloud app deploy is unable to find your application app.yaml file.
If you do not provide any argument to gcloud app deploy it will look for an app.yaml file in the current directory.
It seems for your screenshot that you are in the Cloud Shell home directory, one directory above the one that contains your code and the actual app.yaml file, the one named xxxx-point-gcp.
Please, either change the working directory to xxxx-point-gcp and then run gcloud app deploy, or run gcloud app deploy passing as argument the full path to the app.yaml file:
gcloud app deploy ~/xxxx-point-gcp/app.yaml
Please, substitute the xxxx placeholders for the appropriate paths.
Please, see the relevant documentation.
You need to run gcloud app deploy from the folder which contains app.yaml file.
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.
Have a Meteor application that I’m deploying to a custom flex environment. Deploying same built folder to multiple Google Projects. Usually a .tgz file is created in my local temp folder and then uploaded to the projects default Google bucket and extracted from there to create an App Engine version.
Usually isn’t working for me in one of the projects and instead the gcloud app deploy command is uploading 57K individual files from node_modules. This makes a process go from minutes to multiple hours (ran it over night and still not done).‘
I’ve tried reinitializing the gcloud configuration, updating gcloud components, changing the default bucket, but not working. It’s doing some sort of check to see what’s been uploaded because it’ll skip uploaded files if I kill and start again.
An option for you to achieve that, it's to use the .gcloudignore to indicate which files you want to be uploaded, deployed, etc., or not.
As per the official documentation gcloud topic gcloudignore:
Several commands in gcloud involve uploading the contents of a directory to Google Cloud Platform to host or build. In many cases, you will not want to upload certain files (i.e., "ignore" them).
If there is a file called .gcloudignore in the top-level directory to upload, the files that it specifies will be ignored.
This means that you can use this file to decide which files you want to ignore. This way, you can, for example, ignore a whole directory or more than one, so this thousand of files of your don't get uploaded.
In this below post, there are examples of how to set this file for your own usage.
How to ignore files when running gcloud app deploy?
Let me know if the information helped you!
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.