Skip to content

Commit

Permalink
Bringing in image directory from deployment repo
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneknapp committed Sep 9, 2024
2 parents 39e96bf + a88047c commit 29c9b70
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Rprofile.site
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use RStudio's CRAN mirror to get binary packages. "latest" just means it has
# all available versions. We can specify version numbers in
# devtools::install_version.
options(
repos = c(
CRAN = "https://packagemanager.rstudio.com/all/__linux__/jammy/latest"
)
)

# RStudio sets the HTTPUserAgent option which causes it to download binaries,
# rather than source, from the Posit Public Package Manager. In order for the
# RStudio terminal, Jupyter terminal, Jupyter R notebook, or anything else to
# do the same, we must manually set HTTPUserAgent. This speeds up package
# installation.
# We fake rstudio version because `RStudio.Version()$version` is only available
# when we are in RStudio.
options(
HTTPUserAgent = sprintf(
"RStudio Server (%s); R (%s)",
"2022.7.1.554",
paste(getRversion(), R.version$platform, R.version$arch, R.version$os)
)
)
18 changes: 18 additions & 0 deletions apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# useful utilities
tar
less
vim

# for nbconvert, knitr, etc.
texlive-xetex
texlive-fonts-recommended
texlive-plain-generic
# provides FandolSong-Regular.otf for issue #2714
texlive-lang-chinese

# for rstudio
lsb-release
libclang-dev

# Used by littler for IRkernel::installspec
libzmq5
48 changes: 48 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: dashboard-image

channels:
- conda-forge
- pytorch

dependencies:
- python==3.11.*
- git==2.39.1
- jupyterhub==4.1.6
- jupyter_app_launcher==0.2.1
- jupyter-cache==1.0.0
- jupyter-resource-usage==1.0.0
- jupyterlab==4.0.11
- jupyterlab-favorites==3.0.0
# Install myst for generating dashboards
- jupyterlab-myst==2.4.2
- jupyterlab_server==2.23.0
- jupyterlab_widgets==3.0.8
- jupyter_server==2.7.0
- nbgitpuller==1.2.1
- notebook==7.0.7
- folium==0.14.0
- ipywidgets==8.0.7
- jupyter-archive==3.4.0
- matplotlib==3.7.1
# Install myst markdown for generating dashboards
- mystmd==1.2.9
- numpy==1.24.2
- pandas==2.0.2
- plotly==5.13.1
- requests==2.28.2
- scikit-image==0.19.3
- seaborn==0.12.2
# Spring 2024 Econ 148 Packages
- geopandas==0.14.2
- geopy==2.4.1
- pycountry==22.3.5
# Install voila and voici for generating voila dashboards
- voila==0.5.7
- voici==0.6.1
# Adding more data tools to make this image comprehensive
- dash==2.17.1
- bokeh==3.4.0
- panel==1.4.5
- datashader==0.16.3
- streamlit=1.38.0
#- jupyter-containds=0.2.2
29 changes: 29 additions & 0 deletions infra-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# WARNING: Original source at scripts/infra-packages/requirements.txt
# PLEASE DO NOT EDIT ELSEWHERE
# After editing scripts/infra-packages/requirements.txt, please run
# scripts/infra-packages/sync.bash.

# This file pins versions of notebook related python packages we want
# across all hubs. This makes sure we don't need to upgrade them
# everwhere one by one.

# FIXME: Freeze this to get exact versions of all dependencies
notebook==7.0.7
jupyterlab==4.0.11
nbgitpuller==1.2.1
jupyter-resource-usage==1.0.1
# Matches version in images/hub/Dockerfile
jupyterhub==4.1.6
appmode==0.8.0
ipywidgets==8.0.7
jupyter-tree-download==1.0.1
git-credential-helpers==0.2
# Measure popularity of different packages in our hubs
# https://discourse.jupyter.org/t/request-for-implementation-instrument-libraries-actively-used-by-users-on-a-jupyterhub/7994?u=yuvipanda
git+https://github.com/shaneknapp/python-popularity-contest.git@add-error-handling
# RISE is useful for presentations - see https://github.com/berkeley-dsep-infra/datahub/issues/2527
RISE==5.7.1
# syncthing for dropbox-like functionality
jupyter-syncthing-proxy==1.0.3
# jupyter archival tool for easy user downloads
jupyter-archive==3.4.0
33 changes: 33 additions & 0 deletions install.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env R

# Function to install R packages with specific versions
class_libs_install_version <- function(class_name, class_libs) {
print(paste("Installing packages for", class_name))
for (i in seq(1, length(class_libs), 2)) {
installed_packages <- rownames(installed.packages())
package_name = class_libs[i]
version = class_libs[i+1]
# Only install packages if they haven't already been installed!
# devtools doesn't do that by default
if (!package_name %in% installed_packages) {
print(paste("Installing", package_name, version))
devtools::install_version(package_name, version, quiet=TRUE)
} else {
# FIXME: This ignores version incompatibilities :'(
print(paste("Not installing", package_name, " as it is already installed"))
}
}
print(paste("Done installing packages for", class_name))
}

# R packages to be installed that aren't from apt
# Combination of informal requests & rocker image suggestions
# Some of these were already in datahub image
cran_packages = c(
"BiocManager", "1.30.21",
"IRkernel", "1.3.2",
"rmarkdown", "2.22",
"shiny", "1.7.4"
)

class_libs_install_version("Base packages", cran_packages)
2 changes: 2 additions & 0 deletions rsession.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Use binary packages!
r-cran-repos=https://packagemanager.rstudio.com/all/__linux__/jammy/latest
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
r-4.3.1-2023-08-01

0 comments on commit 29c9b70

Please sign in to comment.