Deployment Guide: Google Cloud #1867
Replies: 1 comment 6 replies
-
The following is a discussion from Slack with @martijnvdbrug & @skid (who both have experience deploying Vendure to Google Cloud Run in production): Yasser Context:
The questions I have are
@martijnvdbrug:
The way we deploy is that we eliminate the idea of a "worker" completely. Workers are just normal instances - if you dig in Vendure's codebase, you'll see that the only difference is that the bootstrapWorker code sets the server context to 'worker' and it doesn't listen to a socket. Since the task queue is handled via google cloud tasks using Martijn's plugin, so whenever you have a task it just pings a URL on a regular non-worker instance. When I think about it - I'm not sure how does vendure-plugin-google-cloud-tasks work with a Vendure worker at all, given that the worker doesn't listen to incoming connections. @martijnvdbrug Yasser @DiscoDancer your point about Worker not listening to requests added to my confusions yesterday as I was trying to deploy - exactly, if the worker instance doesn’t listen to requests, why deploy it as a standalone service? aren’t requests going from the main server instance to Google Cloud Task public endpoint? Note that there are reported issues with docker builds from Macbook’s with the M1 chip reported, so the flag --platform linux/amd64 may be needed when running docker build commands. @Yasser - Vendure was not designed with an essentially serverless deployment such as Cloud Run in mind. See this issue: #1799, though it takes very little effort to make it run on Cloud Run. Google cloud tasks, however, works by making a http request sending the task payload, so for this reason "workers" must have a http server running which, if they do, makes them exactly the same as the main process. |
Beta Was this translation helpful? Give feedback.
-
Blog post: Serverless e-commerce: Vendure on Google Cloud Run
Beta Was this translation helpful? Give feedback.
All reactions