Skip to content

Commit c8a24ef

Browse files
author
Verdi March
committed
Apr'24 updates
- update to jlab-4.1.x configurations - set git diff pager to side-by-side view - do not install aws-cdk by default -- glibc on smnb/alinux2 too old, it's really troublesome nowadays to figure out the right way to run cdk on this environment.
1 parent 01786cd commit c8a24ef

File tree

5 files changed

+104
-77
lines changed

5 files changed

+104
-77
lines changed

initsmnb/TEMPLATE-setup-my-sagemaker.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ run_and_track_stat ${BIN_DIR}/upgrade-jupyter.sh &> ~/INITSMNB-upgrade-jupyt
9595
run_and_track_stat ${BIN_DIR}/install-cdk.sh &> ~/INITSMNB-install-cdk.txt &
9696
run_and_track_stat ${BIN_DIR}/install-code-server.sh &> ~/INITSMNB-install-code-server.txt &
9797

98-
${BIN_DIR}/adjust-sm-git.sh 'Firstname Lastname' first.last@email.abc
9998
${BIN_DIR}/fix-osx-keymap.sh
10099
${BIN_DIR}/patch-bash-config.sh
101100
${BIN_DIR}/fix-ipython.sh
@@ -146,6 +145,9 @@ rm -fr ~/.cache/{pip,yarn}/
146145
echo -e "\nJobs status:"
147146
egrep -e '^INITSMNB SUCCESS|^INITSMNB ERROR' ~/INITSMNB*txt
148147

148+
# Move it here to ensure delta's presence.
149+
${BIN_DIR}/adjust-sm-git.sh 'Firstname Lastname' first.last@email.abc
150+
149151

150152
################################################################################
151153
# 040: Epilog

initsmnb/adjust-sm-git.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ git config --global alias.lolac "! clear; git lol --all -\$(expr \`tput lines\`
4444
echo Setup steps for HTTPS connections to AWS CodeCommit repositories
4545
git config --global credential.helper '!aws codecommit credential-helper $@'
4646
git config --global credential.UseHttpPath true
47+
48+
if command -v delta &> /dev/null ; then
49+
echo "adjust-git.sh: delta is available..."
50+
git config --global core.pager "delta -s"
51+
git config --global interactive.diffFilter "delta -s --color-only"
52+
git config --global delta.navigate "true"
53+
fi

initsmnb/change-jlab-ui.sh

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ cat << EOF > $JUPYTER_CONFIG_ROOT/apputils-extension/themes.jupyterlab-settings
1616
"overrides": {
1717
"code-font-size": "11px",
1818
"content-font-size1": "13px"
19-
}
19+
},
20+
21+
// Scrollbar Theming
22+
// Enable/disable styling of the application scrollbars
23+
"theme-scrollbars": false
2024
}
2125
EOF
2226

@@ -38,37 +42,53 @@ cat << EOF > $JUPYTER_CONFIG_ROOT/terminal-extension/plugin.jupyterlab-settings
3842
}
3943
EOF
4044

41-
mkdir -p $JUPYTER_CONFIG_ROOT/fileeditor-extension/
42-
cat << EOF > $JUPYTER_CONFIG_ROOT/fileeditor-extension/plugin.jupyterlab-settings
45+
mkdir -p $JUPYTER_CONFIG_ROOT/codemirror-extension/
46+
cat << EOF > $JUPYTER_CONFIG_ROOT/codemirror-extension/plugin.jupyterlab-settings
4347
{
44-
"editorConfig": {
45-
"rulers": [80, 100],
48+
// CodeMirror
49+
// @jupyterlab/codemirror-extension:plugin
50+
// Text editor settings for all CodeMirror editors.
51+
// ************************************************
52+
53+
"defaultConfig": {
4654
"codeFolding": true,
47-
"lineNumbers": true,
48-
"lineWrap": "off"
55+
"highlightActiveLine": true,
56+
"highlightTrailingWhitespace": true,
57+
"rulers": [
58+
80,
59+
100
60+
]
4961
}
5062
}
5163
EOF
5264

5365
mkdir -p $JUPYTER_CONFIG_ROOT/notebook-extension/
5466
cat << EOF > $JUPYTER_CONFIG_ROOT/notebook-extension/tracker.jupyterlab-settings
5567
{
68+
// Notebook
69+
// @jupyterlab/notebook-extension:tracker
70+
// Notebook settings.
71+
// **************************************
72+
73+
// Code Cell Configuration
74+
// The configuration for all code cells; it will override the CodeMirror default configuration.
5675
"codeCellConfig": {
57-
"rulers": [80, 100],
58-
"codeFolding": true,
5976
"lineNumbers": true,
60-
"lineWrap": "off"
77+
"lineWrap": true
6178
},
79+
80+
// Markdown Cell Configuration
81+
// The configuration for all markdown cells; it will override the CodeMirror default configuration.
6282
"markdownCellConfig": {
63-
"rulers": [80, 100],
64-
"codeFolding": true,
6583
"lineNumbers": true,
66-
"lineWrap": "off"
84+
"lineWrap": true
6785
},
86+
87+
// Raw Cell Configuration
88+
// The configuration for all raw cells; it will override the CodeMirror default configuration.
6889
"rawCellConfig": {
69-
"rulers": [80, 100],
7090
"lineNumbers": true,
71-
"lineWrap": "off"
91+
"lineWrap": true
7292
}
7393
}
7494
EOF

initsmnb/install-initsmnb.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ GIT_USER=''
9494
GIT_EMAIL=''
9595
CONFIG_DOCKER=1
9696
PLAIN_OLD_JLAB=0
97-
INSTALL_CDK=1
97+
INSTALL_CDK=0
9898

9999
declare -a EFS=()
100100

@@ -103,7 +103,7 @@ declare -a HELP=(
103103
"[-l|--from-local]"
104104
"[--git-user 'First Last']"
105105
"[--git-email me@abc.def]"
106-
"[--no-cdk]"
106+
"[--with-cdk]"
107107
"[--efs 'fsid,fsap,mp' [--efs ...]]"
108108
"[--no-config-docker]"
109109
"[--plain-old-jlab]"
@@ -151,8 +151,8 @@ parse_args() {
151151
PLAIN_OLD_JLAB=1
152152
shift
153153
;;
154-
--no-cdk)
155-
INSTALL_CDK=0
154+
--with-cdk)
155+
INSTALL_CDK=1
156156
shift
157157
;;
158158
*)

