Skip to content

Commit

Permalink
Merge pull request #60 from rstudio/workbench-startup
Browse files Browse the repository at this point in the history
Workbench startup
  • Loading branch information
colearendt authored Apr 5, 2021
2 parents f8594a6 + 67bd176 commit bfb5423
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ansiColor('xterm') {
'workbench': {
node('docker') {
checkout scm
def launcher_image = pullBuildPush(
def workbench_image = pullBuildPush(
image_name: 'workbench',
image_tag: "${RSPVersion}",
build_args: "--build-arg RSP_VERSION=${RSPVersion}",
Expand All @@ -160,7 +160,7 @@ ansiColor('xterm') {
registry_url: 'https://075258722956.dkr.ecr.us-east-1.amazonaws.com',
push: pushImage
)
print "Finished launcher"
print "Finished workbench"
}
},
'4.0': {
Expand Down
34 changes: 32 additions & 2 deletions helper/workbench/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@ deactivate() {
}
trap deactivate EXIT

# usage: use_init_files [file [file [...]]]
# ie: use_init_files /mydir/*
# execute or source initialization files (file extensions and permissions)
use_init_files() {
echo
local file
for file; do
case "$file" in
*.sh)
if [ -x "$file" ]; then
echo "$0: executing file $file"
"$file"
else
echo "$0: sourcing file $file"
echo "$0: no execute bit set"
. "$file"
fi
;;
*) echo "$0: ignoring $file" ;;
esac
echo
done
}

# touch log files to initialize them
su rstudio-server -c 'touch /var/lib/rstudio-server/monitor/log/rstudio-server.log'
mkdir -p /var/lib/rstudio-launcher
Expand Down Expand Up @@ -63,10 +87,16 @@ else
fi
fi

# Execute or source *.sh files from /entrypoint.d/
# - note that order should be deterministic thanks to * magic
use_init_files /entrypoint.d/*

# Start Launcher
if [ "$RSP_LAUNCHER" == "true" ]; then
/usr/lib/rstudio-server/bin/rstudio-launcher >> /var/log/rstudio-launcher.log 2>&1 &
/usr/lib/rstudio-server/bin/rstudio-launcher > /var/log/rstudio-launcher.log 2>&1 &
wait-for-it.sh localhost:5559 -t $RSP_LAUNCHER_TIMEOUT
else
touch /var/log/rstudio-launcher.log
fi

tail -n 100 -f \
Expand All @@ -79,4 +109,4 @@ tail -n 100 -f \

# the main container process
# cannot use "exec" or the "trap" will be lost
/usr/lib/rstudio-server/bin/rserver --server-daemonize 0 >> /var/log/rstudio-server.log 2>&1
/usr/lib/rstudio-server/bin/rserver --server-daemonize 0 > /var/log/rstudio-server.log 2>&1

0 comments on commit bfb5423

Please sign in to comment.