2

I've got a cloud function I deployed a while ago. It's running fine, but some of its dependent libraries were updated, and I didn't specify == in the requirements.txt, so now when I try to deploy again pip can't resolve dependencies. I'd like to know which specific versions my working, deployed version is using, but I can't just do a pip freeze of the environment as far as I know.

Is there a way to see which versions of libraries the function's environment is using?

Pavel Komarov
  • 1,153
  • 12
  • 26
  • To get the codes of previous version of Cloud Functions, try going through https://stackoverflow.com/questions/46797662/retrieving-an-old-version-of-a-google-cloud-function-source and https://stackoverflow.com/questions/43916490/get-code-from-firebase-console-which-i-deployed-earlier – Avinash Kumar Dec 31 '22 at 07:57
  • Previous function code won't clue me in to the library versions. – Pavel Komarov Jan 05 '23 at 18:23

2 Answers2

0

I would suggest using the pip list as it has the option to display outdated packages using the --outdated (-o) flag.

You can check this documentation for pip list for additional information and flags that would be useful to your project.

Robert G
  • 1,583
  • 3
  • 13
  • I can't do a pip freeze because I can't have a terminal open in the function's environment. That makes pip list equally impossible. – Pavel Komarov Jan 05 '23 at 18:22
0

I am still unaware how to get this information directly from Google Cloud Platform. I think it may not be surfaced after deploy. But a coworker had a workaround if you've deployed from a CI pipeline: Go back and look in that pipeline's logs to see which packages got installed upon deploy. It's printed. This didn't quite save me, because I'd deployed my function manually from a terminal, but it got me closer, because I could see which versions were being used around that time.

Pavel Komarov
  • 1,153
  • 12
  • 26