Closed johnnyoshika closed 6 months ago
Does this work outside of setup-gcloud
?
gcloud functions deploy essayVerbatim --gen2 --runtime python311 --region us-central1 --source . --entry-point essay_verbatim --set-env-vars "PYTHON_ENV=production" --set-secrets "{redacted}" --trigger-http --no-allow-unauthenticated --service-account {redacted}@examind-dev.iam.gserviceaccount.com --timeout 300 --memory 4GiB --quiet
Yes, it works fine when I run that command from my Terminal in my MacBook Pro. I've included outputs of that in my original message above.
Do you have a gcloudignore ot gitignore file that is preventing files from being present on the GitHub Action runner? Unless it's a different in gcloud versions, this GitHub Action literally just runs gcloud
commands :)
My .gitignore of the working directory of the monorepo:
/.env
/venv
/certs
/nltk_data
__pycache__
My .gcloudignore of the working directory of the monorepo:
# Without .gcloudignore, .gitignore will be used by `gcloud functions deploy`,
# which will prevent `nltk_data` folder from deploying.
.gcloudignore
.gitignore
The strangest thing is that it deployed fine from GitHub Actions fine before. The last time it deployed successfully was Jan 5, 2024. Then the next time the workflow file ran was Mar 7, 2024 and it failed. Nothing has changing inside the working directory since other than upgrading node versions, but I tried rolling that back to see if it works and it still doesn't. Here's a history of the workflow running:
Hi @johnnyoshika - sorry but I'm not sure how to help. Without a small reproduction case and access to the entire environment, my ability to assist is limited.
Googling some error messages, it seems like "got an unexpected keyword argument 'pooling_mode_weightedmean_tokens'" is a fairly common error. Forums suggest updating sentence-transformers
helps.
@sethvargo Thanks for pointing me in the right direction. I pinned the sentence_transformers
package in my GitHub Action to a previous version and it now works again.
I changed:
pip install nltk sentence-transformers
to
pip install nltk==3.8.1 sentence-transformers==2.2.2
I don't think I needed to pin the nltk
version as it hasn't changed in a while, but everything is working now.
TL;DR
When trying to deploy a google cloud function (with runtime python311), the build succeeds (I can see the successful build in GCP Console's Cloud Build page), but container healthcheck fails. This failure started happening sometime be Jan 5, 2024 (the last successful deployment) and May 7, 2024 (the first failed deployment).
The exact command when deploying from my macBook Pro succeeds without any issue. The deployment command is:
On my macBook Pro, I see this successful output:
In GitHub Workflow, I see the following error:
This is what I see in the log page:
Expected behavior
The function to deploy
Observed behavior
The function fails to deploy because of container healthcheck
Action YAML
Log output
Additional information
The contents of
save_minilm_model.py
, which is referenced in the action, is this: