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
已提問 5 年前檢視次數 562 次
2 個答案
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

已回答 5 年前
0

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

ainkov
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南