initsmnb/upgrade-jupyter.sh

Lines changed: 55 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -141,28 +141,26 @@ cat << EOF > $JUPYTER_CONFIG_ROOT/notebook-extension/tracker.jupyterlab-settings
141141
// @jupyterlab/notebook-extension:tracker
142142
// Notebook settings.
143143
// **************************************
144+
145+
// Code Cell Configuration
146+
// The configuration for all code cells; it will override the CodeMirror default configuration.
144147
"codeCellConfig": {
145-
"rulers": [80, 100],
146-
"codeFolding": true,
147148
"lineNumbers": true,
148-
"lineWrap": "off",
149-
"showTrailingSpace": true,
150-
"wordWrapColumn": 100
149+
"lineWrap": true
151150
},
151+
152+
// Markdown Cell Configuration
153+
// The configuration for all markdown cells; it will override the CodeMirror default configuration.
152154
"markdownCellConfig": {
153-
"rulers": [80, 100],
154-
"codeFolding": true,
155155
"lineNumbers": true,
156-
"lineWrap": "off",
157-
"showTrailingSpace": true,
158-
"wordWrapColumn": 100
156+
"lineWrap": true
159157
},
158+
159+
// Raw Cell Configuration
160+
// The configuration for all raw cells; it will override the CodeMirror default configuration.
160161
"rawCellConfig": {
161-
"rulers": [80, 100],
162162
"lineNumbers": true,
163-
"lineWrap": "off",
164-
"showTrailingSpace": true,
165-
"wordWrapColumn": 100
163+
"lineWrap": true
166164
},
167165
168166
// Since: jlab-2.0.0
@@ -171,20 +169,22 @@ cat << EOF > $JUPYTER_CONFIG_ROOT/notebook-extension/tracker.jupyterlab-settings
171169
}
172170
EOF
173171

174-
mkdir -p $JUPYTER_CONFIG_ROOT/fileeditor-extension/
175-
cat << EOF > $JUPYTER_CONFIG_ROOT/fileeditor-extension/plugin.jupyterlab-settings
172+
mkdir -p $JUPYTER_CONFIG_ROOT/codemirror-extension/
173+
cat << EOF > $JUPYTER_CONFIG_ROOT/codemirror-extension/plugin.jupyterlab-settings
176174
{
177-
// Text Editor
178-
// @jupyterlab/fileeditor-extension:plugin
179-
// Text editor settings.
180-
// ***************************************
181-
"editorConfig": {
182-
"rulers": [80, 100],
175+
// CodeMirror
176+
// @jupyterlab/codemirror-extension:plugin
177+
// Text editor settings for all CodeMirror editors.
178+
// ************************************************
179+
180+
"defaultConfig": {
183181
"codeFolding": true,
184-
"lineNumbers": true,
185-
"lineWrap": "off",
186-
"showTrailingSpace": true,
187-
"wordWrapColumn": 100
182+
"highlightActiveLine": true,
183+
"highlightTrailingWhitespace": true,
184+
"rulers": [
185+
80,
186+
100
187+
]
188188
}
189189
}
190190
EOF
@@ -228,39 +228,34 @@ cat << EOF > $JUPYTER_CONFIG_ROOT/apputils-extension/palette.jupyterlab-settings
228228
// Command palette settings.
229229
// **************************************
230230
231-
// Modal Command Palette
232-
// Whether the command palette should be modal or in the left panel.
233-
"modal": false
231+
"modal": false // Command palette on the left panel.
234232
}
235233
EOF
236234

