Skip to content
Snippets Groups Projects
Commit 5cc4f3cd authored by tristan.gillard@centralesupelec.fr's avatar tristan.gillard@centralesupelec.fr
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.2.2] - 2019-08-20
### Fixed
- Fixed bug where user's login shell was always set to Bash inside desktop sessions
## [0.2.1] - 2019-02-07
### Fixed
- Spelling
## [0.2.0] - 2018-03-26
### Added
- Added support for the Xfce desktop.
### Changed
- Moved "Account" field higher up in the form.
- Updated date in `LICENSE.txt`.
### Fixed
- Disabled all the unnecessary services that are auto-started when Mate loads.
- Fixed local configuration directory not always being ignored.
- Set Mate and Xfce terminals to launch login shell to get proper `TERM` set.
- Restore module environment in login shells.
### Removed
- Remove local OSC configuration as this has moved to
[osc-ood-config](https://github.com/OSC/osc-ood-config).
## [0.1.2] - 2017-10-12
### Changed
- Modified app to take advantage of ERB templates in updated Dashboard.
[#3](https://github.com/OSC/bc_desktop/issues/3)
## [0.1.1] - 2017-07-12
### Changed
- Changed the `CHANGELOG.md` formatting.
- Fixed form attributes `node_type` to `null` and `desktop` to `"mate"` for
default installs.
## [0.1.0] - 2017-06-14
### Changed
- Refactored for the new Batch Connect app.
### Fixed
- Disable disk check utility on startup.
[#2](https://github.com/OSC/bc_desktop/issues/2)
## [0.0.3] - 2017-01-18
### Fixed
- Set desktop working dir to user's home dir.
## [0.0.2] - 2017-01-04
### Added
- Added Mate desktop support.
- Added variable `$DESKTOP` that specifies desktop script run.
## 0.0.1 (2016-12-14)
### Added
- Initial release!
[Unreleased]: https://github.com/OSC/bc_desktop/compare/v0.2.2...HEAD
[0.2.2]: https://github.com/OSC/bc_desktop/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/OSC/bc_desktop/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/OSC/bc_desktop/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/OSC/bc_desktop/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/OSC/bc_desktop/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/OSC/bc_desktop/compare/v0.0.3...v0.1.0
[0.0.3]: https://github.com/OSC/bc_desktop/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/OSC/bc_desktop/compare/v0.0.1...v0.0.2
Copyright (c) 2016-2018 Ohio Supercomputer Center
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Batch Connect - Desktop
This app is distributed as a part of Open OnDemand. Read https://osc.github.io/ood-documentation/latest/enable-desktops.html
for instructions on how to configure it.
\ No newline at end of file
form.yml 0 → 100644
---
attributes:
desktop:
label: "Desktop Environment"
widget: select
options:
- "gnome"
- "kde"
- "mate"
- "xfce"
bc_vnc_idle: 0
bc_vnc_resolution:
required: true
node_type: null
form:
- bc_vnc_idle
- desktop
- bc_account
- bc_num_hours
- bc_num_slots
- node_type
- bc_queue
- bc_vnc_resolution
- bc_email_on_started
---
name: Desktop
icon: fa://desktop
category: Interactive Apps
subcategory: Desktops
role: batch_connect
description: |
This app will launch an interactive desktop on one or more compute nodes. You
will have full access to the resources these nodes provide. This is analogous
to an interactive batch job.
---
batch_connect:
template: vnc
# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module
# Turn off screensaver
gconftool-2 --set -t boolean /apps/gnome-screensaver/idle_activation_enabled false
# Use browser window instead in nautilus
gconftool-2 --set -t boolean /apps/nautilus/preferences/always_use_browser true
# Disable the disk check utility on autostart
mkdir -p "${HOME}/.config/autostart"
cat "/etc/xdg/autostart/gdu-notification-daemon.desktop" <(echo "X-GNOME-Autostart-enabled=false") > "${HOME}/.config/autostart/gdu-notification-daemon.desktop"
# Remove any preconfigured monitors
if [[ -f "${HOME}/.config/monitors.xml" ]]; then
mv "${HOME}/.config/monitors.xml" "${HOME}/.config/monitors.xml.bak"
fi
# Start up Gnome desktop (block until user logs out of desktop)
/etc/X11/xinit/Xsession gnome-session
startkde
\ No newline at end of file
# Turn off screensaver (this may not exist at all)
gsettings set org.mate.screensaver idle-activation-enabled false
# Disable gnome-keyring-daemon
gsettings set org.mate.session gnome-compat-startup "['smproxy']"
# Remove any preconfigured monitors
if [[ -f "${HOME}/.config/monitors.xml" ]]; then
mv "${HOME}/.config/monitors.xml" "${HOME}/.config/monitors.xml.bak"
fi
# Disable useless services on autostart
AUTOSTART="${HOME}/.config/autostart"
rm -fr "${AUTOSTART}" # clean up previous autostarts
mkdir -p "${AUTOSTART}"
for service in "gnome-keyring-gpg" "gnome-keyring-pkcs11" "gnome-keyring-secrets" "gnome-keyring-ssh" "mate-volume-control-applet" "polkit-mate-authentication-agent-1" "pulseaudio" "rhsm-icon" "spice-vdagent" "xfce4-power-manager"; do
cat "/etc/xdg/autostart/${service}.desktop" <(echo "X-MATE-Autostart-enabled=false") > "${AUTOSTART}/${service}.desktop"
done
# Disable pulseaudio
# Warning: If you disable pulseaudio you get flooded with warning messages
#PULSE_CONFIG="${HOME}/.config/pulse/client.conf"
#mkdir -p "$(dirname "${PULSE_CONFIG}")"
#echo "autospawn = no" > "${PULSE_CONFIG}"
# Run Mate Terminal as login shell (sets proper TERM)
dconf write /org/mate/terminal/profiles/default/login-shell true
# Start up mate desktop (block until user logs out of desktop)
mate-session
# Remove any preconfigured monitors
if [[ -f "${HOME}/.config/monitors.xml" ]]; then
mv "${HOME}/.config/monitors.xml" "${HOME}/.config/monitors.xml.bak"
fi
# Copy over default panel if doesn't exist, otherwise it will prompt the user
PANEL_CONFIG="${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
if [[ ! -e "${PANEL_CONFIG}" ]]; then
mkdir -p "$(dirname "${PANEL_CONFIG}")"
cp "/etc/xdg/xfce4/panel/default.xml" "${PANEL_CONFIG}"
fi
# Disable startup services
xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false
# Disable useless services on autostart
AUTOSTART="${HOME}/.config/autostart"
rm -fr "${AUTOSTART}" # clean up previous autostarts
mkdir -p "${AUTOSTART}"
for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"; do
echo -e "[Desktop Entry]\nHidden=true" > "${AUTOSTART}/${service}.desktop"
done
# Run Xfce4 Terminal as login shell (sets proper TERM)
TERM_CONFIG="${HOME}/.config/xfce4/terminal/terminalrc"
if [[ ! -e "${TERM_CONFIG}" ]]; then
mkdir -p "$(dirname "${TERM_CONFIG}")"
sed 's/^ \{4\}//' > "${TERM_CONFIG}" << EOL
[Configuration]
CommandLoginShell=TRUE
EOL
else
sed -i \
'/^CommandLoginShell=/{h;s/=.*/=TRUE/};${x;/^$/{s//CommandLoginShell=TRUE/;H};x}' \
"${TERM_CONFIG}"
fi
# launch dbus first through eval becuase it can conflict with a conda environment
# see https://github.com/OSC/ondemand/issues/700
eval $(dbus-launch --sh-syntax)
# Start up xfce desktop (block until user logs out of desktop)
xfce4-session
#!/usr/bin/env bash
# Change working directory to user's home directory
cd "${HOME}"
# Reset module environment (may require login shell for some HPC clusters)
module purge && module restore
# Ensure that the user's configured login shell is used
export SHELL="$(getent passwd $USER | cut -d: -f7)"
# Start up desktop
echo "Launching desktop '<%= context.desktop %>'..."
source "<%= session.staged_root.join("desktops", "#{context.desktop}.sh") %>"
echo "Desktop '<%= context.desktop %>' ended..."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment