Skip to content

Commit 9caf051

Browse files
Enhanced install procedure.
1 parent 155d06d commit 9caf051

File tree

1 file changed

+63
-46
lines changed

1 file changed

+63
-46
lines changed

README.md

+63-46
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ There are two ways to get started and install the solution in Amazon SageMaker:
4949

5050
In both cases we are going to leverage on the following install scripts:
5151
- SageMaker Studio: [install-codeserver](install-scripts/studio/install-codeserver.sh)
52-
- SageMaker Notebook Instances: [install-codeserver](install-scripts/notebook-instances/install-codeserver.sh) and [setup-codeserver](install-scripts/notebook-instances/setup-codeserver.sh) (install procedure is split in two sequential steps to better support lifecycle configurations - see next sections)
52+
- SageMaker Notebook Instances: [install-codeserver](install-scripts/notebook-instances/install-codeserver.sh) and [setup-codeserver](install-scripts/notebook-instances/setup-codeserver.sh) (install procedure is split in two sequential steps to better support lifecycle configurations - see next sections).
53+
54+
The install procedure is based on the latest stable release of the solution as of today.
5355

5456
### Install with Lifecycle Configurations
5557

@@ -59,32 +61,35 @@ When using Amazon SageMaker Studio, code-server must be installed on the instanc
5961

6062
**Example: install code-server automatically for all users in the Studio domain**
6163

62-
1. Download the [install-codeserver](install-scripts/studio/install-codeserver.sh) script in a directory of choice.
63-
64-
2. From a terminal appropriately configured with AWS CLI, run the following commands in the directory above:
65-
66-
LCC_CONTENT=`openssl base64 -A -in install-codeserver.sh`
67-
68-
aws sagemaker create-studio-lifecycle-config \
69-
--studio-lifecycle-config-name install-codeserver-on-jupyterserver \
70-
--studio-lifecycle-config-content $LCC_CONTENT \
71-
--studio-lifecycle-config-app-type JupyterServer \
72-
--query 'StudioLifecycleConfigArn'
73-
74-
aws sagemaker update-domain \
75-
--region <your_region> \
76-
--domain-id <your_domain_id> \
77-
--default-user-settings \
78-
'{
79-
"JupyterServerAppSettings": {
80-
"DefaultResourceSpec": {
81-
"LifecycleConfigArn": "arn:aws:sagemaker:<your_region>:<your_account_id>:studio-lifecycle-config/install-codeserver-on-jupyterserver",
82-
"InstanceType": "system"
83-
},
84-
"LifecycleConfigArns": [
85-
"arn:aws:sagemaker:<your_region>:<your_account_id>:studio-lifecycle-config/install-codeserver-on-jupyterserver"
86-
]
87-
}}'
64+
From a terminal appropriately configured with AWS CLI, run the following commands:
65+
66+
curl -LO https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amazon-sagemaker-codeserver-0.1.5.tar.gz
67+
tar -xvzf amazon-sagemaker-codeserver-0.1.5.tar.gz
68+
69+
cd amazon-sagemaker-codeserver/install-scripts/studio
70+
71+
LCC_CONTENT=`openssl base64 -A -in install-codeserver.sh`
72+
73+
aws sagemaker create-studio-lifecycle-config \
74+
--studio-lifecycle-config-name install-codeserver-on-jupyterserver \
75+
--studio-lifecycle-config-content $LCC_CONTENT \
76+
--studio-lifecycle-config-app-type JupyterServer \
77+
--query 'StudioLifecycleConfigArn'
78+
79+
aws sagemaker update-domain \
80+
--region <your_region> \
81+
--domain-id <your_domain_id> \
82+
--default-user-settings \
83+
'{
84+
"JupyterServerAppSettings": {
85+
"DefaultResourceSpec": {
86+
"LifecycleConfigArn": "arn:aws:sagemaker:<your_region>:<your_account_id>:studio-lifecycle-config/install-codeserver-on-jupyterserver",
87+
"InstanceType": "system"
88+
},
89+
"LifecycleConfigArns": [
90+
"arn:aws:sagemaker:<your_region>:<your_account_id>:studio-lifecycle-config/install-codeserver-on-jupyterserver"
91+
]
92+
}}'
8893

8994
Make sure to replace <your_domain_id>, <your_region> and <your_account_id> in the previous commands with the Studio domain ID, the AWS region and AWS Account ID you are using respectively.
9095

@@ -94,49 +99,61 @@ Amazon SageMaker Notebook Instances support lifecycle configuration scripts that
9499

95100
**Example: Create a notebook instance and install code-server automatically**
96101

97-
1. Download the [install-codeserver](install-scripts/notebook-instances/install-codeserver.sh) and [setup-codeserver](install-scripts/notebook-instances/setup-codeserver.sh) scripts in a directory of choice.
102+
From a terminal appropriately configured with AWS CLI, run the following commands:
103+
104+
curl -LO https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amazon-sagemaker-codeserver-0.1.5.tar.gz
105+
tar -xvzf amazon-sagemaker-codeserver-0.1.5.tar.gz
98106

99-
2. From a terminal appropriately configured with AWS CLI, run the following commands in the directory above:
107+
cd amazon-sagemaker-codeserver/install-scripts/notebook-instances
100108

101-
aws sagemaker create-notebook-instance-lifecycle-config \
102-
--notebook-instance-lifecycle-config-name install-codeserver \
103-
--on-start Content=$((cat setup-codeserver.sh || echo "")| base64) \
104-
--on-create Content=$((cat install-codeserver.sh || echo "")| base64)
109+
aws sagemaker create-notebook-instance-lifecycle-config \
110+
--notebook-instance-lifecycle-config-name install-codeserver \
111+
--on-start Content=$((cat setup-codeserver.sh || echo "")| base64) \
112+
--on-create Content=$((cat install-codeserver.sh || echo "")| base64)
105113

106-
aws sagemaker create-notebook-instance \
107-
--notebook-instance-name <your_notebook_instance_name> \
108-
--instance-type <your_instance_type> \
109-
--role-arn <your_role_arn> \
110-
--lifecycle-config-name install-codeserver
114+
aws sagemaker create-notebook-instance \
115+
--notebook-instance-name <your_notebook_instance_name> \
116+
--instance-type <your_instance_type> \
117+
--role-arn <your_role_arn> \
118+
--lifecycle-config-name install-codeserver
111119

112120
Make sure to replace <your_notebook_instance_name>, <your_instance_type> and <your_role_arn> in the previous commands with the appropriate values.
113121

114122
### Install manually
115123

116124
#### Amazon SageMaker Studio
117125

118-
1. Open the SageMaker Studio system terminal
119-
2. Download the [install-codeserver](install-scripts/studio/install-codeserver.sh) script in a directory of choice
120-
3. From the same download directory, run the following commands:
121-
126+
1. Open the Amazon SageMaker Studio system terminal
127+
2. From the terminal, run the following commands:
128+
129+
curl -LO https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amazon-sagemaker-codeserver-0.1.5.tar.gz
130+
tar -xvzf amazon-sagemaker-codeserver-0.1.5.tar.gz
131+
132+
cd amazon-sagemaker-codeserver/install-scripts/studio
133+
122134
chmod +x install-codeserver.sh
123135
./install-codeserver.sh
124136

125137
# Note: when installing on JL1, please prepend the nohup command to the install command above and run as follows:
126138
# nohup ./install-codeserver.sh
127-
139+
128140

129141
#### Amazon SageMaker Notebook Instances
130142

131143
1. Access JupyterLab and open a terminal
132-
2. Download the [install-codeserver](install-scripts/notebook-instances/install-codeserver.sh) and [setup-codeserver](install-scripts/notebook-instances/setup-codeserver.sh) scripts in a directory of choice
133-
3. From the same download directory, run the following commands:
144+
2. From the terminal run the following commands:
145+
146+
curl -LO https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amazon-sagemaker-codeserver-0.1.5.tar.gz
147+
tar -xvzf amazon-sagemaker-codeserver-0.1.5.tar.gz
134148

149+
cd amazon-sagemaker-codeserver/install-scripts/notebook-instances
150+
135151
chmod +x install-codeserver.sh
136152
chmod +x setup-codeserver.sh
137153
sudo ./install-codeserver.sh
138154
sudo ./setup-codeserver.sh
139-
4. \[Optional\] - After a stop/restart operation, run the following command to re-configure code-server:
155+
156+
3. \[Optional\] - After a stop/restart operation, run the following command to re-configure code-server:
140157

141158
sudo ./setup-codeserver.sh
142159

0 commit comments

Comments
 (0)