Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbench startup #60

Merged
merged 2 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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