google cloud notebook instance run script not in startup

335 views Asked by At

I have a notebook instance with a notebook file. I use the instance's startup script to run this notebook file using papermill. I want the notebook file to be run only when I remotely start the instance, and not from google cloud console.

I'd like to know if one of these is possible, or if there's another solution:

1 - The script will detect that the instance was started from the dashboard.

2 - I will remove the startups script and use another script that can be run by a remote command.

3 - The shutdown script will remove the startup script.

2

There are 2 answers

2
Enrique Zetina On

Script definition is kept under /var/run/google.startup.script for the scenarios mentioned:

  1. Seems complicated detect if the instance was started from the dashboard.
  2. Is feasible to delete the startup script mentioned earlier, and run your own script remotely.
  3. Delete the script.

Before to delete the scrip I suggest you to make a backup of it in case of any issue arises for delete it, also keep in mind that AI Platform Notebooks is a managed service, any admin configuration could cause potential issues in your instance, be careful when deleting or modifying the startup script.

2
gogasca On

My advise will be actually run a notebook via a Scheduler system, I posted here the multiple options: GCP run a prediction of a model every day