Skip to content

Commit 26dc02b

Browse files
authored
Initial commit
0 parents  commit 26dc02b

87 files changed

Lines changed: 2588 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: build-and-push-jupyterlab-image
2+
3+
on:
4+
workflow_dispatch: # This allows you to manually trigger the action from GitHub UI.
5+
6+
jobs:
7+
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Docker Buildx
17+
id: buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Login to dockerhub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
25+
26+
- name: Get lowercase repo name (for dynamic tags)
27+
id: repo_name
28+
run: |
29+
lowercase_name=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')
30+
echo "repo_name=${lowercase_name}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Build and push latest
33+
id: docker_build_jupyterlab
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: containers/jupyterlab
37+
file: containers/jupyterlab/Dockerfile
38+
builder: ${{ steps.buildx.outputs.name }}
39+
push: true
40+
tags: |
41+
esiil/${{ steps.repo_name.outputs.repo_name }}_jupyterlab:latest
42+
43+
- name: Image digest
44+
run: echo ${{ steps.docker_build_jupyterlab.outputs.digest }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync with Template Repository
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
sync_template:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout main repository
12+
uses: actions/checkout@v4
13+
14+
- name: Configure Git for merge
15+
run: |
16+
git config --global user.name "github-actions"
17+
git config --global user.email "actions@users.noreply.github.com"
18+
19+
- name: Fetch template repository
20+
run: git fetch --no-tags --no-recurse-submodules https://github.com/CU-ESIIL/Working_group_OASIS.git +refs/heads/*:refs/remotes/template/*
21+
22+
- name: Merge changes from template repository
23+
run: |
24+
git merge --no-commit --no-ff --allow-unrelated-histories template/main || true
25+
git checkout --ours .
26+
git add .
27+
28+
- name: Commit changes
29+
run: git commit -am "Merge changes from template repository"
30+
31+
- name: Push changes
32+
uses: ad-m/github-push-action@v0.6.0
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/gh-pages.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish docs via GitHub
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build:
9+
name: Deploy docs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.11'
16+
- name: run requirements file
17+
run: pip install -r requirements.txt
18+
- name: Deploy docs
19+
run: mkdocs gh-deploy --force
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# History files
2+
.Rhistory
3+
.Rapp.history
4+
5+
# Session Data files
6+
.RData
7+
.RDataTmp
8+
9+
# User-specific files
10+
.Ruserdata
11+
12+
# Example code in package build process
13+
*-Ex.R
14+
15+
# Output files from R CMD build
16+
/*.tar.gz
17+
18+
# Output files from R CMD check
19+
/*.Rcheck/
20+
21+
# RStudio files
22+
.Rproj.user/
23+
24+
# produced vignettes
25+
vignettes/*.html
26+
vignettes/*.pdf
27+
28+
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
29+
.httr-oauth
30+
31+
# knitr and R markdown default cache directories
32+
*_cache/
33+
/cache/
34+
35+
# Temporary files created by R markdown
36+
*.utf8.md
37+
*.knit.md
38+
39+
# R Environment Variables
40+
.Renviron
41+
42+
43+
44+
# translation temp files
45+
po/*~
46+
47+
# RStudio Connect folder
48+
rsconnect/
49+
50+
# macOS
51+
.DS_Store

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Environmental Data Science Innovation and Inclusion Lab (ESIIL)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[![DOI](https://zenodo.org/badge/727888683.svg)](https://zenodo.org/doi/10.5281/zenodo.11166898)
2+
3+
# [Your Working Group Name]
4+
5+
Welcome to the **[Your Working Group Name]** repository, an integral part of the Environmental Data Science Innovation and Inclusion Lab (ESIIL). This repository is the central hub for our working group, encompassing our project overview, proposals, team member information, codebase, and more.
6+
7+
## Our Project
8+
[Provide a brief overview of your project here. Describe what you aim to achieve, the importance of your project, and its expected impact.]
9+
10+
## Documentation
11+
- Access detailed documentation on our [GitHub Pages site](https://your-gh-pages-url/).
12+
- Find comprehensive guides, tutorials, and additional resources.
13+
14+
## Project Proposal
15+
[Link to the detailed project proposal document or include it directly in the repository. Outline the goals, methodologies, anticipated challenges, and projected timelines.]
16+
17+
## Group Members
18+
- Member 1: Brief description or role within the group.
19+
- Member 2: Brief description or role within the group.
20+
- ...
21+
- [Link to more detailed bios or profiles if available.]
22+
23+
## Repository Structure
24+
- **containers/**: Docker configurations for reproducible development environments.
25+
- **docs/**: Project documentation organized into:
26+
- **orientation/**: Onboarding materials and training resources.
27+
- **meeting-notes/**: Notes from group meetings.
28+
- **code/**: Documentation for data processing, analysis, and visualization.
29+
- **manuscript/**: Drafts and manuscript content.
30+
- **references/**: Citations and reading notes.
31+
32+
## Meeting Notes and Agendas
33+
- Regular updates to keep all group members informed and engaged with the project's progress and direction.
34+
35+
## Contributing to This Repository
36+
- Contributions from all group members are welcome.
37+
- Please adhere to these guidelines:
38+
- Ensure commits have clear and concise messages.
39+
- Document major changes in the meeting notes.
40+
- Review and merge changes through pull requests for oversight.
41+
42+
## Getting Help
43+
- If you encounter any issues or have questions, please refer to the [ESIIL Support Page](https://esiil-support-page-url/) or contact the repository maintainers directly.
44+
45+
## Customize Your Repository
46+
- **Edit This Readme**: Update with information specific to your project.
47+
- **Update Group Member Bios**: Add detailed information about each group member's expertise and role.
48+
- **Organize Your Code**: Use logical structure and clear naming conventions.
49+
- **Document Your Data**: Include a data directory with README files for datasets.
50+
- **Outline Your Methods**: Create a METHODS.md file for methodologies and tools.
51+
- **Set Up Project Management**: Use 'Issues' and 'Projects' for task tracking.
52+
- **Add a License**: Include an appropriate open-source license.
53+
- **Create Contribution Guidelines**: Establish a CONTRIBUTING.md file.
54+
- **Review and Merge Workflow**: Document your process for reviewing and merging changes.
55+
- **Establish Communication Channels**: Set up channels like Slack or Discord for discussions.
56+
57+
Remember, the goal is to make your repository clear, accessible, and useful for all current and future members of your working group. Happy researching!

containers/jupyterlab/Dockerfile

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
FROM jupyter/r-notebook:hub-4.0.1
2+
3+
USER root
4+
5+
# Set up package manager
6+
RUN apt-get install -y apt-transport-https && \
7+
apt-get clean && apt-get update && apt-get install -y software-properties-common && \
8+
add-apt-repository multiverse && \
9+
apt-get clean && rm -rf /var/lib/apt/lists/*
10+
11+
# Install some base software
12+
RUN apt-get update --yes && \
13+
apt-get install --yes \
14+
fonts-dejavu \
15+
unixodbc \
16+
unixodbc-dev \
17+
r-base \
18+
r-cran-rodbc && \
19+
apt-get clean && rm -rf /var/lib/apt/lists/*
20+
21+
# Add sudo to jovyan user
22+
RUN apt update && \
23+
apt install -y sudo && \
24+
apt clean && \
25+
rm -rf /var/lib/apt/lists/*
26+
27+
# This is where we can control which root permissions the jovyan user will have
28+
ARG PRIV_CMDS='/bin/ch*,/bin/cat,/bin/gunzip,/bin/tar,/bin/mkdir,/bin/ps,/bin/mv,/bin/cp,/usr/bin/apt*,/usr/bin/pip*,/bin/yum,/opt,/opt/conda/bin/*,/usr/bin/*'
29+
30+
RUN usermod -aG sudo jovyan && \
31+
echo "$LOCAL_USER ALL=NOPASSWD: $PRIV_CMDS" >> /etc/sudoers
32+
RUN addgroup jovyan
33+
RUN usermod -aG jovyan jovyan
34+
35+
# Install RStudio
36+
RUN apt-get update && apt-get install --yes gdebi-core && \
37+
wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2023.09.1-494-amd64.deb && \
38+
gdebi -n rstudio-server-2023.09.1-494-amd64.deb && \
39+
rm rstudio-server-2023.09.1-494-amd64.deb && \
40+
apt-get clean && rm -rf /var/lib/apt/lists/*
41+
42+
# Install Geospatial libraries
43+
RUN apt-get update && \
44+
apt install -y \
45+
gdal-bin \
46+
lbzip2 \
47+
libfftw3-dev \
48+
libgdal-dev \
49+
libgeos-dev \
50+
libgsl0-dev \
51+
libgl1-mesa-dev \
52+
libglu1-mesa-dev \
53+
libhdf4-alt-dev \
54+
libhdf5-dev \
55+
libjq-dev \
56+
libpq-dev \
57+
libproj-dev \
58+
libprotobuf-dev \
59+
libnetcdf-dev \
60+
libsqlite3-dev \
61+
libudunits2-dev \
62+
lsb-release \
63+
netcdf-bin \
64+
postgis \
65+
protobuf-compiler \
66+
sqlite3 \
67+
tk-dev \
68+
libfmt-dev \
69+
unixodbc-dev && \
70+
apt-get clean && rm -rf /var/lib/apt/lists/*
71+
72+
# Fix RStudio / Conda openssl version mismatch
73+
RUN wget https://www.openssl.org/source/openssl-3.2.0.tar.gz && \
74+
tar xfz openssl-3.2.0.tar.gz && \
75+
mkdir openssl-build && cd openssl-build && \
76+
../openssl-3.2.0/Configure --libdir=/lib/x86_64-linux-gnu/ && \
77+
make && \
78+
make install
79+
80+
# Update permissions for /opt/conda
81+
RUN mkdir /usr/local/bin/start-notebook.d && \
82+
chown -R jovyan:users /opt/conda/share /usr/local/share /usr/local/bin/start-notebook.d
83+
84+
USER jovyan
85+
86+
# Install jupyterlab and rstudio dependencies
87+
RUN conda install -c conda-forge \
88+
jupyter_client \
89+
jupyter_core \
90+
jupyterlab_server \
91+
jupyter_server \
92+
r-rgl \
93+
r-htmlwidgets \
94+
r-htmltools && \
95+
jupyter lab clean
96+
97+
# reinstall R packages. Here is where you add any new R packages you would like to install
98+
RUN mamba install --quiet --yes \
99+
r-base \
100+
r-tidyverse \
101+
r-terra \
102+
r-future \
103+
r-future.apply \
104+
r-furrr \
105+
&& \
106+
mamba clean --all -f -y
107+
108+
# Install Jupyter Lab Proxy extensions (cards in Launcher)
109+
RUN pip install jupyter-rsession-proxy jupyter-server-proxy jupyter-shiny-proxy jupyterlab-git
110+
111+
# Install Mamba Gator package manager
112+
RUN rm -f ~/.jupyter/lab/workspaces/default* && \
113+
mamba install -y -c conda-forge mamba_gator
114+
115+
# Install and configure jupyter lab
116+
COPY jupyter_notebook_config.json /opt/conda/etc/jupyter/jupyter_notebook_config.json
117+
118+
# Rebuild the Jupyter Lab with new tools
119+
RUN jupyter lab build
120+
121+
# Build Conda environment. Any packages you would like to install with conda need to be added to the environment.yml file in this Dockerfiles directory
122+
RUN conda update -y conda && \
123+
conda config --remove channels conda-forge && \
124+
conda config --add channels conda-forge
125+
WORKDIR /home/jovyan
126+
COPY environment.yml /home/jovyan/
127+
RUN mamba env create -f /home/jovyan/environment.yml
128+
RUN . /opt/conda/etc/profile.d/conda.sh && conda deactivate && conda activate custom && python -m ipykernel install --name custom && pip install jupyter_contrib_nbextensions
129+
130+
# Install R packages from CRAN and GitHub
131+
RUN R -e "remotes::install_github('tomroh/ecoregions')"
132+
RUN R -e "install.packages('mblm', repos='http://cran.rstudio.com/')"
133+
134+
# Set any required environment variables
135+
ENV PROJ_LIB=/opt/conda/envs/custom/share/proj
136+
RUN echo "PROJ_LIB=/opt/conda/envs/custom/share/proj" > /home/jovyan/.Renviron

0 commit comments

Comments
 (0)