aws-samples / amazon-sagemaker-codeserver

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

Simpler configuration of options (like code-server version) #24

Open Riezebos opened 1 year ago

Riezebos commented 1 year ago

I would like to automate the setup of codeserver, but I'd like to change the code-server version. Currently, both setup-codeserver and install-codeserver need to be edited to change this. This would be possible with something like sed, but a bit clunky.

I think either using cli arguments or environment variables would be a good solution. Environments variables would be a small change from:

CODE_SERVER_VERSION="4.5.2"

to

CODE_SERVER_VERSION="${CODE_SERVER_VERSION:-4.5.2}"

Then my installation script would be:

 curl -LO https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amazon-sagemaker-codeserver-0.1.5.tar.gz
 tar -xvzf amazon-sagemaker-codeserver-0.1.5.tar.gz

 cd amazon-sagemaker-codeserver/install-scripts/notebook-instances

 chmod +x install-codeserver.sh
 chmod +x setup-codeserver.sh
 export CODE_SERVER_VERSION="4.13.0"
 sudo ./install-codeserver.sh
 sudo ./setup-codeserver.sh

Would this be possible to implement? I can propose a PR if it helps.