aws-samples / amazon-sagemaker-codeserver

Hosting code-server on Amazon SageMaker
MIT No Attribution
52 stars 17 forks source link

Error when adding notebook lifecycle configuration #11

Open sungeuns opened 1 year ago

sungeuns commented 1 year ago

Hi, Thanks for the great script!

When I tried to add lifecycle configuration on AWS CLI, error below is happened:

XXX:~/environment/amazon-sagemaker-codeserver/install-scripts/notebook-instances $ aws sagemaker create-notebook-instance-lifecycle-config \
>     --notebook-instance-lifecycle-config-name install-codeserver \
>     --on-start Content=$((cat setup-codeserver.sh || echo "")| base64) \
>     --on-create Content=$((cat install-codeserver.sh || echo "")| base64) 

Error parsing parameter '--on-create': Expected: '=', received: 'EOF' for input:
cyBSZXNlcnZlZC4KIyBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogTUlULTAKCiMhL2Jpbi9iYXNo

There is EOF in the middle of script, so I think quotation is needed when adding lifecycle configuration with AWS command:

aws sagemaker create-notebook-instance-lifecycle-config \
    --notebook-instance-lifecycle-config-name install-codeserver \
    --on-start Content="$((cat setup-codeserver.sh || echo "")| base64)" \
    --on-create Content="$((cat install-codeserver.sh || echo "")| base64)" 

Thanks,

shimdx commented 1 year ago

I am having same error when I call "aws sagemaker create-notebook-instance-lifecycle-config...". Instead of doing this, I made a lifecycle config using AWS web console putting scripts in each sh files. Then It runs as expected. I think this would be a workaround for now.

hwaxxer commented 1 year ago

Same, basic installation scripts not working.