Lifecycle scripts to access the notebook instance git repository

0

Hi there,
Is it possible for the lifecycle scripts to access the content of the checkout-ed git repository? A use case would be to access the already available in the repository pip requirements file and to populate the notebook instance with the required python modules on start up.
I guess the answer to this question depends on the order of the executed events when a notebook is created. Are you executing the lifecycle scripts first and then checkout the repository or vice versa.

Thanks!

Edit:

Well, I did my experiment as follows.

I added a simple 'ls -al SageMaker' in the start and create lifecycle scripts and inspected the logs.
It seems that on initial notebook instance creation the git repository is checked out after the execution of the start and create scripts.
On subsequent notebook starts, the start script is executed and the repository folder is present in the SageMaker folder with a timestamp indicating that the repository folder was created after the initial start/create scripts executions.

So, can someone confirm that this is what's expected and that we can access the repository only on subsequent notebook starts?

Edited by: ainkov on Apr 3, 2019 7:25 AM

ainkov
preguntada hace 5 años562 visualizaciones
2 Respuestas
0

Hi and thank you for using SageMaker!

Currently, Git repositories are checked out after Lifecycle Configuration scripts are executed, so unfortunately they will not have access to them. We are always considering new features and functionality, so I've added this as a feature request.

In the mean time, I have two recommendations to workaround this limitation:

  1. Manually clone or download the requirements.txt files from within your Lifecycle Configuration.
  2. From your Lifecycle Configuration, create a cron job or similar background process that waits until the Git Clone operation is complete.

Let me know if that helps!

Best,
Kevin

respondido hace 5 años
0

Hey there, sorry for this late reply.
Thanks much, the workarounds would help!

ainkov
respondido hace 5 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas