Skip to content

Commit

Permalink
Merge pull request #88 from brown-ccv/base_packages
Browse files Browse the repository at this point in the history
Base packages in dev/templates were updated and tested in mpa2065.
  • Loading branch information
prasadbandarkar authored Aug 25, 2023
2 parents ebfa972 + fea36c4 commit 0652d98
Show file tree
Hide file tree
Showing 19 changed files with 276 additions and 98 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/basepackages-recurring-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: tag-image-basepackages
on: [workflow_dispatch]

env:
CLASS: basepackages
TARGET: r_julia
SQLITE: false
PYTHON_VERSION: "3.9.17"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Set Up GCloud
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT_ID_JH_DOCKER }}
service_account_key: ${{ secrets.GCP_SA_KEY_JH_DOCKER }}
export_default_credentials: true

- name: Create Julia Environment Files
if: env.TARGET == 'r_julia'
run: |
sudo --preserve-env=CLASS docker-compose up julia_build
- name: Upload Julia Env Files to Google Storage Bucket
if: env.TARGET == 'r_julia'
run: |
gsutil cp -r requirements/classes/basepackages/julia_env gs://jupyterhub-environment-files/recurring-/basepackages/past/${GITHUB_SHA}/julia
gsutil cp -r requirements/classes/basepackages/julia_env gs://jupyterhub-environment-files/recurring-/basepackages/latest/julia
- name: Configure Docker
run: gcloud auth configure-docker

- name: Build and Push JH Image
run: |
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up jh_image
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/basepackages:${GITHUB_REF##*/}
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/basepackages:${GITHUB_SHA}
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/basepackages:latest
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/basepackages:recurring-
docker push gcr.io/jupyterhub-docker-images/basepackages:latest
docker push gcr.io/jupyterhub-docker-images/basepackages:recurring-
docker push gcr.io/jupyterhub-docker-images/basepackages:${GITHUB_REF##*/}
docker push gcr.io/jupyterhub-docker-images/basepackages:${GITHUB_SHA}
- name: Upload Conda Env Files to Google Storage Bucket
run: |
gsutil cp -r requirements/out gs://jupyterhub-environment-files/recurring-/basepackages/past/${GITHUB_SHA}/conda
gsutil cp -r requirements/out gs://jupyterhub-environment-files/recurring-/basepackages/latest/conda
46 changes: 46 additions & 0 deletions .github/workflows/basepackages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build-image-basepackages
on:
push:
paths:
- 'requirements/classes/basepackages/**'
- 'Dockerfile'
- 'docker-compose.yml'
- 'scripts/**'
- '.github/workflows/basepackages.yml'

env:
CLASS: basepackages
TARGET: r_julia
SQLITE: false
PYTHON_VERSION: "3.9.17"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Set Up GCloud
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT_ID_JH_DOCKER }}
service_account_key: ${{ secrets.GCP_SA_KEY_JH_DOCKER }}
export_default_credentials: true

