aws-samples / sagemaker-studio-apps-lifecycle-config-examples

MIT No Attribution
23 stars 8 forks source link

Fix for cron service not running by default in sm distribution 1.6 for JupyterLab #15

Closed lavaraja closed 4 months ago

lavaraja commented 4 months ago

Issue #, if available: https://github.com/aws-samples/sagemaker-studio-apps-lifecycle-config-examples/issues/12

Description of changes:

  1. Added fix for handling the scenario where cron service is not started by default in SM Distribution 1.6.0
  2. Added logic for backward compatibility with SM Distribution 1.5.0 and below.

Test results:

Tested with JupterLab image SM Distribution 1.5.0 and SM Distribution 1.6.0.

Screenshot 2024-04-21 at 19 28 49 Screenshot 2024-04-21 at 19 28 40 Screenshot 2024-04-21 at 19 28 56 Screenshot 2024-04-21 at 19 28 19 Screenshot 2024-04-21 at 19 28 27 Screenshot 2024-04-21 at 19 32 50

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

hugowong-aws commented 4 months ago

Hi, is adding the following command

sudo service cron start

after installing cron

sudo apt-get install -y cron

not sufficient in unblocking the extension? I was able to get this to work on a SageMaker Studio JupyterLab app using SageMaker Distribution 1.7.

edwardps commented 4 months ago

Hi, is adding the following command

sudo service cron start

after installing cron

sudo apt-get install -y cron

not sufficient in unblocking the extension? I was able to get this to work on a SageMaker Studio JupyterLab app using SageMaker Distribution 1.7.

A suggestion is to move "sudo service cron restart" out the else block. (starting the cron can be shared for both case)