-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add components: supervisord & lego (#20)
* add lego install * add supervisord * update vscoder script * migrate Rstudio to devbox
- Loading branch information
Showing
11 changed files
with
137 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
source /opt/utils/script-utils.sh | ||
|
||
|
||
setup_R_rstudio() { | ||
# https://posit.co/download/rstudio-server/ | ||
RSTUDIO_VERSION=$(curl -sL https://download2.rstudio.org/current.ver | cut -d'.' -f'1-3' | sed 's/+/-/g' ) \ | ||
&& RSTUDIO_URL="https://download2.rstudio.org/server/jammy/amd64/rstudio-server-${RSTUDIO_VERSION}-amd64.deb" \ | ||
&& curl -sL -o /tmp/rstudio.deb ${RSTUDIO_URL} \ | ||
&& dpkg -x /tmp/rstudio.deb /tmp && mv /tmp/usr/lib/rstudio-server/ /opt/ \ | ||
&& ln -sf /opt/rstudio-server /usr/lib/ \ | ||
&& ln -sf /opt/rstudio-server/bin/rs* /usr/bin/ | ||
|
||
# Allow RStudio server run as root user | ||
# Configuration to make RStudio server disable authentication and do not run as daemon | ||
mkdir -pv /etc/rstudio \ | ||
&& echo "server-daemonize=0" >> /etc/rstudio/rserver.conf \ | ||
&& echo "server-user=root" >> /etc/rstudio/rserver.conf \ | ||
&& echo "auth-none=1" >> /etc/rstudio/rserver.conf \ | ||
&& echo "auth-minimum-user-id=0" >> /etc/rstudio/rserver.conf \ | ||
&& echo "auth-validate-users=0" >> /etc/rstudio/rserver.conf \ | ||
&& echo "www-allow-origin=*" >> /etc/rstudio/rserver.conf \ | ||
&& echo "www-same-site=none" >> /etc/rstudio/rserver.conf \ | ||
&& echo "www-frame-origin=same" >> /etc/rstudio/rserver.conf \ | ||
&& echo "www-verify-user-agent=0">> /etc/rstudio/rserver.conf \ | ||
&& echo "database-config-file=/etc/rstudio/db.conf" >> /etc/rstudio/rserver.conf \ | ||
&& echo "provider=sqlite" >> /etc/rstudio/db.conf \ | ||
&& echo "directory=/etc/rstudio/" >> /etc/rstudio/db.conf ; | ||
|
||
type rstudio-server && echo "@ Version of rstudio-server: $(rstudio-server version)" || return -1 ; | ||
} | ||
|
||
|
||
setup_R_rshiny() { | ||
# https://posit.co/download/shiny-server/ | ||
RSHINY_VERSION=$(curl -sL https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-18.04/x86_64/VERSION) \ | ||
&& RSHINY_URL="https://download3.rstudio.org/ubuntu-18.04/x86_64/shiny-server-${RSHINY_VERSION}-amd64.deb" \ | ||
&& curl -sL -o /tmp/rshiny.deb ${RSHINY_URL} \ | ||
&& dpkg -i /tmp/rshiny.deb \ | ||
&& sed -i "s/run_as shiny;/run_as root;/g" /etc/shiny-server/shiny-server.conf \ | ||
&& sed -i "s/3838/8888/g" /etc/shiny-server/shiny-server.conf \ | ||
&& printf "USER=root shiny-server" > /usr/local/bin/start-shiny-server.sh \ | ||
&& chmod u+x /usr/local/bin/start-shiny-server.sh | ||
|
||
# Remove shiny's pandoc and pandoc-proc to reduce size if they are already installed in the jpy-latex step. | ||
( which pandoc && rm -rf /opt/shiny-server/ext/pandoc/pandoc || true ) \ | ||
&& ( which pandoc-citeproc && rm -rf /opt/shiny-server/ext/pandoc/pandoc-citeproc || true ) \ | ||
&& rm -rf /opt/shiny-server/ext/node/bin/shiny-server \ | ||
&& ln -sf /opt/shiny-server/ext/node/bin/node /opt/shiny-server/ext/node/bin/shiny-server | ||
|
||
# hack shiny-server to allow run in root user: https://github.com/rstudio/shiny-server/pull/391 | ||
sed -i "s/throw new Error/logger.warn/g" /opt/shiny-server/lib/worker/app-worker.js | ||
|
||
type shiny-server && echo "@ Version of shiny-server: $(shiny-server --version)" || return -1 ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
source /opt/utils/script-utils.sh | ||
|
||
|
||
setup_supervisord() { | ||
OS="linux" && ARCH="amd64" \ | ||
&& VER_SUPERVISORD=$(curl -sL https://github.com/QPod/supervisord/releases.atom | grep "releases/tag" | head -1 | grep -Po '(\d[\d|.]+)') \ | ||
&& URL_SUPERVISORD="https://github.com/QPod/supervisord/releases/download/v${VER_SUPERVISORD}/supervisord_${VER_SUPERVISORD}_${OS}_${ARCH}.tar.gz" \ | ||
&& echo "Downloading Supervisord ${VER_SUPERVISORD} from ${URL_SUPERVISORD}" \ | ||
&& curl -o /tmp/TMP.tgz -sL $URL_SUPERVISORD && tar -C /tmp/ -xzf /tmp/TMP.tgz && rm /tmp/TMP.tgz \ | ||
&& mkdir -pv /opt/bin/ && mv /tmp/supervisord /opt/bin/ && ln -sf /opt/bin/supervisord /usr/local/bin/ \ | ||
&& supervisord version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /usr/bin/env bash | ||
[ $BASH ] && [ -f /etc/profile ] && [ -z $ENTER_PROFILE ] && . /etc/profile | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
|
||
|
||
if [[ "$CODER_ARGS $@" != *"--bind-addr="* ]]; then | ||
CODER_ARGS="--bind-addr=0.0.0.0:9999 $CODER_ARGS" | ||
fi | ||
|
||
|
||
exec /opt/code-server/bin/code-server --auth=none --disable-telemetry --disable-update-check ${CODER_ARGS} $@ /root |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /usr/bin/env bash | ||
[ $BASH ] && [ -f /etc/profile ] && [ -z $ENTER_PROFILE ] && . /etc/profile | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
|
||
|
||
if [[ "$RSTUDIO_ARGS $@" != *"--www-port="* ]]; then | ||
RSTUDIO_ARGS="--www-port=8787 $RSTUDIO_ARGS" | ||
fi | ||
|
||
|
||
USER=root /opt/rstudio-server/bin/rserver ${RSTUDIO_ARGS} $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters