Skip to content

Commit

Permalink
Merge branch 'release/0.17.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Nov 11, 2024
2 parents ca03fa4 + fbfa310 commit ab0b78e
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 120 deletions.
31 changes: 31 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## Version 0.17.0 [2024-11-10]

### New Features

* Add option `--which=<values>` for `rsc config`, which default to
`--which="rsc,rstudio,sessions"`, where `rsc` displays the RStudio
Server Controller settings, `rstudio` the RStudio configuration,
and `user` on the RStudio sessions storage.

* Add option `--which=<values>` for `rsc reset`, which default to
support for `rsc reset --which="rsc"`, which resets the RStudio
Server Controller settings. If `sessions`, the user's RStudio
sessions folder (e.g. `~/.local/share/rstudio`) to a dated tar
file, and then remove that folder. This can be used as a last
resort when the RStudio Server gets stuck at "R is taking longer to
start than usual" after logging in.

* Add environment variable `RSC_RSESSION_TIMEOUT_SUSPEND` to control
whether a timed out R session should be suspended to disk. If `1`
(default), it will be suspended to disk, otherwise not.

* Now `rsc config` reports also on total directory sizes.

### Bug Fixes

* `rsc reset` did not remove the internal `rserver.pid` and
`rserver_monitor.pid` files.

* `rsc config` reported on file sizes with a stray trailing parenthesis.


## Version 0.16.2 [2024-08-21]

### Miscellaneous
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,20 @@ As before, the RStudio Server is available at
```sh
$ cd /path/to/software
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.16.2.tar.gz
$ tar xf 0.16.2.tar.gz
$ PATH=/path/to/softwarerstudio-server-controller-0.16.2/bin:$PATH
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.17.0.tar.gz
$ tar xf 0.17.0.tar.gz
$ PATH=/path/to/softwarerstudio-server-controller-0.17.0/bin:$PATH
$ export PATH
$ rsc --version
0.16.2
0.17.0
```
To verify that the tool can find R and the RStudio Server executables,
call:
```sh
$ rsc --version --full
rsc: 0.16.2
rsc: 0.17.0
RStudio Server: 2023.06.2+561 (Mountain Hydrangea) for Linux [/path/to/rstudio-server/bin/rstudio-server]
R: 4.3.1 (2023-06-16) -- "Shortstop Beagle" [/path/to/R/bin/R]
```
Expand Down
42 changes: 41 additions & 1 deletion bin/incl/files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,52 @@ function file_info {
local file=${1:?}
local -i size
local timestamp
local now
local age

if [[ -f "${file}" ]]; then
size=$(stat --format="%s" "${file}")
timestamp=$(stat --format="%Y" "${file}")
now=$(date "+%s")
age=$(( (now - timestamp) / 3600 ))
if [[ ${age} -lt 48 ]]; then
age="${age} hours ago"
else
age="$((age / 24)) days ago"
fi
timestamp=$(date -d "@${timestamp}" "+%F %T")
echo "${size} bytes; ${timestamp})"
echo "${size} bytes; ${timestamp} (${age})"
else
echo "<not available>"
fi
}

function dir_info {
local dir=${1:?}
local -i size
local timestamp
local now
local age

if [[ -d "${dir}" ]]; then
size=$(du --summarize --bytes "${dir}" | cut -f 1)
timestamp=$(stat --format="%Y" "${dir}")
now=$(date "+%s")
age=$((now - timestamp))
age=$((age / 60))
if [[ ${age} -lt 120 ]]; then
age="${age} minutes ago"
else
age=$((age / 60))
if [[ ${age} -lt 48 ]]; then
age="${age} hours ago"
else
age=$((age / 24))
age="${age} days ago"
fi
fi
timestamp=$(date -d "@${timestamp}" "+%F %T")
echo "${size} bytes; ${timestamp} (${age})"
else
echo "<not available>"
fi
Expand Down
Loading

0 comments on commit ab0b78e

Please sign in to comment.