This is how I achieved it. Since I don’t have Slurm, for testing purposes I start zsh instead of the default bash, so it should translate.
cd /var/www/ood/apps/sys
sudo cp -r shell shellzsh
cd shellzsh
sudo sed -i 's/Shell/Shell with Z shell/g' manifest.yml
- so manifest has
role: shell
and name: Shell with Z shell
Edit this line in app.js:
cmd = 'ssh';
- args = dir ? [host, '-t', 'cd \'' + dir.replace(/\'/g, "'\\''") + '\' ; exec ${SHELL} -l'] : [host];
+ args = [host, '-t', 'zsh']
- note that in this case I’m not adding support for cd-ing to a subdirectory if
dir
is set but you can probably figure out the control flow to do that if necessary
- you would use something like
args = [host, '-t', 'srun', '--pty', '--qos=sandbox', '/bin/bash']
Edit the dashboard /var/www/ood/apps/sys/dashboard/app/apps/ood_app.rb
in the def links
method there is this block under elsif role == "shell"
:
if login_clusters.none?
[
OodAppLink.new(
- title: "Shell Access",
+ title: "#{title} Access",
description: manifest.description,
url: OodAppkit::Urls::Shell.new(base_url: url).url,
icon_uri: "fas://terminal",
caption: caption,
new_tab: true
)
]
else
login_clusters.map do |cluster|
OodAppLink.new(
- title: "#{cluster.metadata.title || cluster.id.to_s.titleize} Shell Access",
+ title: "#{cluster.metadata.title || cluster.id.to_s.titleize} #{title} Access",
description: manifest.description,
url: OodAppkit::Urls::Shell.new(base_url: url).url(host: cluster.login.host),
icon_uri: "fas://terminal",
caption: caption,
new_tab: true
)
end.sort_by { |lnk| lnk.title }
end
- Click Help => Restart web server to pick up the changes.
The result is a menu that looks like this:
And clicking “Owens Shell with Z shell Access” actually starts zsh instead of bash (or the users default shell).
I’ll open an issue to make changes similar the above so this type of thing is easier to do, without actually having to copy the shell app.