Python cloud function is not updated after rebuild

天大地大妈咪最大 提交于 2020-06-01 07:44:05

问题


Steps to reproduce:

  1. Enable these APIs: Cloud Repositories, Cloud Build, and Cloud Functions
  2. Create Repository and push content from here there. This is a simple Python Flask app returning simple Html with cloudbuild.yaml file.
  3. Create Cloud function using created repository with name la-repo-function-1 (which is referred in cloudbuild.yaml file) and using Python 3.7 with HTTP trigger and function to execute equal greetings_http
  4. Create Cloud Build trigger on that repo and point it to use cloudbuild.yaml as a configuration.
  5. Change returned html greetings in main.py and push it to the repository.

Expected Results: A new function is built and redeployed.

Actual Results: Cloud Build is triggered and a new ACTIVE version is observed, however the old content is still returned. Downloaded source code from console is old. However, manual redeployment without changes works (just by getting to edit tab and clicking deploy).

Note: This question is similar to this. However, here we are using Python 3.7 and and not a Node.js code, and accourding to GC release notes Python 3.7 is fully released and is not in beta.

So is it a bug or I'm missing something?


回答1:


This issue is being tracked in Google's Issue Tracker here, where it is being dealt with. When the resolution is complete, a good answer should be there.




回答2:


The solution is found, just relace existing cloudbuild.yaml on following code:

steps:
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['functions', 'deploy', 'la-repo-function-1', '--source','.','--trigger-http', '--runtime', 'python37', '--entry-point', 'greetings_http']

In other words source param is mandatory(however it's presence is not automatically validated)



来源:https://stackoverflow.com/questions/61211191/python-cloud-function-is-not-updated-after-rebuild

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!