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
asked 5 years ago553 views
2 Answers
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

answered 5 years ago
0

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

ainkov
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions