-
Notifications
You must be signed in to change notification settings - Fork 21
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
Move from docker-build-deploy to python-deploy #215
base: main
Are you sure you want to change the base?
Move from docker-build-deploy to python-deploy #215
Conversation
Prescence would cause docker build. https://cloud.google.com/run/docs/deploying-source-code: "If a Dockerfile is present in the source code directory, the uploaded source code is built using that Dockerfile."
so we have the requirements.txt needed for deploy
Thank you very much for working on this, I am always in favour of testing new things even if the old ones are still working since we should try to improve. I have a few minor comments/comments:
I am quite busy this week, so I may only be able to test this next week. |
No rush on this!
yes... but it would need to be kept in sync, and I'm not sure about the best way of ensuring that: I'll git it some thought. The Pipfile is nice, but I wonder if there are particular bits that are important to you that we might be able to provide another way? Off-hand, some of the nice features it has include:
(It is a nice tool; It's just annoying that it's not supported directly by cloud run from source.)
The development server is single-threaded, which would be a bottleneck with enough traffic. For example if the EPW load takes a while to return, other requests would be blocked. Gcloud does have autoscaling, so maybe that has been kicking in, which would ameliorate the performance, but the guidance is uniform that the flask dev server should not be used for a production site. |
I tried to implement all the changes you recommended to deploy the app from source but I am facing a major problem. I pushed the code to the repository called I was able to deploy this code from the source using these commands:
The app is up and running at this URL https://clima-test-oiook3g2yq-uc.a.run.app/ however it is not loading up despite the app was correctly deployed. See the screenshot below. To be honest I am not sure what I need to fix next. If you want i can add you as a viewer to Google Cloud Run so you can have a look at the logs. |
Hmm: I don't know either. For right now, I'd suggest putting this on the back burner. For debugging this, maybe it would make sense for me to sign up for the free level with google, and try running the workflow from my fork. That would save you from elevating my privs, and give me a sandbox where I wouldn't need to worry about clobbering the real site. I haven't touched google cloud before, so there's plenty to learn there, and there's also work to be done here, without even thinking about this deployment issue. |
I had initially planned to leave everything in place, and just add a
requirements.txt
, and a new workflow, but it looks like if aDockerfile
is present it does a Docker build: the deploy-cloudrun workflow wrapsgcloud run deploy
which explains:... so I instead tried to make this PR clean, so if it seems to work for you, it could be merged as-is:
deployment.yml
in place.If you want to go forward with this, I'd suggest:
TEST-main
branch, and merge this branch to that.project_id
: I've set it toTEST-clima-316917
to make sure the live site isn't clobbered.GCP_CREDENTIALS
in place: This is what the example used, but there are probably many ways to do this.If all of that seems good, make a commit with
bump version
toTEST-main
and see what happens.This is a big change, and generally: "if it ain't broke, don't fix it" -- so no offense if you don't go forward with this!