'How to write if-else statements in a lifecycle configuration script
I have a sagemaker notebook instance having two jupyter notebook ipynb files. When I had one jupyter notebook, I was able to run it automatically with one lambda function trigger and lifecycle configuration.
Now I have two jupyter notebooks and corresponding two lambda function triggers. How can I run them based on the trigger by changing the lifecycle configuration script.
The trigger is file uploading into S3. Based on what location the file is added, the corresponding jupyter notebook should run
Solution 1:[1]
It is not possible to change the Life Cycle configuration script on the fly. You need to stop the notebook instance and then change the script which might not be ideal.
I would recommend you to write a LifeCycle configuration script in such a way that it checks the location of the S3 bucket and based on that it will run the command of running a specific notebook.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | CrzyFella |