[英]Google Cloud Build can't find Python venv… For Java Spring Boot project
I have a usual Java 11 Spring Boot application that is deployed to Heroku at the moment.我有一个常用的 Java 11 Spring 目前部署到 Heroku 的引导应用程序。
I can deploy the app manually to AppEngine via a local call to gcloud app deploy
我可以通过本地调用
gcloud app deploy
将应用手动部署到 AppEngine
However, I'm struggling for about 2 hours to make the Google Cloud Build to build and deploy the application automatically.但是,为了让 Google Cloud Build 自动构建和部署应用程序,我苦苦挣扎了大约 2 个小时。 It crashes not being able to find python, but I have absolutely no idea why does it try to look for the python anyway.
它崩溃无法找到 python,但我完全不知道它为什么要尝试寻找 python。
Here is the cloubuild.yaml
:这是
cloubuild.yaml
:
- name: maven:3.6.3-adoptopenjdk-11
entrypoint: mvn
args: ['--version']
- name: maven:3.6.3-adoptopenjdk-11
entrypoint: mvn
args: ['package']
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', 'app.yaml']
Here is the app yaml in the same root folder:这是同一根文件夹中的应用程序 yaml:
runtime: java11
env: standard
instance_class: F2
automatic_scaling:
max_instances: 1
Here is the error part of the output:这是output的错误部分:
Step #2: descriptor: [/workspace/app.yaml]
Step #2: source: [/workspace]
Step #2: target project: [atomic-parity-282520]
Step #2: target service: [default]
Step #2: target version: [20200711t113051]
Step #2: target url: [https://atomic-parity-282520.ew.r.appspot.com]
Step #2:
Step #2:
Step #2: Do you want to continue (Y/n)?
Step #2: Beginning deployment of service [default]...
Step #2: Created .gcloudignore file. See `gcloud topic gcloudignore` for details.
Step #2: ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/venv/bin/python3'
Step #2:
Step #2: If you would like to report this issue, please run the following command:
Step #2: gcloud feedback
Step #2:
Step #2: To check gcloud for common problems, please run the following command:
Step #2: gcloud info --run-diagnostics
Finished Step #2
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/gcloud" failed: step exited with non-zero status: 1
It appeared that some time ago we've added a few python scripts for db migration.似乎前段时间我们为数据库迁移添加了一些 python 脚本。 In addition to the script, a
venv
folder was created.除了脚本之外,还创建了一个
venv
文件夹。
Looks like AppEngine triggers it as a clue that the project is Python-based, even if you set a particular app.yaml
telling to use Java.看起来 AppEngine 触发它作为该项目基于 Python 的线索,即使您设置了特定的
app.yaml
告诉使用 Java。
Deleting the venv
folder resolved the issue.删除
venv
文件夹解决了该问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.