Skip to content
Snippets Groups Projects
Commit 8588e5a6 authored by Matthew K Defenderfer's avatar Matthew K Defenderfer
Browse files

overwrite everything with the actual OSC desktop repo files

parent 075a367f
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.
# Modified OOD Desktop
# Batch Connect - Desktop
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.rc.uab.edu/rc-data-science/community-ood-sandbox/modified-ood-desktop.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.rc.uab.edu/rc-data-science/community-ood-sandbox/modified-ood-desktop/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
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: HPC Desktop
name: Desktop
icon: fa://desktop
category: Interactive Apps
subcategory: Desktops
role: batch_connect
description: |
This app will launch an OOD Desktop app
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
# gnome won't start correctly without DBUS_SESSION_BUS_ADDRESS set.
eval $(dbus-launch --sh-syntax)
source /etc/os-release
function classic(){
export XDG_SESSION_TYPE="${XDG_SESSION_TYPE:-x11}"
export GNOME_SHELL_SESSION_MODE="${GNOME_SHELL_SESSION_MODE:-classic}"
export GNOME_SESSION_MODE="${GNOME_SESSION_MODE:-classic}"
}
function wayland() {
export XDG_SESSION_TYPE="${XDG_SESSION_TYPE:-x11}"
export GNOME_SHELL_SESSION_MODE="${GNOME_SHELL_SESSION_MODE:-wayland}"
export GNOME_SESSION_MODE="${GNOME_SESSION_MODE:-wayland}"
}
if [[ "$ID_LIKE" =~ "fedora" ]]; then
if [[ "$VERSION_ID" < "8.0" ]]; then
# el7 will crash using wayland.
classic
else
wayland
fi
else
wayland
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
if [[ -f "/etc/xdg/autostart/${service}.desktop" ]]; then
cat "/etc/xdg/autostart/${service}.desktop" <(echo "X-MATE-Autostart-enabled=false") > "${AUTOSTART}/${service}.desktop"
fi
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)"
# use a safe PATH to boot the desktop because dbus-launch can be
# in another location from a python/conda installation and that will
# conflict and cause issues. See https://github.com/OSC/ondemand/issues/700 for more.
SAFE_PATH="/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin"
# Start up desktop
echo "Launching desktop '<%= context.desktop %>'..."
PATH="$SAFE_PATH" source "<%= session.staged_root.join("desktops", "#{context.desktop}.sh") %>"
echo "Desktop '<%= context.desktop %>' ended with $? status..."
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