Skip to content

Commit 707f05b

Browse files
author
Ruinong Tian
committed
Revert "Remove Jupyter_AI config override from post script for future patch versions"
This reverts commit 28e6010.
1 parent 28e6010 commit 707f05b

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

build_artifacts/v2/v2.7/v2.7.0/dirs/etc/sagemaker-ui/sagemaker_ui_post_startup.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
#!/bin/bash
22
set -eux
33

4+
# Only run the following commands if SAGEMAKER_APP_TYPE_LOWERCASE is jupyterlab
5+
if [ "${SAGEMAKER_APP_TYPE_LOWERCASE}" = "jupyterlab" ]; then
6+
# Override Jupyter AI config file with specific content only for 2.6
7+
# this is a potential workaround for Q chat issue where the chat does not
8+
# load since it does not pick up the latest config file
9+
NB_USER=sagemaker-user
10+
# Check if Jupyter AI config file exists, override with specific content if so only for 2.6
11+
# this is a potential workaround for Q chat issue
12+
JUPYTER_AI_CONFIG_PATH=/home/${NB_USER}/.local/share/jupyter/jupyter_ai/config.json
13+
JUPYTER_AI_CONFIG_CONTENT='{
14+
"model_provider_id": "amazon-q:Q-Developer",
15+
"embeddings_provider_id": null,
16+
"send_with_shift_enter": false,
17+
"fields": {},
18+
"api_keys": {},
19+
"completions_model_provider_id": null,
20+
"completions_fields": {},
21+
"embeddings_fields": {}
22+
}'
23+
24+
# Overwrite the file if it exists (or create it if it doesn't)
25+
echo "$JUPYTER_AI_CONFIG_CONTENT" > "$JUPYTER_AI_CONFIG_PATH"
26+
fi
27+
428
# Writes script status to file. This file is read by an IDE extension responsible for dispatching UI post-startup-status to the user.
529
write_status_to_file() {
630
local status="$1"

build_artifacts/v3/v3.2/v3.2.0/dirs/etc/sagemaker-ui/sagemaker_ui_post_startup.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
#!/bin/bash
22
set -eux
33

4+
# Only run the following commands if SAGEMAKER_APP_TYPE_LOWERCASE is jupyterlab
5+
if [ "${SAGEMAKER_APP_TYPE_LOWERCASE}" = "jupyterlab" ]; then
6+
# Override Jupyter AI config file with specific content only for 2.6
7+
# this is a potential workaround for Q chat issue where the chat does not
8+
# load since it does not pick up the latest config file
9+
NB_USER=sagemaker-user
10+
# Check if Jupyter AI config file exists, override with specific content if so only for 2.6
11+
# this is a potential workaround for Q chat issue
12+
JUPYTER_AI_CONFIG_PATH=/home/${NB_USER}/.local/share/jupyter/jupyter_ai/config.json
13+
JUPYTER_AI_CONFIG_CONTENT='{
14+
"model_provider_id": "amazon-q:Q-Developer",
15+
"embeddings_provider_id": null,
16+
"send_with_shift_enter": false,
17+
"fields": {},
18+
"api_keys": {},
19+
"completions_model_provider_id": null,
20+
"completions_fields": {},
21+
"embeddings_fields": {}
22+
}'
23+
24+
# Overwrite the file if it exists (or create it if it doesn't)
25+
echo "$JUPYTER_AI_CONFIG_CONTENT" > "$JUPYTER_AI_CONFIG_PATH"
26+
fi
27+
428
# Writes script status to file. This file is read by an IDE extension responsible for dispatching UI post-startup-status to the user.
529
write_status_to_file() {
630
local status="$1"

0 commit comments

Comments
 (0)