Hey Stanislas,
My initial hunch was that the issue was the deployment of other resources
necessary to support the containers running. My analysis of
deployment-related logs appears to confirm this:
I created a simple NodeJS app using your dockerfile and default.yaml. I
then pushed the docker image to gcr.io and ran "gcloud app deploy
--image-url ..."
After about 1 minute of waiting, all resources associated with the
deployment had apparently completed, but the command had not returned yet:
```
$ gcloud deployment-manager resources list --deployment
aef-default-20170321t185300
NAME TYPE
STATE ERRORS INTENT
aef-default-20170321t185300-00 compute.beta.regionInstanceGroupManager
COMPLETED []
aef-default-20170321t185300-00ahs compute.v1.httpsHealthCheck
COMPLETED []
aef-default-20170321t185300-00it compute.v1.instanceTemplate
COMPLETED []
aef-default-20170321t185300-bs compute.v1.backendService
COMPLETED []
aef-default-20170321t185300-hcfw compute.v1.firewall
COMPLETED []
aef-default-20170321t185300-hcs compute.v1.httpsHealthCheck
COMPLETED []
```
At around the same time that the last of the above completed, I see the
following in the Console logs when selecting the "Deployment" logs source:
```
{
protoPayload: {…}
insertId: "54B422B11D921.AE9070D.A80D9821"
resource: {
type: "deployment"
labels: {
project_id: "<PROJECTID>"
name: "<PROJECTID>-gclb"
}
}
timestamp: "2017-03-21T18:54:05.999Z"
severity: "ERROR"
logName: "projects/<PROJECTID>/logs/cloudaudit.googleapis.com%2Factivity"
}
```
I haven't expanded the protoPayload, but it shows that this was an attempt
to delete the deployment "<PROJECTID>-gclb" if it exists. It's
near-immediately followed by a log representing an update on the deployment
"<PROJECTID>-gclb" with createPolicy: "CREATE_OR_ACQUIRE". I believe it's
reasonable to assume gclb stands for "Google Cloud Load Balancer", but I
could be wrong here.
About six minutes later, the deployment command finally completed. At about
the same time, the following shows up in the logs:
```
18:59:35.632
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":404,"message":"The
object 'projects/<PROJECTID>/global/deployments/<PROJECTID>-gclb' is not
found."},"authenticationInfo":{"principalEmail":"[email protected]"},"requestMetadata":{"calle...
{
protoPayload: {…}
insertId: "54B423EB72139.A6A3558.C2071C50"
resource: {
type: "deployment"
labels: {
name: "<PROJECTID>-gclb"
project_id: "<PROJECTID>"
}
}
timestamp: "2017-03-21T18:59:35.632Z"
severity: "ERROR"
logName: "projects/<PROJECTID>/logs/cloudaudit.googleapis.com%2Factivity"
}
```
This represents the deployment infrastructure checking whether the
deployment "<PROJECTID>-gclb" has been created yet, whether the create
operation scheduled above has finished yet. However, after another 25
seconds, approximately, we see the following:
```
19:00:00.122
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":"[email protected]"},"requestMetadata":{"callerIp":"10.131.45.3","callerSuppliedUserAgent":"App
Engine Flex Google-API-Java-Client Google-HTTP-Java-Client/1.22.0-SNAPSHOT
(...
{
protoPayload: {
@type: "type.googleapis.com/google.cloud.audit.AuditLog"
authenticationInfo: {
principalEmail: "[email protected]"
}
requestMetadata: {
callerIp: "10.131.45.3"
callerSuppliedUserAgent: "App Engine Flex Google-API-Java-Client
Google-HTTP-Java-Client/1.22.0-SNAPSHOT (gzip)"
}
serviceName: "deploymentmanager.googleapis.com"
methodName: "v2.deploymentmanager.deployments.update"
resourceName: "projects/<PROJECTID>/global/deployments/aef-gclb"
}
insertId: "54B42402DA050.AE94741.97003020"
resource: {
type: "deployment"
labels: {
name: "aef-gclb"
project_id: "<PROJECTID>"
}
}
timestamp: "2017-03-21T19:00:00.122Z"
severity: "NOTICE"
logName: "projects/<PROJECTID>/logs/cloudaudit.googleapis.com%2Factivity"
operation: {
id: "operation-1490122775787-54b423eb8f5f9-5492ae56-bcfc4ec6"
producer: "deploymentmanager.googleapis.com"
last: true
}
}
```
Notice "type: deployment" and "last: true". This appears to signal the
completion of a deployment "aef-gclb" at around the same time that the
command line returned news that the deployment was ready to serve.
This all seems to point to the fact that there are some resources which
need to be deployed before the app can serve, quite apart from fetching the
container image from gcr.io. It appears that creating a load balancer /
updating its rules is an important part of this which naturally will take a
long time since a whole array of distributed machines in the routing
infrastructure will need to sign off that they contain the new rules before
the user can be confident the deployment has completed.
I hope this helps clarify things for you. As we continue to improve the
infrastructure, doubtless times involved in these steps will decrease. We
definitely analyze the data related to deployments and all kinds of other
operations to determine how to streamline our systems. If you ever notice
something in future that needs explanation, feel free to post in this group
to inquire.
Cheers,
Nick
Cloud Platform Community Support
On Tuesday, March 21, 2017 at 6:00:11 AM UTC-4, Stanislas Marion wrote:
>
> Hi Nick,
> My app is based in us-central.
> My app is a very simple nodejs app, that runs an expressjs server. It
> starts in a few seconds (at most) with the command "node app.js --config
> config.json"
> I'm attaching my Dockerfile and default.yaml.
> Keep in mind that I deploy using the "gcloud app deploy default.yaml
> --image-url gcr.io/my-project/default"
> Cheers,
>
> On Mon, Mar 20, 2017 at 9:27 PM 'Nick (Cloud Platform Support)' via Google
> App Engine <[email protected]> wrote:
>
>> Ah, apologies for sending that last message too quick - I'll also need to
>> know roughly the details of your application's contents. How long does it
>> take your code to start up (you can check this by running the container on
>> your own machine, assuming it has stats comparable to the deployment
>> machine specs). Along with this information, could you share your
>> Dockerfile contents with me in response to the email I've just sent you
>> from [email protected]?
>>
>> Cheers,
>>
>> Nick
>>
>> Cloud Platform Community Support
>>
>> On Saturday, March 18, 2017 at 12:03:46 PM UTC-4, Stanislas Marion wrote:
>>
>>> Hi Nick,
>>> I have tweaked my build so that all the image building is done outside
>>> of GAE.
>>> After I have pushed my docker image to Google (using gcloud docker --
>>> push gcr.io/...) which takes very little time, it seems like the
>>> "Updating service" step takes forever (7-8min) whereas all that is needed
>>> is a simple variant of 'docker run new_image' > `migrate traffic to
>>> new_image'. Why does that last 7-8 minutes ??? Is there any way to speed it
>>> up? It is very painful when developing.
>>> Best,
>>>
>>> On Monday, October 3, 2016 at 10:39:50 PM UTC+2, Nick (Cloud Platform
>>> Support) wrote:
>>>>
>>>> Hey Kevin,
>>>>
>>>> The speed of deployment can be changed by limiting the size of the
>>>> uploaded app, limiting the complexity of the build necessary in the
>>>> Dockerfile, if present, and by ensuring a fast and reliable internet
>>>> connection. Other than these variables, it's hard to comment on what
>>>> specifically might be making deployment exhibit the timing that it does on
>>>> your system.
>>>>
>>>> I hope this is helpful - let me know if you have any further questions!
>>>> I'll be happy to help!
>>>>
>>>> Cheers,
>>>>
>>>> Nick
>>>> Cloud Platform Community Suppor
>>>>
>>>> On Thursday, September 29, 2016 at 3:48:26 PM UTC-4, Kevin Lau wrote:
>>>>>
>>>>>
>>>>> Is there a faster way to deploy an app? Google App Engine is slow to
>>>>> deploy, hangs on "Updating service [someproject]..." I am using a
>>>>> flexible
>>>>> environment with PHP.
>>>>>
>>>>
>>> *"This email and any files transmitted with it are confidential and
>>> intended solely for the use of the individual or entity to whom they are
>>> addressed. If you have received this email in error please notify the
>>> sender immediately"*
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google App Engine" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/google-appengine/hZMEkmmObDU/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/google-appengine.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-appengine/5aa7088c-a33e-4135-974b-232adc1c4c08%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/google-appengine/5aa7088c-a33e-4135-974b-232adc1c4c08%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> *"This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they are
> addressed. If you have received this email in error please notify the
> sender immediately"*
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/dcfd42f7-f1da-4c0f-8adb-9e3cfdd361ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.