gcloud

How to invoke gcloud with service account impersonation

試著忘記壹切 提交于 2020-08-22 06:23:06
问题 I have a service running in GCE with default service account A. This service uses gcloud to talk to various GCP services. Currently, it uses service account B to talk to some of the GCP services (using private key). However, we want to get rid of using private key and use account impersonation. To do that, I have added account A to the service account B's role and given token creator role. I wrote a test program in go and was able to verify the impersonation works. However, our service is in

Hacker News 简讯 2020-07-21

好久不见. 提交于 2020-08-14 03:28:33
更新时间: 2020-07-21 23:00 AMD Launches 12 Desktop Renoir Ryzen 4000G Series APUs: But You Can’t Buy Them - (anandtech.com) AMD推出12台雷诺阿雷森4000克系列台式机:但你不能买 得分:46 | 评论:31 Common mistakes writing React components with hooks - (lorenzweiss.de) 书写常见错误用钩子反应组件 得分:65 | 评论:38 Monitoring your own infrastructure using Grafana, InfluxDB, and CollectD - (serhack.me) 使用Grafana、InfluxDB和CollectD监控您自己的基础架构 得分:114 | 评论:78 Invert, Always, Invert - (anup.io) 反转,总是,反转 得分:234 | 评论:64 Systems Design for Advanced Beginners - (robertheaton.com) 面向高级初学者的系统设计 得分:650 | 评论:73 AI in physics: are we facing a scientific

Service account does not have storage.buckets.lists access to project while pushing images to GCR via Gitlab CI

三世轮回 提交于 2020-08-10 05:01:52
问题 I am using Gitlab CI to build docker images and to push them to GCR. My Script goes like this - build: image: google/cloud-sdk services: - docker:dind stage: build cache: script: - echo "$GCP_SERVICE_KEY" > gcloud-service-key.json # Google Cloud service accounts - gcloud auth activate-service-account --key-file gcloud-service-key.json - gcloud auth configure-docker --quiet - gcloud config set project $GCP_PROJECT_ID - echo ${IMAGE_NAME}:${IMAGE_TAG} - PYTHONUNBUFFERED=1 gcloud builds submit

Can't access secret in GCP Secret Manager

本秂侑毒 提交于 2020-08-09 10:33:10
问题 I'm trying from storing my API keys in a .env to using Google Cloud Platform Secrets Manager. I've followed the instructions here but I encounter an error saying that I don't have permissions to access the secret. import * as admin from "firebase-admin" import { SecretManagerServiceClient } from "@google-cloud/secret-manager" admin.initializeApp() const secretClient = new SecretManagerServiceClient() async function main() { async function getSecret(): Promise<string | null | undefined> {

Can't access secret in GCP Secret Manager

生来就可爱ヽ(ⅴ<●) 提交于 2020-08-09 10:32:24
问题 I'm trying from storing my API keys in a .env to using Google Cloud Platform Secrets Manager. I've followed the instructions here but I encounter an error saying that I don't have permissions to access the secret. import * as admin from "firebase-admin" import { SecretManagerServiceClient } from "@google-cloud/secret-manager" admin.initializeApp() const secretClient = new SecretManagerServiceClient() async function main() { async function getSecret(): Promise<string | null | undefined> {

Firestore Deadline Exceeded Node

五迷三道 提交于 2020-07-30 10:22:29
问题 I would like to load collection that is ~30k records. I.e load it via. const db = admin.firestore(); let documentsArray: Array<{}> = []; db.collection(collection) .get() .then(snap => { snap.forEach(doc => { documentsArray.push(doc); }); }) .catch(err => console.log(err)); This will always throw Deadline Exceeded error. I have searched for some sorts of mechanism that will allow me to paginate trough it but I find it unbelievable not to be able to query for not that big amount in one go. I

Firestore Deadline Exceeded Node

孤街醉人 提交于 2020-07-30 10:21:12
问题 I would like to load collection that is ~30k records. I.e load it via. const db = admin.firestore(); let documentsArray: Array<{}> = []; db.collection(collection) .get() .then(snap => { snap.forEach(doc => { documentsArray.push(doc); }); }) .catch(err => console.log(err)); This will always throw Deadline Exceeded error. I have searched for some sorts of mechanism that will allow me to paginate trough it but I find it unbelievable not to be able to query for not that big amount in one go. I

Firestore Deadline Exceeded Node

旧巷老猫 提交于 2020-07-30 10:19:11
问题 I would like to load collection that is ~30k records. I.e load it via. const db = admin.firestore(); let documentsArray: Array<{}> = []; db.collection(collection) .get() .then(snap => { snap.forEach(doc => { documentsArray.push(doc); }); }) .catch(err => console.log(err)); This will always throw Deadline Exceeded error. I have searched for some sorts of mechanism that will allow me to paginate trough it but I find it unbelievable not to be able to query for not that big amount in one go. I

gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/env/bin/python3.7'

对着背影说爱祢 提交于 2020-07-23 07:39:06
问题 When trying to deploy my fastapi python service (on App Engine), I'm running into the following error in the deploy step: ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/env/bin/python3.7' I'm starting the deploy/build from my local machine with the following command: gcloud builds submit --config config/cloudbuild/deploy.yaml --project $_PROJECT . Am I doing something wrong, or could it be something wrong with the gcloud builder? I've tried with both google

gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/env/bin/python3.7'

孤人 提交于 2020-07-23 07:38:26
问题 When trying to deploy my fastapi python service (on App Engine), I'm running into the following error in the deploy step: ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/env/bin/python3.7' I'm starting the deploy/build from my local machine with the following command: gcloud builds submit --config config/cloudbuild/deploy.yaml --project $_PROJECT . Am I doing something wrong, or could it be something wrong with the gcloud builder? I've tried with both google