- name: Create Julia Environment Files
if: env.TARGET == 'r_julia'
run: |
sudo --preserve-env=CLASS docker-compose up julia_build
- name: Configure Docker
run: gcloud auth configure-docker
- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- name: Build and Push JH Image
run: |
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up jh_image
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/basepackages:${GITHUB_REF##*/}
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/basepackages:latest
docker push gcr.io/jupyterhub-docker-images/basepackages:latest
docker push gcr.io/jupyterhub-docker-images/basepackages:${GITHUB_REF##*/}
20 changes: 11 additions & 9 deletions .github/workflows/mpa2065-fall-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,31 @@ env:
CLASS: mpa2065
TARGET: r_julia
SQLITE: true
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.9.17"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.3

- name: Set Up GCloud
uses: google-github-actions/[email protected].0
uses: google-github-actions/[email protected].2
with:
project_id: ${{ secrets.GCP_PROJECT_ID_JH_DOCKER }}
service_account_key: ${{ secrets.GCP_SA_KEY_JH_DOCKER }}
export_default_credentials: true

- name: Create Julia Environment Files
if: env.TARGET == 'r_julia'
run: |
sudo --preserve-env=CLASS docker-compose up julia_build
- name: Upload Julia Env Files to Google Storage Bucket
if: env.TARGET == 'r_julia'
run: |
gsutil cp -r requirements/classes/mpa2065/julia_env gs://jupyterhub-environment-files/fall-2022/mpa2065/past/${GITHUB_SHA}/julia
gsutil cp -r requirements/classes/mpa2065/julia_env gs://jupyterhub-environment-files/fall-2022/mpa2065/latest/julia
gsutil cp -r requirements/classes/mpa2065/julia_env gs://jupyterhub-environment-files/fall-2023/mpa2065/past/${GITHUB_SHA}/julia
gsutil cp -r requirements/classes/mpa2065/julia_env gs://jupyterhub-environment-files/fall-2023/mpa2065/latest/julia
- name: Configure Docker
run: gcloud auth configure-docker
Expand All @@ -38,13 +40,13 @@ jobs:
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/mpa2065:${GITHUB_REF##*/}
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/mpa2065:${GITHUB_SHA}
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/mpa2065:latest
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/mpa2065:fall-2022
docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/mpa2065:fall-2023
docker push gcr.io/jupyterhub-docker-images/mpa2065:latest
docker push gcr.io/jupyterhub-docker-images/mpa2065:fall-2022
docker push gcr.io/jupyterhub-docker-images/mpa2065:fall-2023
docker push gcr.io/jupyterhub-docker-images/mpa2065:${GITHUB_REF##*/}
docker push gcr.io/jupyterhub-docker-images/mpa2065:${GITHUB_SHA}
- name: Upload Conda Env Files to Google Storage Bucket
run: |
gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2022/mpa2065/past/${GITHUB_SHA}/conda
gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2022/mpa2065/latest/conda
gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2023/mpa2065/past/${GITHUB_SHA}/conda
gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2023/mpa2065/latest/conda
26 changes: 11 additions & 15 deletions .github/workflows/mpa2065.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,31 @@ env:
CLASS: mpa2065
TARGET: r_julia
SQLITE: true
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.9.17"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Create Julia Environment Files
run: |
sudo --preserve-env=CLASS docker-compose up julia_build
- name: Upload Julia Env Files
uses: actions/upload-artifact@v2
with:
name: julia-environment-files
path: requirements/classes/${{ env.CLASS }}/julia_env
- uses: actions/[email protected]

- name: Set Up GCloud
uses: google-github-actions/[email protected].0
uses: google-github-actions/[email protected].2
with:
project_id: ${{ secrets.GCP_PROJECT_ID_JH_DOCKER }}
service_account_key: ${{ secrets.GCP_SA_KEY_JH_DOCKER }}
export_default_credentials: true

- name: Create Julia Environment Files
if: env.TARGET == 'r_julia'
run: |
sudo --preserve-env=CLASS docker-compose up julia_build
- name: Configure Docker
run: gcloud auth configure-docker
- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
# - uses: satackey/[email protected]
# # Ignore the failure of a step and avoid terminating the job.
# continue-on-error: true
- name: Build and Push JH Image
run: |
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up jh_image
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
ARG ROOT_CONTAINER="jupyter/base-notebook:lab-3.4.5"
ARG ROOT_CONTAINER="jupyter/base-notebook:lab-4.0.4"
FROM ${ROOT_CONTAINER} as base

ARG CLASS
Expand Down Expand Up @@ -68,11 +68,11 @@ RUN mktexlsr

#------------ Install VSCode Server a Root----------------------------

ENV VS_CODE_VERSION=4.5.1
ENV VS_CODE_VERSION=4.16.1
RUN mkdir /opt/code-server
WORKDIR /opt/code-server
RUN wget -qO- https://github.com/coder/code-server/releases/download/v${VS_CODE_VERSION}/code-server-${VS_CODE_VERSION}-linux-amd64.tar.gz | tar zxvf - --strip-components=1
ENV PATH=/opt/code-server:$PATH
ENV PATH=/opt/code-server:/opt/code-server/bin:$PATH

#------------ Install Lab Extensions in base environment as NB_USER----------------------------

Expand Down Expand Up @@ -230,8 +230,8 @@ USER root

ENV JULIA_DEPOT_PATH=/opt/julia
ENV JULIA_PKGDIR=/opt/julia
ENV JULIA_VERSION=1.8.5
ENV JULIA_TAG=v1.8
ENV JULIA_VERSION=1.9.2
ENV JULIA_TAG=v1.9.2

COPY requirements/classes/${CLASS}/julia_env/Project.toml $JULIA_PKGDIR/environments/$JULIA_TAG/
COPY requirements/classes/${CLASS}/julia_env/Manifest.toml $JULIA_PKGDIR/environments/$JULIA_TAG/
Expand All @@ -242,7 +242,7 @@ WORKDIR /tmp
# hadolint ignore=SC2046
RUN mkdir "/opt/julia-${JULIA_VERSION}" && \
wget -q https://julialang-s3.julialang.org/bin/linux/x64/$(echo "${JULIA_VERSION}" | cut -d. -f 1,2)"/julia-${JULIA_VERSION}-linux-x86_64.tar.gz" && \
echo "e71a24816e8fe9d5f4807664cbbb42738f5aa9fe05397d35c81d4c5d649b9d05 *julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
echo "4c2d799f442d7fe718827b19da2bacb72ea041b9ce55f24eee7b1313f57c4383 *julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
tar xzf "julia-${JULIA_VERSION}-linux-x86_64.tar.gz" -C "/opt/julia-${JULIA_VERSION}" --strip-components=1 && \
rm "/tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz"
RUN ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ To add a new class:
- `-c`: class name (string)
- `-s`: class season/semester (fall, summer, spring)
- `-t`: target in docker file (string – `base`, `r_lang` or `r_julia`)
- `-p`: python version (i.e 3.7 if ommited defaults to 3.10)
- `-q`: wheter to install sqlite kernel (ommit the `-q` tag if sqlite is not required)
- `-p`: python version (i.e 3.7 if ommited defaults to 3.9.17)
- `-q`: whether to install sqlite kernel (ommit the `-q` tag if sqlite is not required)
- `-y`: class year

```bash
# e.g
Expand Down
18 changes: 10 additions & 8 deletions dev/add_class.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
set -e

#default version of Python to use
PYTHON_VERSION=3.10
PYTHON_VERSION=3.9.17

usage () { echo "Usage:"
echo " -h help"
echo " -c Class name"
echo " -h - help"
echo " -c - Class name"
echo " -s - Season (fall, spring, recurring)"
echo " -t – Target stage in docker file (base, r_lang, or r_julia)"
echo " -p – Python version (optional, if not given uses default)"
echo " -q – Whether to install SQLITE Kernel"; }
echo " -t - Target stage in docker file (base, r_lang, or r_julia)"
echo " -p - Python version (optional, if not given uses default)"
echo " -q - Whether to install SQLITE Kernel"
echo " -y - Class year"; }

while getopts c:s:t:p:qh option; do
while getopts c:s:t:p:y:qh option; do
case "${option}" in
c) CLASS=${OPTARG};;
s) SEASON=${OPTARG};;
t) TARGET=${OPTARG};;
p) PYTHON_VERSION=${OPTARG};;
y) YEAR=${OPTARG};;
q) ADD_SQLITE=true;;
h) usage; exit;;
esac
Expand All @@ -31,7 +33,7 @@ if ((OPTIND < 6))
then
echo "Incomplete options specified. Make sure to pass at least the class name (-c) and target stage (-t)."
else
export YEAR=$(date +'%Y')
export YEAR=$YEAR
export CLASS=$CLASS
export TARGET=$TARGET
export SEASON=$SEASON
Expand Down
8 changes: 4 additions & 4 deletions dev/sandbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

LABEL maintainer "Paul Stey <[email protected]>"
LABEL image jh_sandbox
Expand All @@ -21,9 +21,9 @@ RUN usermod -aG sudo ccv
USER ccv

RUN cd /home/ccv \
&& wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh \
&& bash Anaconda3-2020.02-Linux-x86_64.sh -b \
&& rm Anaconda3-2020.02-Linux-x86_64.sh
&& wget https://repo.anaconda.com/archive/Anaconda3-2023.07-2-Linux-x86_64.sh \
&& bash Anaconda3-2023.07-2-Linux-x86_64.sh -b \
&& rm Anaconda3-2023.07-2-Linux-x86_64.sh

ENV PATH="/home/ccv/anaconda3/bin:${PATH}"

Expand Down
4 changes: 2 additions & 2 deletions dev/templates/class_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.3

- name: Set Up GCloud
uses: google-github-actions/[email protected].0
uses: google-github-actions/[email protected].2
with:
project_id: ${{ secrets.GCP_PROJECT_ID_JH_DOCKER }}
service_account_key: ${{ secrets.GCP_SA_KEY_JH_DOCKER }}
Expand Down
5 changes: 3 additions & 2 deletions dev/templates/class_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'docker-compose.yml'
- 'scripts/**'
- '.github/workflows/${CLASS}.yml'
workflow_dispatch:

env:
CLASS: ${CLASS}
Expand All @@ -18,10 +19,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.3

- name: Set Up GCloud
uses: google-github-actions/[email protected].0
uses: google-github-actions/[email protected].2
with:
project_id: ${{ secrets.GCP_PROJECT_ID_JH_DOCKER }}
service_account_key: ${{ secrets.GCP_SA_KEY_JH_DOCKER }}
Expand Down
34 changes: 17 additions & 17 deletions dev/templates/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ bottleneck
pytables

# these are the base r packages in the r-notebook image ( YOU PROBABLY WANT THESE IF YOUR TARGET IN DOCKER IS r_lang OR r_julia )
r-base=4.0.0
r-base=4.2.*
r-caret=6.*
r-crayon=1.3*
r-devtools=2.3*
r-forecast=8.12*
r-hexbin=1.28*
r-htmltools=0.4*
r-htmlwidgets=1.5*
r-irkernel=1.1*
r-nycflights13=1.0*
r-randomforest=4.6*
r-crayon=1.*
r-devtools=2.*
r-forecast=8.*
r-hexbin=1.*
r-htmltools=0.*
r-htmlwidgets=1.*
r-irkernel=1.*
r-nycflights13=1.*
r-randomforest=4.*
r-rcurl=1.98*
r-rmarkdown=2.2*
r-rodbc=1.3*
r-rsqlite=2.2*
r-shiny=1.4*
r-tidyverse=1.3*
unixodbc=2.3.*
r-tidymodels=0.1*
r-rmarkdown=2.*
r-rodbc=1.*
r-rsqlite=2.*
r-shiny=1.*
r-tidyverse
unixodbc=2.*
r-tidymodels=1.*

# required for environment and plugins ( DO NOT REMOVE THESE!!! )
ipython
Expand Down
Loading

0 comments on commit 0652d98

Please sign in to comment.