gcloud

How can I exclude a file from deploy in gcloud?

坚强是说给别人听的谎言 提交于 2019-12-05 01:40:08
I have built a Node.js app and what I do to deploy is cd into my project's directory and run gcloud preview app deploy . This works, but in the files I also have a JSON file which acts like the database for my application, which I do not want updated on the site when I deploy. I cannot seem to find any way of doing this. If it's not possible, being able to see the JSON file remotely and copy its data to the local one and then deploy everything would do me too, but I cannot seem to be able to do that either. I believe you will want to use the skip_files directive in your app.yaml to exclude

Node pool does not reduce his node size to zero although autoscaling is enabled

浪尽此生 提交于 2019-12-05 00:15:19
问题 I have created two node pools. A small one for all the google system jobs and a bigger one for my tasks. The bigger one should reduce its size to 0 after the job is done. The problem is: Even if there are no cron jobs, the node pool do not reduce his size to 0. Creating cluster: gcloud beta container --project "projectXY" clusters create "cluster" --zone "europe-west3-a" --username "admin" --cluster-version "1.9.6-gke.0" --machine-type "n1-standard-1" --image-type "COS" --disk-size "100" -

How to fix error: A project ID is required for this service but could not be determined

青春壹個敷衍的年華 提交于 2019-12-04 23:32:11
问题 I'm trying to insert data to Google Datastore from AppEngine and I'm getting an error: java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment. Please set a project ID using the builder. at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92) at com.google.cloud.ServiceOptions.<init>(ServiceOptions.java:324) at com.google.cloud.datastore.DatastoreOptions.<init>(DatastoreOptions.java:85)

How to get a list of internal IP addresses of GCE instances

穿精又带淫゛_ 提交于 2019-12-04 21:59:11
问题 I have a bunch of instances running in GCE. I want to programmatically get a list of the internal IP addresses of them without logging into the instances (locally). I know I can run: gcloud compute instances list But are there any flags I can pass to just get the information I want? e.g. gcloud compute instances list --internal-ips or similar? Or am I going to have to dust off my sed/awk brain and parse the output? I also know that I can get the output in JSON using --format=json, but I'm

Exposing two ports in Google Container Engine

眉间皱痕 提交于 2019-12-04 19:49:12
问题 Is it possible to create a Pod in the Google Container Engine where two ports are exposed: port 8080 is listening for incoming content and port 80 distributes this content to clients? The following command to create a Pod is given as example by Google: kubectl run hello-node --image=gcr.io/${PROJECT_ID}/hello-node --port=8080 I can't seem to define a listening port, and when adding a second "--port=" switch only one port is exposed. Is there a way to expose a second port or am I limited to

Keras ImageDataGenerator for Cloud ML Engine

£可爱£侵袭症+ 提交于 2019-12-04 17:22:58
I need to train a neural net fed by some raw images that I store on the GCloud Storage. To do that I’m using the flow_from_directory method of my Keras image generator to find all the images and their related labels on the storage. training_data_directory = args.train_dir testing_data_directory = args.eval_dir training_gen = datagenerator.flow_from_directory( training_data_directory, target_size = (img_width, img_height), batch_size = 32) validation_gen = basic_datagen.flow_from_directory( testing_data_directory, target_size = (img_width, img_height), batch_size = 32) My GCloud Storage

Can I use gcloud in Git Bash on Windows?

泄露秘密 提交于 2019-12-04 17:09:48
问题 So, I've installed Git, Git Bash, Python2.7, and I've just installed the Google Cloud SDK per the official guide. Using Windows 10. In cmd.exe, or the "Google Cloud SDK Shell", gcloud works fine. Within Git Bash, however (the terminal that I prefer to use), gcloud returns the following output (screenshot). echo $PATH in Git Bash does include the path to the Google SDK (highlighted here). Am I missing something? Is there anything in $PATH that is possibly conflicting with gcloud, or did I

403 status on deleting modules through gcloud preview app

。_饼干妹妹 提交于 2019-12-04 15:52:09
I currently use gcloud preview app modules delete <module_name> --version <version_to_delete> with a service account to clean up old module versions for managed vms. This has been working great up until last week. I am now getting the error below. ERROR: (gcloud.preview.app.modules.delete) Error Response: [403] Project has not enabled the API. Please use Google Developers Console to activate the API for your project. Details: [[{"@type": "type.googleapis.com/google.rpc.Help", "links": [{"description": "Google developer console API activation", "url": "https://console.developers.google.com

How to authenticate google APIs with different service account credentials?

一个人想着一个人 提交于 2019-12-04 14:54:05
As anyone who has ever had the misfortune of having to interact with the panoply of Google CLI binaries programmatically will have realised, authenticating with the likes of gcloud , gsutil , bq , etc. is far from intuitive or trivial, especially when you need to work across different projects. I am running various cron jobs that interact with Google Cloud Storage and BigQuery for different projects. Since the cron jobs may overlap, renaming config files is clearly not an option, and nor would any sane person take that approach. There must surely be some sort of method of passing a path to a

Exposing multiple ports from within a ManagedVM

喜欢而已 提交于 2019-12-04 10:22:18
I'm using the Managed VM functionality to run a WebSocket server that I'd like to expose to the Internet on any port (preferably port 80) through a URL like: mvm.mydomain.com I'm not having much success yet. Here are the relevant parts of various files I'm using to accomplish this: Dockerfile: EXPOSE 8080 8081 At the end of the Dockerfile, a Python app is started: it responds to health checks on port 8080 (I can verify this works) and responds to WebSocket requests on port 8081. app.yaml: module: mvm version: 1 runtime: custom vm: true api_version: 1 network: forwarded_ports: ["8081"] I deploy