- I'm using the Google Cloud feature with Python. Several other functions are in production.
- For this purpose, however, I also created a custom Python package that is available on github as Private Repo.
- I have to install the package in the Google function
WHAT HAVE I DONE
- I run the Google function locally
- I have a require.txt that contains a link to the package. This is done by adding the following line to
- I run
pip install -r requirements.txt. And the package was installed successfully.
- Now in the Python code of the function with
importworks and I can access all functions.
CHALLENGES IN PRESSING THE FUNCTION ON THE CLOUD
- To transfer the cloud function to the Google Cloud, I issue the following command according to the documentation:
gcloud functions deploy
--trigger-http --entry-point --runtime python37 --project=
As expected, this issues an error because it doesn't have access to the private repo in Git.
I created a Google Cloud Repository and linked it to the Git repo in the hope that I could somehow specify this in the resources.txt file. Just don't know how.
I tried to set username and password environment variables (not a good idea, because I agree) in the Google Cloud function and these in the
That also gave an error.
Any help or instruction is greatly appreciated.