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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