Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Nov 27, 2023
2 parents c2c006d + 94a743d commit f5ca2f3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/install.R
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /usr/local/bin/Rscript
# install R dependencies

# We could use renv.lock approach here instead, but will force re-creation of environment from scratch
# Does not provide a good way to ensure that sf/terra/gdalcubes are installed from source while other packages can be binary

install.packages(c("rstac", "spData"))
remotes::install_github("boettiger-lab/earthdatalogin")
install.packages(c("rstac", "spData", "earthdatalogin", "quarto"))
remotes::install_github('r-tmap/tmap')

#install.packages(c("IRkernel", "languageserver", "httpgd"))
#IRkernel::installspec()
install.packages(c("IRkernel", "languageserver", "httpgd"))
IRkernel::installspec()
8 changes: 1 addition & 7 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@

sudo cp /etc/rstudio/disable_auth_rserver.conf /etc/rstudio/rserver.conf
sudo sudo bash -c 'echo "USER=rstudio" >>/etc/environment'
sudo /init &

## set startup dir
mkdir -p ~/.local/share/rstudio/projects_settings
export RPROJ"=$(ls ${CODESPACE_VSCODE_FOLDER}/*.Rproj)"
echo ${RPROJ} > ~/.local/share/rstudio/projects_settings/last-project-path

sudo /init &> /dev/null &

5 changes: 5 additions & 0 deletions .devcontainer/welcome.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
mkdir -p ~/.local/share/rstudio/projects_settings
export RPROJ"=$(ls ${CODESPACE_VSCODE_FOLDER}/*.Rproj)"
echo ${RPROJ} > ~/.local/share/rstudio/projects_settings/last-project-path


# Construct the message
message="## [Open in RStudio](https://$CODESPACE_NAME-8787.app.github.dev)
"
Expand Down
7 changes: 7 additions & 0 deletions .gitpod-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sudo useradd rstudio -u 1000 -s /bin/bash
mkdir -p ~/.local/share/rstudio/projects_settings
sudo mkdir -p /home/rstudio/.local/share/rstudio/projects_settings
export RPROJ"=$(ls -d $PWD/*.Rproj)"
sudo echo ${RPROJ} > ~/.local/share/rstudio/projects_settings/last-project-path
sudo cp ~/.local/share/rstudio/projects_settings/last-project-path /home/rstudio/.local/share/rstudio/projects_settings/last-project-path
sudo chown -R rstudio:rstudio /home/rstudio/.local/share/rstudio
8 changes: 8 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
image: ghcr.io/boettiger-lab/nasa-tops:latest
tasks:
- name: rstudio-init
init: bash .devcontainer/setup.sh
- name: setup
init: bash .gitpod-setup.sh
- name: rstudio-server
init: sudo rstudio-server start

0 comments on commit f5ca2f3

Please sign in to comment.