Я пытаюсь настроить конвейер Cloud Build для развертывания приложения golang
в App Engine, но, похоже, оно порождает бесконечные версии самого себя, а затем время ожидания.
Для начала вотмоя конфигурация.
steps:
- name: "gcr.io/cloud-builders/go"
args:
- get
- "-u"
- "-d"
- "github.com/didip/tollbooth"
- "github.com/lib/pq"
- "github.com/stretchr/testify"
- "github.com/go-redis/redis"
- "cloud.google.com/go/pubsub"
dir: "/workspace"
volumes:
- name: 'go'
path: '/gopath'
env:
- "GOPATH=/gopath"
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy", "--stop-previous-version"]
dir: "/workspace"
volumes:
- name: 'go'
path: '/gopath'
env:
- "GOPATH=/gopath"
Вот соответствующий раздел app.yaml
:
service: "myservice"
runtime: custom
env: flex
Когда я развертываю в ветке, я настроил его для просмотра, он начинает сборку просто отличнои завершает шаг 0. Затем он начинает шаг 1, который является gcloud app deploy
, который, кажется, рекурсивно порождает еще один экземпляр конвейера (см. журналы ниже).Это продолжается до тех пор, пока не истечет время ожидания.
Вот начало журнала (ближе к концу вы увидите, что он рекурсивно начал шаг 0 внутри шага 1 снова).
starting build "e5ad47ed-5332-4bc7-b4ac-618e243f05a5"
FETCHSOURCE
Fetching storage object: gs://staging.myproject-event.appspot.com/asia.gcr.io/myproject-event/appengine/myservice.20190130t095428:latest#1548842070817530
Copying gs://staging.myproject-event.appspot.com/asia.gcr.io/myproject-event/appengine/myservice.20190130t095428:latest#1548842070817530...
/ [0 files][ 0.0 B/ 10.9 KiB]
-
- [1 files][ 10.9 KiB/ 10.9 KiB]
Operation completed over 1 objects/10.9 KiB.
BUILD
Starting Step #0
Step #0: Already have image (with digest): gcr.io/cloud-builders/go
Step #0: Documentation at https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/go/README.md
Step #0: Running: go get -u -d github.com/didip/tollbooth github.com/lib/pq github.com/stretchr/testify github.com/go-redis/redis cloud.google.com/go/pubsub
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/gcloud
Step #1: Services to deploy:
Step #1:
Step #1: descriptor: [/workspace/app.yaml]
Step #1: source: [/workspace]
Step #1: target project: [myproject-event]
Step #1: target service: [myservice]
Step #1: target version: [20190130t095546]
Step #1: target url: [https://myservice-dot-myproject-event.appspot.com]
Step #1:
Step #1:
Step #1: Do you want to continue (Y/n)?
Step #1: WARNING: Unable to verify that the Appengine Flexible API is enabled for project [myproject-event]. You may not have permission to list enabled services on this project. If it is not enabled, this may cause problems in running your deployment. Please ask the project owner to ensure that the Appengine Flexible API has been enabled and that this account has permission to list enabled APIs.
Step #1: Beginning deployment of service [myservice]...
Step #1: Building and pushing image for service [myservice]
Step #1: Started cloud build [b41069a6-2ef7-4eaf-8b49-de36bc620be2].
Step #1: To see logs in the Cloud Console: https://console.cloud.google.com/gcr/builds/b41069a6-2ef7-4eaf-8b49-de36bc620be2?project=954549095871
Step #1: ----------------------------- REMOTE BUILD OUTPUT ------------------------------
Step #1: starting build "b41069a6-2ef7-4eaf-8b49-de36bc620be2"
Step #1:
Step #1: FETCHSOURCE
Step #1: Fetching storage object: gs://staging.myproject-event.appspot.com/asia.gcr.io/myproject-event/appengine/myservice.20190130t095546:latest#1548842148386512
Step #1: Copying gs://staging.myproject-event.appspot.com/asia.gcr.io/myproject-event/appengine/myservice.20190130t095546:latest#1548842148386512...
Step #1: / [0 files][ 0.0 B/ 10.9 KiB]
/ [0 files][ 10.9 KiB/ 10.9 KiB]
-
- [1 files][ 10.9 KiB/ 10.9 KiB]
Step #1: Operation completed over 1 objects/10.9 KiB.
Step #1: BUILD
Step #1: Starting Step #0
Step #1: Step #0: Already have image (with digest): gcr.io/cloud-builders/go
Step #1: Step #0: Documentation at https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/go/README.md
Step #1: Step #0: Running: go get -u -d github.com/didip/tollbooth github.com/lib/pq github.com/stretchr/testify github.com/go-redis/redis cloud.google.com/go/pubsub
Step #1: Finished Step #0
Step #1: Starting Step #1
Step #1: Step #1: Already have image (with digest): gcr.io/cloud-builders/gcloud
Step #1: Step #1: Services to deploy:
Этопродолжается до тех пор, пока я вручную не убью последнюю сборку:
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: Copying gs://staging.solution360-event.appspot.com/asia.gcr.io/solution360-event/appengine/authproxy.20190130t100329:latest#1548842611410114...
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: / [0 files][ 0.0 B/ 10.9 KiB]
-
- [1 files][ 10.9 KiB/ 10.9 KiB]
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: Operation completed over 1 objects/10.9 KiB.
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: BUILD
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: Starting Step #0
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: Step #0: Already have image (with digest): gcr.io/cloud-builders/go
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: Step #0: Documentation at https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/go/README.md
Step #1: Step #1: Step #1: Step #1: Step #1: Step #1: Step #0: Running: go get -u -d github.com/didip/tollbooth github.com/lib/pq github.com/stretchr/testify github.com/go-redis/redis cloud.google.com/go/pubsub
Что я пробовал:
- Снятие флага "--stop-previous-version" из команды.
- Монтирование
gopath
в другой том, если это вызвало рекурсивный спуск gcloud в него. - Выполнение только шага 1, тот же результат.
Смотрите прикрепленный скриншот фактических сборок: