Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-less, Python-only deployment to gcloud? #213

Open
mccalluc opened this issue Nov 27, 2023 · 3 comments · May be fixed by #215
Open

Docker-less, Python-only deployment to gcloud? #213

mccalluc opened this issue Nov 27, 2023 · 3 comments · May be fixed by #215

Comments

@mccalluc
Copy link
Contributor

Follow-up from PR #211.

It seems like gcloud supports python/flask deployments without docker. If this works, there may be several advantages:

  • One less file for us to maintain, and we wouldn't need to worry about building and pushing docker images.
  • Cold start-up may be quicker, since the python code is much smaller than the docker image.
  • Performance may be better, because gcloud would be running it as a wsgi production server, rather than the dev server that the docker image currently provides.

Proposed path:

  • introduce a requirements.in file and compile requirements.txt from that.
  • add a new workflow for a new docker-less deployment
  • Make a PR with just that much, and @FedericoTartarini can test
  • if it works, then make a follow-up PR that removes the Dockerfile and updates the docs.

I'll try to looks at this on Friday, December 1.

@FedericoTartarini
Copy link
Contributor

I started reading about this and:

  • yes it seems that if we use this approach we will have one less file to maintain (i.e., we can remove the Docker file).
  • I did not find a lot of information about how this would reduce the start-up time. However, I found this guide which is very useful. I will try to implement some of these solutions.
  • I also did not read much about performance but I have not done proper research.

I am happy with your proposed solution. We can try to implement it and see if we notice any differences.

@mccalluc
Copy link
Contributor Author

The guide link is interesting, particularly this bit:

Because of Cloud Run's container image streaming technology, the size of your container image does not affect cold start or request processing time.

That wasn't my intuition, but it's good to know. A little more context:

With Image streaming, GKE uses a remote filesystem as the root filesystem for any containers that use eligible container images. GKE streams image data from the remote filesystem as needed by your workloads.

@FedericoTartarini
Copy link
Contributor

Because of Cloud Run's container image streaming technology, the size of your container image does not affect cold start or request processing time.

Very interesting I did not know.

I am not using Google Kubernetes, currently the application is only deployed in the US. It would be nice to have to serve it also from other datacenters but I never looked into this.

@mccalluc mccalluc linked a pull request Nov 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants