diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ab78651 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# 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.0.1 - 2019-08-15 +### Added +- Initial release! diff --git a/README.md b/README.md index 9129b7c..6035cd3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,65 @@ -# bc_osc_stata -Batch Connect - OSC Stata +# Batch Connect - OSC Stata + +![GitHub Release](https://img.shields.io/github/release/osc/bc_osc_stata.svg) +[![GitHub License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT) + +A Batch Connect app designed for OSC OnDemand that launches Stata within an +Owens batch job. + +## Prerequisites + +This Batch Connect app requires the following software be installed on the +**compute nodes** that the batch job is intended to run on (**NOT** the +OnDemand node): + +- [Stata] 15 +- [Xfce Desktop] 4+ + +For VNC server support: + +- [TurboVNC] 2.1+ +- [websockify] 0.8.0+ + +**Optional** software: + +- [Lmod] 6.0.1+ or any other `module purge` and `module load ` based + CLI used to load appropriate environments within the batch job + +[Stata]: https://www.stata.com/ +[Xfce Desktop]: https://xfce.org/ +[TurboVNC]: http://www.turbovnc.org/ +[websockify]: https://github.com/novnc/websockify +[Lmod]: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod + +## Install + +Use git to clone this app and checkout the desired branch/version you want to +use: + +```sh +scl enable rh-git29 -- git clone +cd +scl enable rh-git29 -- git checkout +``` + +You will not need to do anything beyond this as all necessary assets are +installed. You will also not need to restart this app as it isn't a Passenger +app. + +To update the app you would: + +```sh +cd +scl enable rh-git29 -- git fetch +scl enable rh-git29 -- git checkout +``` + +Again, you do not need to restart the app as it isn't a Passenger app. + +## Contributing + +1. Fork it ( https://github.com/OSC/bc_osc_stata/fork ) +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create a new Pull Request diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..7dd7e2c Binary files /dev/null and b/icon.png differ diff --git a/manifest.yml b/manifest.yml index c79184d..c710e03 100644 --- a/manifest.yml +++ b/manifest.yml @@ -4,7 +4,7 @@ category: Interactive Apps subcategory: GUIs role: batch_connect description: | - This app will laynch a [Stata] GUI on the [Owens cluster]. You will be able to interact with the Stata GUI + This app will launch a [Stata] GUI on the [Owens cluster]. You will be able to interact with the Stata GUI through a VNC session. [Stata]: https://www.stata.com/ diff --git a/template/script.sh.erb b/template/script.sh.erb index b6400b7..560a079 100755 --- a/template/script.sh.erb +++ b/template/script.sh.erb @@ -30,9 +30,13 @@ cd "${HOME}" # Load the required enviornment module load stata -# Launch stat +# Launch stata +# note that xstata-mp doesn't block so we have to watch it xstata-mp -stata_pid=$(ps | grep 'xstata-mp' | awk '{print $1}') + +# Get the PID of the last xstata-mp process started that I own +stata_pid=$( pgrep -u "$USER" 'xstata-mp' | tail ) +# As long as the PID directory exists we wait while [[ -d "/proc/$stata_pid" ]]; do sleep 1 done