Best way to deploy new ESPv2 version?

311 views
Skip to first unread message

hans.r...@impact.com

unread,
Jul 14, 2020, 8:05:43 PM7/14/20
to Google Cloud Endpoints
So I've followed the steps in https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-functions to deploy ESPv2 as a managed Cloud Run service, including the steps to update the image using the gcloud_build_image script. All that is working fine although a bit convoluted. Now with runtime release 2.13 available, I'm looking for best practises to deploy that while keeping my endpoint up and running.

I am able to do this by following these steps assuming 2.12 is already deployed and happily serving requests:
  1. Deploy new image using something like "gcloud run deploy myservice --image="gcr.io/endpoints-release/endpoints-runtime-serverless:2.13.0" --allow-unauthenticated --platform managed --project=abc --set-env-vars=ENDPOINTS_SERVICE_NAME=myservice". Key here is to add the ENDPOINTS_SERVICE_NAME variable.
  2. Now I basically repeat the steps in the wiki above, but from "Building a new ESPv2 Beta image". When deploying the image this time, I make sure to add "--remove-env-vars=ENDPOINTS_SERVICE_NAME" to have it use the ESP config tattooed onto the image again.
Is this the preferred way to handle this?. There are now an awful lot of steps I feel to keep this "API gateway" up and running with all its moving parts.

Thanks in advance for any insights!

Hans

Teju Nareddy

unread,
Jul 14, 2020, 8:43:04 PM7/14/20
to hans.r...@impact.com, Google Cloud Endpoints
Agreed that the current deployment model is convoluted. We are still working on a better model.

For updating: You don't need to do step 1 again. You only need to do that step the first time, before making the Cloud Endpoints service.

You only need to repeat all of "Building a new ESPv2 Beta image". You don't need to change any of the env vars or flags. Why? Because the `gcloud_build_image` script automatically uses the latest ESPv2 release every time you run it. So you just need to run the script, and re-deploy the Cloud Run service with the new image it outputs.

I agree that we can document this better. I filed a bug internally, I'll try working on it this week or next week.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/eb78d5a2-2770-40e0-80a0-67cddfabb0d1n%40googlegroups.com.


--

Teju Nareddy

nare...@google.com

Software Engineer

hans.r...@impact.com

unread,
Jul 14, 2020, 9:41:20 PM7/14/20
to Google Cloud Endpoints
Teju,  appreciate your help! I actually didn't realize that "gcr.io/endpoints-release/endpoints-runtime-serverless:2" referred to the latest version. I thought perhaps it was the original 2.0 image.

Hans

hans.r...@impact.com

unread,
Jul 14, 2020, 10:05:13 PM7/14/20
to Google Cloud Endpoints
Teju,

I have confirmed that you are correct (and you already knew that of course :-))

That makes it a bit easier at least and I can also control whether the latest image is always used via the -i parameter. I had missed that.

Thanks again.

Teju Nareddy

unread,
Jul 15, 2020, 12:39:05 PM7/15/20
to hans.r...@impact.com, Google Cloud Endpoints
No problem, glad it works. Yes, you can use -i to control which ESPv2 version you update to, that is another thing we should document.

We always update docker tag 2 to point to the latest ESPv2 release. You can confirm this by checking GCR for endpoints-runtime-serverless. Right now, ESP v2.13.0 is explicitly tagged with 2.

Eaton Zveare

unread,
Jul 21, 2020, 1:50:29 AM7/21/20
to Google Cloud Endpoints
Hi Teju, do you have any info about your upcoming "better model"?
I've found that automating all this on the desktop as a build step is rather difficult and I'm curious which steps are going to be made "better".

Teju Nareddy

unread,
Jul 21, 2020, 6:40:56 PM7/21/20
to Google Cloud Endpoints
Unfortunately, I'm being intentionally vague. We're working on a new control plane to simplify deploying ESPv2 for serverless platforms. I cannot give any more details on that. I'll update this thread once it's ready (a few months from now).

The deployment model should be automatable. ESPv2 has e2e tests that automate the steps in the tutorial. The bash scripts are located here, perhaps that will help in the short term. Be warned, they are very messy because our tests deploy to multiple serverless platforms for both HTTP and gRPC endpoints.

Arun Gopi

unread,
Aug 8, 2020, 12:58:10 AM8/8/20
to Google Cloud Endpoints
Hey Teju,

Any immediate plans to support GAE and GCE with ESPV2? Looking forward to it

Reply all
Reply to author
Forward
0 new messages