continuous-integration android firebase gcloud firebase-test-lab
为了将文件上传到谷歌云存储桶,我使用的是 JSON API。为此,我使用以下命令创建了一个 Bearer Token
$> gcloud auth activate-service-account myaccount@gserviceaccounts.co --key-file=creds.json
$> gcloud auth print-access-token
Run Code Online (Sandbox Code Playgroud)
现在我得到了一个令牌。我想知道,它是一个终生令牌,或者它有一些到期日。
当我尝试部署到 Google App Engine 时出现此错误:错误:(gcloud.app.deploy) 错误响应:[3] 将文件复制到 App Engine 时发生以下错误:
File https://storage.googleapis.com/staging.XXXXXXXX.appspot.com/04314f892fba4e2f44a86ab96eeb2a6b72ed93cd failed with: Conflicting SHA1 sum for file. Expected "6ae2b40e_68bc1a25_8cc5408c_bbd37316_fa642477" but received "04314f89_2fba4e2f_44a86ab9_6eeb2a6b_72ed93cd".
File https://storage.googleapis.com/staging.XXXXXXXX.appspot.com/d06cfbf61df973ee19498c5a6d8afd5c3f971cb1 failed with: Conflicting SHA1 sum for file. Expected "cf32ec49_c6023a31_6d3f4788_f187afcb_932d60df" but received "d06cfbf6_1df973ee_19498c5a_6d8afd5c_3f971cb1".
Details: [
[
{
"@type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Conflicting SHA1 sum for file. Expected \"6ae2b40e_68bc1a25_8cc5408c_bbd37316_fa642477\" but received \"04314f89_2fba4e2f_44a86ab9_6eeb2a6b_72ed93cd\".",
"resourceName": "https://storage.googleapis.com/staging.XXXXXXXX.appspot.com/04314f892fba4e2f44a86ab96eeb2a6b72ed93cd",
"resourceType": "file"
},
{
"@type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Conflicting SHA1 sum for file. Expected \"cf32ec49_c6023a31_6d3f4788_f187afcb_932d60df\" but received \"d06cfbf6_1df973ee_19498c5a_6d8afd5c_3f971cb1\".",
"resourceName": "https://storage.googleapis.com/staging.XXXXXXXX.appspot.com/d06cfbf61df973ee19498c5a6d8afd5c3f971cb1",
"resourceType": "file"
}
] …Run Code Online (Sandbox Code Playgroud) 我无法从我的机器连接到任何 GKE 集群。从远程机器上,它可以工作,但不是我的,我不知道为什么。如果你们中的一些人有任何想法......
我kubectl已从 gcloud ( gcloud components install kubectl) 中安装
我正在运行gcloud init,然后在现有集群或新创建的集群上运行gcloud container clusters create my-cluster --preemptible --cluster-version 1.12.7-gke.10 --machine-type n1-standard-1 --disk-size 20 --num-nodes 1
我正在检索我的凭据,gcloud container clusters get-credentials my-cluster --zone europe-west1-b --project my-project-123456它为我的kubectl. 切换到它(使用kubectx)。
但是当我尝试联系我的集群(例如kubectl get pods)时,它失败并显示以下消息:
无法连接到服务器:x509:由未知权威签名的证书
我只是不明白为什么我的本地人kubectl无法验证 Google CA。我遵循了我找到的所有资源,在其他区域/区域中尝试了其他集群,使用了不同版本的 python(2.7 和 3.6),重新初始化 gcloud,使用了另一个 Google 帐户,另一个版本的 kubectl(1.11、1.12 和 1.14) ),sudo update-ca-certificates在 Linux (Mint 19.1 Tessa) 中更新我的 CA ( )。 …
我对云计算很陌生,而且我不是来自软件工程背景,所以如果我说的有些话不正确,请见谅。
我习惯于在像 Spyder 这样的 IDE 上工作,我想保持这种方式。最近,在我的组织中,我们正在试验 Google Cloud,我尝试做的是在云上运行一个简单的脚本,而不是使用 Google Cloud 的 API 在我的计算机上运行。
假设我想通过 Spyder 在云上运行它:
x=3
y=2
print(f'your result is {x+y}')
Run Code Online (Sandbox Code Playgroud)
我猜我可以做这样的事情:
from googleapiclient import discovery
compute = discovery.build('compute', 'v1')
request = compute.instances().start(project=project, zone=zone, instance=instance)
request.execute()
#Do something to connect to instance
x=3
y=2
print(f'your result is {x+y}')
Run Code Online (Sandbox Code Playgroud)
有没有办法做到这一点?或者告诉 python 运行script.py?谢谢,如果我不清楚,请告诉我。
我想下面的谷歌的建议在谷歌云上运行[R教程。但是,我在最终创建集群时遇到了一些麻烦。创建集群时
elasticluster start myslurmcluster
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息
ERROR: (gcloud.compute.ssh) Could not fetch resource:
- The resource 'projects/MY_PROJECT/zones/us-central1-b/instances/myslurmcluster-frontend001' was not found
我已经多次运行本教程的前几个阶段,没有任何问题,但我怀疑问题可能与 SSH 密钥有关,以便我可以登录到我的集群。
任何帮助或建议都非常受欢迎!
我正在使用 Google 云构建来创建我的应用程序的图像。我创建了一个以特定格式trigger寻找 git的构建tag。每次云构建检测到新标签时 - 新构建诞生。
由于构建时间很长,我试图让它更快。
我发现可以要求 Google 在更强大的机器上构建应用程序(Source)。
gcloud builds submit --config=cloudbuild.yaml --machine-type=n1-highcpu-8 .
Run Code Online (Sandbox Code Playgroud)
但是,如果您选择手动构建选项,则此代码有效。因为我是从 GCP 用户界面创建的构建触发器,所以我找不到任何地方来填充machine-type参数。
machine-type有自动构建触发器的用户如何选择?
在Trigger窗口中,我选择Build Configuration= Docker File,这是我的 docker 文件预览:
docker build \
-t gcr.io/PROJ_NAME/APP_NAME/$TAG_NAME:$COMMIT_SHA \
-f deployments/docker/APPNAME.docker \
.
Run Code Online (Sandbox Code Playgroud)
我的buildconfig.yaml文件应该怎么看?
我正在构建一个使用谷歌云 API(例如谷歌云存储)的应用程序。为了使用 api 对应用程序进行身份验证,我需要将keyfile.json包含身份验证凭据的文件的路径传递给 GCloud Api 初始化脚本。IE
const storage = new Storage({
keyFilename: path.join(__dirname, '../../keyfile.json'),
});
Run Code Online (Sandbox Code Playgroud)
我将keyfile.json放入 NestJSsrc文件夹,但是当我构建应用程序时,该文件不会复制到dist.
在 NestJS 中处理静态文件复制到 dist 的推荐方法是什么?
static google-cloud-storage google-cloud-platform gcloud nestjs
Google Cloud run 不支持 docker 注册表,因此我必须手动拉取映像,标记它并将其推送到 GCR。
容器图像 URL 应匹配模式 [region.]gcr.io/repo-path[:tag 或 @digest]
有没有更简单的方法来做到这一点?
I'm trying to authenticate in a bash script and enable my service account and I have cred.json. Here is what I tried:
gcloud auth activate-service-account --key-file=/etc/gcp-cred.json
Run Code Online (Sandbox Code Playgroud)
The problem is that I have to set project explicitly:
gcloud config set project my_proj
Run Code Online (Sandbox Code Playgroud)
Which is kind of redundant because gcp-cred.json contains this project already as a field:
"project_id": "my_proj"
Run Code Online (Sandbox Code Playgroud)
Is there a way to avoid doing gcloud config set project explicitly and set it with gcp-cred.json?