Skip to content

Commit 6f94a8f

Browse files
authored
fix port config for slurm (#27)
1 parent 81ddf87 commit 6f94a8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

template/before.sh.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ source /etc/profile.d/lmod.sh
77
source /bin/find_host_port
88
source /bin/save_passwd_as_secret
99
source /bin/create_salt_and_sha1
10+
export JUPYTER_PORT=8080
1011
<%- else -%>
1112
[[ $(type -t module) == "function" ]] && export -f module
1213

1314
# Find available port to run server on
1415
port=$(find_port ${host})
16+
JUPYTER_PORT="${port}"
17+
HOST_CFG="${host}"
18+
PORT_CFG="${port}"
1519

1620
# Generate SHA1 encrypted password (requires OpenSSL installed)
1721
SALT="$(create_passwd 16)"
@@ -68,7 +72,7 @@ umask 077
6872
cat > "${CONFIG_FILE}" << EOL
6973
c.KernelSpecManager.ensure_native_kernel = False
7074
c.NotebookApp.ip = '*'
71-
c.NotebookApp.port = 8080
75+
c.NotebookApp.port = ${JUPYTER_PORT}
7276
c.NotebookApp.base_url = '/node/${HOST_CFG}/${PORT_CFG}/'
7377
c.NotebookApp.terminado_settings = {'shell_command': ['/bin/bash', '--login', '-i']}
7478
c.NotebookApp.port_retries = 0

0 commit comments

Comments
 (0)