-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify ENV management for both python and R (#3)
* Update devcontainer.json * add new env * fix path * fix permission issue * add readme * fix container missing parts * change to post-attach command to make sure it will work after restart * update script * fix minor issue * change to relative path
- Loading branch information
Showing
23 changed files
with
464 additions
and
2,549 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
echo "Restarting Rstudio server..." | ||
sudo rm -rf /var/run/rstudio-server.id | ||
sleep 1 | ||
rstudio-server start > rstudio_server.log 2>&1 & | ||
|
||
echo "Install quarto tinytex extension" | ||
quarto install tinytex | ||
|
||
pip install jupyterlab jupyter_core | ||
sleep 5 | ||
echo "Setup Jupyter-lab" | ||
# Start Jupyter Lab | ||
if ! pgrep -x "jupyter-lab" > /dev/null; then | ||
echo "Jupyter Lab is not started. Restarting..." | ||
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' > jupyter_lab.log 2>&1 & | ||
fi | ||
|
||
echo "Dev environment startup completed!" |
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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Activate the Python virtual environment | ||
source /opt/venv/bin/activate | ||
# Install ZeroMQ | ||
sudo apt-get update -y | ||
sudo apt-get install libzmq3-dev -y | ||
|
||
# Install Python dependencies | ||
if [ -f "python/requirements.txt" ]; then | ||
pip install -r python/requirements.txt | ||
fi | ||
# Install GDAL | ||
sudo apt-get install gdal-bin libgdal-dev -y | ||
|
||
# Install R dependencies | ||
#if [ -f "r/install_packages.R" ]; then | ||
# Rscript r/install_packages.R | ||
#fi | ||
# Install a few common dependencies | ||
sudo apt-get install libharfbuzz-dev libfribidi-dev libfreetype6-dev pkg-config libarchive-dev -y | ||
# Install ffmpeg | ||
sudo apt-get install ffmpeg -y | ||
|
||
# This may be done by the user | ||
# Set up renv for R | ||
#if [ -f "r/renv.lock" ]; then | ||
# cd r && R -e 'renv::restore()' | ||
#fi | ||
# Setup bash to allow conda to run | ||
#conda init bash && conda install -y ipykernel | ||
|
||
echo "Dev environment setup completed!" | ||
# Allow JupyterLab and IRkernel ro run R workbook | ||
R -e "install.packages('IRkernel')" | ||
R -e "IRkernel::installspec()" | ||
|
||
# change the default working directory for RStudio | ||
echo "session-default-working-dir=/workspaces/data_access_library/" | sudo tee -a /etc/rstudio/rsession.conf |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.