237235
# Linter for notebook editors and code editors. Do not autosave on notebook, because it's broken
238236
# on multi-line '!some_command \'. Note that autosave doesn't work on text editor anyway.
239-
mkdir -p $JUPYTER_CONFIG_ROOT/../\@ryantam626/jupyterlab_code_formatter/
240-
cat << EOF > $JUPYTER_CONFIG_ROOT/../\@ryantam626/jupyterlab_code_formatter/settings.jupyterlab-settings
237+
mkdir -p $JUPYTER_CONFIG_ROOT/../jupyterlab_code_formatter/
238+
cat << EOF > $JUPYTER_CONFIG_ROOT/../jupyterlab_code_formatter/settings.jupyterlab-settings
241239
{
242240
// Jupyterlab Code Formatter
243-
// @ryantam626/jupyterlab_code_formatter:settings
241+
// jupyterlab_code_formatter:settings
244242
// Jupyterlab Code Formatter settings.
245-
// **********************************************
243+
// ***********************************
244+
245+
"formatOnSave": false,
246246
247-
// Black Config
248-
// Config to be passed into black's format_str function call.
249247
"black": {
250-
"line_length": 100
248+
"line_length": 100,
249+
"string_normalization": true
251250
},
252251
253-
// Auto format config
254-
// Auto format code when save the notebook.
255-
"formatOnSave": false,
256-
257252
// Isort Config
258253
// Config to be passed into isort's SortImports function call.
259254
"isort": {
260-
"multi_line_output": 3,
261-
"include_trailing_comma": true,
262-
"force_grid_wrap": 0,
263-
"use_parentheses": true,
255+
//"multi_line_output": 3,
256+
//"include_trailing_comma": true,
257+
//"force_grid_wrap": 0,
258+
//"use_parentheses": true,
264259
"line_length": 100
265260
}
266261
}
@@ -271,13 +266,15 @@ EOF
271266
# (numbers start from 1).
272267
# - Do not auto-number headings in output cells.
273268
mkdir -p $JUPYTER_CONFIG_ROOT/toc-extension
274-
cat << EOF > $JUPYTER_CONFIG_ROOT/toc-extension/plugin.jupyterlab-settings
269+
cat << EOF > $JUPYTER_CONFIG_ROOT/toc-extension/registry.jupyterlab-settings
275270
{
276271
// Table of Contents
277272
// @jupyterlab/toc-extension:plugin
278273
// Table of contents settings.
279274
// ********************************
275+
280276
"includeOutput": false,
277+
"numberHeaders": true,
281278
"numberingH1": false
282279
}
283280
EOF
@@ -334,32 +331,33 @@ cat << EOF > $JUPYTER_CONFIG_ROOT/settingeditor-extension/form-ui.jupyterlab-set
334331
// Settings editor form ui settings.
335332
// *******************************************
336333
337-
// Type of editor for the setting.
338-
// Set the type of editor to use while editing your settings.
339334
"settingEditorType": "json"
340335
}
341336
EOF
342337

343338
# Disable notification -- Jlab started to get extremely noisy since v3.6.0+
344-
mkdir -p $JUPYTER_CONFIG_ROOT/settingeditor-extension
339+
mkdir -p $JUPYTER_CONFIG_ROOT/apputils-extension
345340
cat << 'EOF' > $JUPYTER_CONFIG_ROOT/apputils-extension/notification.jupyterlab-settings
346341
{
347342
// Notifications
348343
// @jupyterlab/apputils-extension:notification
349344
// Notifications settings.
350345
// *******************************************
351346
352-
// Check for JupyterLab updates
353-
// Whether to check for newer version of JupyterLab or not. It requires `fetchNews` to be `true`
354-
// to be active. If `true`, it will make a request to a website.
355347
"checkForUpdates": false,
348+
"doNotDisturbMode": true, // Silence all notifications.
349+
"fetchNews": "false"
350+
}
351+
EOF
356352

357-
// Silence all notifications
358-
// If `true`, no toast notifications will be automatically displayed.
359-
"doNotDisturbMode": true,
353+
mkdir -p $JUPYTER_CONFIG_ROOT/completer-extension
354+
cat << 'EOF' > $JUPYTER_CONFIG_ROOT/completer-extension/manager.jupyterlab-settings
355+
{
356+
// Code Completion
357+
// @jupyterlab/completer-extension:manager
358+
// Code Completion settings.
359+
// ***************************************
360360
361-
// Fetch official Jupyter news
362-
// Whether to fetch news from Jupyter news feed. If `true`, it will make a request to a website.
363-
"fetchNews": "false"
361+
"autoCompletion": true
364362
}
365363
EOF

0 commit comments

Comments
 (0)