I you need to "just" your code run notebooks in GCP there is a service for that: AI Platform Notebooks.
From your notebook instance you can work and download data you need, just be sure your instance has the resources (memory and CPU) you'll need, and do not forget to shut the instance down when you're not using it to avoid charges.
If a notebook is too much for you, you can always run everything in a compute instance (that's a virtual machine). Just launch it from the web and ssh to it with the web application (no need to install ssh, etc.), then you can upload the code into the instance. Just remenber to use a small instance one to start ;-)
Answer from Iñigo González on Stack Overflowgoogle cloud platform - Running basic Python script on GCP - Stack Overflow
docker - How to run a "hello world" python script with Google Cloud Run - Stack Overflow
How to automate a Python script with Docker and Google Cloud Run
Trying to trigger Cloud Run Job from python/django and not wait for the result
Videos
I just published a tutorial series on how to automate a Python script in Google Cloud using Cloud Functions and/or Cloud Run. Feedback would be great. Thanks!
-
Automating Python with Google Cloud
-
Automating Python with Google Cloud Functions
-
Automating Python with Google Cloud Run
-
I you need to "just" your code run notebooks in GCP there is a service for that: AI Platform Notebooks.
From your notebook instance you can work and download data you need, just be sure your instance has the resources (memory and CPU) you'll need, and do not forget to shut the instance down when you're not using it to avoid charges.
If a notebook is too much for you, you can always run everything in a compute instance (that's a virtual machine). Just launch it from the web and ssh to it with the web application (no need to install ssh, etc.), then you can upload the code into the instance. Just remenber to use a small instance one to start ;-)
So I followed Inigo's advice, plus a little code I found elsewhere (starting with python on google plus a quick lab)
Create the VM as per here SSH in Run this code
sudo apt-get update
sudo apt-get install git -y
sudo apt-get install python3-setuptools python3-dev build-essential python3-venv -y
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# wget as suggested in the docs didn't work for me
sudo python3 get-pip.py
python3 --version
pip3 --version
python3 -m venv env
source env/bin/activate
Sprocket on the right to upload the files
pip install -r requirements.txt
python3 filename.py
Thanks for the comments and tips gang. This has got me moving
» pip install google-cloud-run
UPDATE
I've documented my problem and solution in much more detail here »
I had been trying to deploy my script as a Cloud Run Service. I should've tried deploying it as a Cloud Run Job. The difference is that cloud run services require your script to listen for a port. jobs do not.

Confusingly, you cannot deploy a cloud run job directly from Artifact Registry. You have to start from the cloud run dashboard.
Your Flask application should be something like below:
import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "Hello World!"
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))
See this official documentation for step by step instruction: Deploy a Python service to Cloud Run
There is a plugin called: Cloud Code IDE plugin which makes the test and deployment easy. I am using it for VS code, once the initial setups and permissions are taken care, few clicks, you will be able to run locally, debug and deploy Cloud run services from your local instance.
Link
I recently took on the challenge of automating a Python script, on a schedule with Docker and Google Cloud. While it sounds simple, this was quite tricky for me (a data scientist - not an engineer). I documented my steps in the referenced post for others who may find this useful.
Various posts in this sub helped me get this accomplished. (Particularly this).
Note that Google Cloud Run Services are different than Google Cloud Run Jobs. Services require your app to listen for HTTP requests. Jobs don't. This subtle distinction tripped me up, and I don't think it's talked about enough.