From 518183c70cb51169ee50523ce7da4b11f9b3f72c Mon Sep 17 00:00:00 2001 From: Anna Murphy Date: Mon, 5 Aug 2024 14:43:21 -0400 Subject: [PATCH 1/4] Add class NEUR1630. Requirements copied from 2023 class as per the ticket information --- .github/workflows/neur1630-fall-tag.yml | 56 +++++++++++++++ .github/workflows/neur1630.yml | 54 ++++++++++++++ requirements/classes/neur1630/condarc | 15 ++++ requirements/classes/neur1630/packages.R | 12 ++++ requirements/classes/neur1630/requirements.jl | 5 ++ .../classes/neur1630/requirements.pip.txt | 2 + .../classes/neur1630/requirements.txt | 70 +++++++++++++++++++ 7 files changed, 214 insertions(+) create mode 100644 .github/workflows/neur1630-fall-tag.yml create mode 100644 .github/workflows/neur1630.yml create mode 100644 requirements/classes/neur1630/condarc create mode 100644 requirements/classes/neur1630/packages.R create mode 100644 requirements/classes/neur1630/requirements.jl create mode 100644 requirements/classes/neur1630/requirements.pip.txt create mode 100644 requirements/classes/neur1630/requirements.txt diff --git a/.github/workflows/neur1630-fall-tag.yml b/.github/workflows/neur1630-fall-tag.yml new file mode 100644 index 00000000..636031c4 --- /dev/null +++ b/.github/workflows/neur1630-fall-tag.yml @@ -0,0 +1,56 @@ +name: tag-image-neur1630 +on: [workflow_dispatch] + +env: + CLASS: neur1630 + TARGET: base + SQLITE: false + PYTHON_VERSION: "3.9.17" + PROJECT_ID: jupyterhub-docker-images + REGION: us-east1 + GAR_LOCATION: us-east1-docker.pkg.dev/jupyterhub-docker-images/all-classes/neur1630 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.5.3 + + - name: Set Up GCloud + uses: google-github-actions/setup-gcloud@v0.6.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/neur1630/julia_env gs://jupyterhub-environment-files/fall-2024/neur1630/past/${GITHUB_SHA}/julia + gsutil cp -r requirements/classes/neur1630/julia_env gs://jupyterhub-environment-files/fall-2024/neur1630/latest/julia + + - name: Configure Docker + run: gcloud auth configure-docker + - name: Build JH Image + run: | + COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up jh_image + docker tag ${{ env.CLASS }}:latest ${{ env.GAR_LOCATION }}:latest + docker tag ${{ env.CLASS }}:latest ${{ env.GAR_LOCATION }}:${GITHUB_REF##*/} + docker tag ${{ env.CLASS }}:latest ${{ env.GAR_LOCATION }}:${GITHUB_SHA} + docker tag ${{ env.CLASS }}:latest ${{ env.GAR_LOCATION }}:fall-2024 + - name: Push JH Image + run: | + docker push ${{ env.GAR_LOCATION }}:latest + docker push ${{ env.GAR_LOCATION }}:${GITHUB_REF##*/} + docker push ${{ env.GAR_LOCATION }}:${GITHUB_SHA} + docker push ${{ env.GAR_LOCATION }}:fall-2024 + + - name: Upload Conda Env Files to Google Storage Bucket + run: | + gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2024/neur1630/past/${GITHUB_SHA}/conda + gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2024/neur1630/latest/conda \ No newline at end of file diff --git a/.github/workflows/neur1630.yml b/.github/workflows/neur1630.yml new file mode 100644 index 00000000..84c90615 --- /dev/null +++ b/.github/workflows/neur1630.yml @@ -0,0 +1,54 @@ +name: build-image-neur1630 +on: + push: + paths: + - 'requirements/classes/neur1630/**' + - 'Dockerfile' + - 'docker-compose.yml' + - 'scripts/**' + - '.github/workflows/neur1630.yml' + workflow_dispatch: + +env: + CLASS: neur1630 + TARGET: base + SQLITE: false + PYTHON_VERSION: "3.9.17" + PROJECT_ID: jupyterhub-docker-images + REGION: us-east1 + GAR_LOCATION: us-east1-docker.pkg.dev/jupyterhub-docker-images/all-classes/neur1630 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.5.3 + + - name: Set Up GCloud + uses: google-github-actions/setup-gcloud@v0.6.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 + + - name: Build JH Image + run: | + COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up jh_image + + - name: Tag JH Image + run: | + docker tag ${{ env.CLASS }}:latest ${{ env.GAR_LOCATION }}:${GITHUB_REF##*/} + docker tag ${{ env.CLASS }}:latest ${{ env.GAR_LOCATION }}:latest + + - name: Push JH Image + run: | + docker push ${{ env.GAR_LOCATION }}:latest + docker push ${{ env.GAR_LOCATION }}:${GITHUB_REF##*/} \ No newline at end of file diff --git a/requirements/classes/neur1630/condarc b/requirements/classes/neur1630/condarc new file mode 100644 index 00000000..d2a82925 --- /dev/null +++ b/requirements/classes/neur1630/condarc @@ -0,0 +1,15 @@ +# channel locations. These override conda defaults, i.e., conda will +# search *only* the channels listed here, in the order given. +# Use "defaults" to automatically include all default channels. +# Non-url channels will be interpreted as Anaconda.org usernames +# (this can be changed by modifying the channel_alias key; see below). +# The default is just 'defaults'. +channels: + - conda-forge + +# Show channel URLs when displaying what is going to be downloaded +# and in 'conda list'. The default is False. +show_channel_urls: True + +# For more information about this file see: +# https://conda.io/docs/user-guide/configuration/use-condarc.html \ No newline at end of file diff --git a/requirements/classes/neur1630/packages.R b/requirements/classes/neur1630/packages.R new file mode 100644 index 00000000..e1dced38 --- /dev/null +++ b/requirements/classes/neur1630/packages.R @@ -0,0 +1,12 @@ +# Use this script to install packages via CRAN, for example: + +# NOTE: Code below shows how you install R packages from CRAN and Bioconductor. For CRAN packages, you can use +# the standard install.packages() function; for Bioconductor packages, however, you +# must first install BiocManager and then use that for installs. + +# install.packages("BiocManager", dependencies=TRUE, repos='http://cran.rstudio.com/') +# install.packages(c("ggplot2", "pheatmap", "RColorBrewer", "PoiClaClu", +# "patchwork", "tidyr", "GGally"), dependencies=TRUE, +# repos='http://cran.rstudio.com/') +# BiocManager::install(c("airway", "DESeq2", "vsn", "biomaRt", +# "AnnotationHub", "SummarizedExperiment")) diff --git a/requirements/classes/neur1630/requirements.jl b/requirements/classes/neur1630/requirements.jl new file mode 100644 index 00000000..87635a43 --- /dev/null +++ b/requirements/classes/neur1630/requirements.jl @@ -0,0 +1,5 @@ +const julia_packages = [ + "IJulia", # DO NOT REMOVE + # add class specific classes here: + + ] \ No newline at end of file diff --git a/requirements/classes/neur1630/requirements.pip.txt b/requirements/classes/neur1630/requirements.pip.txt new file mode 100644 index 00000000..43719b70 --- /dev/null +++ b/requirements/classes/neur1630/requirements.pip.txt @@ -0,0 +1,2 @@ +# add class-specific classes here: + diff --git a/requirements/classes/neur1630/requirements.txt b/requirements/classes/neur1630/requirements.txt new file mode 100644 index 00000000..7901ac0e --- /dev/null +++ b/requirements/classes/neur1630/requirements.txt @@ -0,0 +1,70 @@ +# add class-specific packages here: + +# these are the scipy base packages ( YOU PROBABLY DON'T WANT TO REMOVE THESE ) +dask +pandas +numexpr +matplotlib +scipy +seaborn +scikit-learn +scikit-image +sympy +cython +patsy +statsmodels +cloudpickle +dill +numba +bokeh +sqlalchemy +hdf5 +vincent +beautifulsoup4 +protobuf +xlrd +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 ) +# https://stat.ethz.ch/R-manual/R-devel/library/base/html/00Index.html +r-base=4.2.* +# https://github.com/topepo/caret/releases/tag/v6.0-93 +r-caret=6.* +# https://cran.r-project.org/web/packages/crayon/index.html +r-crayon=1.* +# https://cran.r-project.org/web/packages/devtools/index.html +r-devtools=2.* +# https://cran.r-project.org/web/packages/forecast/index.html +r-forecast=8.* +# https://cran.r-project.org/web/packages/hexbin/index.html +r-hexbin=1.* +# https://cran.r-project.org/web/packages/htmltools/index.html +r-htmltools=0.* +# https://cran.r-project.org/web/packages/htmlwidgets/index.html +r-htmlwidgets=1.* +# https://github.com/IRkernel/IRkernel/releases/tag/1.3.2 +r-irkernel=1.* +# https://cran.r-project.org/web/packages/nycflights13/index.html +r-nycflights13=1.* +# https://cran.r-project.org/web/packages/randomForest/index.html +r-randomforest=4.* +# https://cran.r-project.org/web/packages/RCurl/index.html +r-rcurl=1.98* +# https://cran.r-project.org/web/packages/rmarkdown/index.html +r-rmarkdown=2.* +# https://cran.r-project.org/web/packages/odbc/index.html +r-rodbc=1.* +# https://cran.r-project.org/web/packages/RSQLite/index.html +r-rsqlite=2.* +# https://cran.r-project.org/web/packages/shiny/index.html +r-shiny=1.* +# https://cran.r-project.org/web/packages/tidyverse/index.html +r-tidyverse +unixodbc=2.* +# https://cran.r-project.org/web/packages/tidymodels/index.html +r-tidymodels=1.* + +# required for environment and plugins ( DO NOT REMOVE THESE!!! ) +ipython +ipykernel From 3b81de78141f2e5638e5351f2e335a528d340f3a Mon Sep 17 00:00:00 2001 From: Anna Murphy Date: Mon, 5 Aug 2024 14:43:38 -0400 Subject: [PATCH 2/4] Add requirements --- .../classes/neur1630/requirements.pip.txt | 8 ++++++++ requirements/classes/neur1630/requirements.txt | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/requirements/classes/neur1630/requirements.pip.txt b/requirements/classes/neur1630/requirements.pip.txt index 43719b70..3d4fcb08 100644 --- a/requirements/classes/neur1630/requirements.pip.txt +++ b/requirements/classes/neur1630/requirements.pip.txt @@ -1,2 +1,10 @@ # add class-specific classes here: +scanpy +harmonypy +rpy2 +nwbwidgets +pynapple +pybiomart +pyranges +gseapy diff --git a/requirements/classes/neur1630/requirements.txt b/requirements/classes/neur1630/requirements.txt index 7901ac0e..a9e46cc6 100644 --- a/requirements/classes/neur1630/requirements.txt +++ b/requirements/classes/neur1630/requirements.txt @@ -1,5 +1,21 @@ # add class-specific packages here: +ipywidgets +zarr +requests +aiohttp +louvain +anndata +umap-learn +loompy +scrublet +bioconductor-scran +anndata2ri +fastcluster +tqdm +pynwb +dandi + # these are the scipy base packages ( YOU PROBABLY DON'T WANT TO REMOVE THESE ) dask pandas From c018ec9299c6f5ead051ca7c23344680abca9115 Mon Sep 17 00:00:00 2001 From: Anna Murphy Date: Mon, 12 Aug 2024 09:58:51 -0400 Subject: [PATCH 3/4] add bioconda to condarc --- requirements/classes/neur1630/condarc | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/classes/neur1630/condarc b/requirements/classes/neur1630/condarc index d2a82925..30ac9f6c 100644 --- a/requirements/classes/neur1630/condarc +++ b/requirements/classes/neur1630/condarc @@ -6,6 +6,7 @@ # The default is just 'defaults'. channels: - conda-forge + - bioconda # Show channel URLs when displaying what is going to be downloaded # and in 'conda list'. The default is False. From 2eb3587b89be97e5b306499bd2a5833d695ee1cb Mon Sep 17 00:00:00 2001 From: Anna Murphy Date: Mon, 12 Aug 2024 11:35:07 -0400 Subject: [PATCH 4/4] fix gcloud auth --- .github/workflows/neur1630-fall-tag.yml | 2 +- .github/workflows/neur1630.yml | 2 +- dev/templates/class_tag.yml | 2 +- dev/templates/class_workflow.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/neur1630-fall-tag.yml b/.github/workflows/neur1630-fall-tag.yml index 636031c4..63e548b6 100644 --- a/.github/workflows/neur1630-fall-tag.yml +++ b/.github/workflows/neur1630-fall-tag.yml @@ -35,7 +35,7 @@ jobs: gsutil cp -r requirements/classes/neur1630/julia_env gs://jupyterhub-environment-files/fall-2024/neur1630/latest/julia - name: Configure Docker - run: gcloud auth configure-docker + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet - name: Build JH Image run: | COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up jh_image diff --git a/.github/workflows/neur1630.yml b/.github/workflows/neur1630.yml index 84c90615..a1458b2b 100644 --- a/.github/workflows/neur1630.yml +++ b/.github/workflows/neur1630.yml @@ -37,7 +37,7 @@ jobs: sudo --preserve-env=CLASS docker compose up julia_build - name: Configure Docker - run: gcloud auth configure-docker + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet - name: Build JH Image run: | diff --git a/dev/templates/class_tag.yml b/dev/templates/class_tag.yml index 22c580da..b4b28b80 100644 --- a/dev/templates/class_tag.yml +++ b/dev/templates/class_tag.yml @@ -35,7 +35,7 @@ jobs: gsutil cp -r requirements/classes/${CLASS}/julia_env gs://jupyterhub-environment-files/${SEASON}-${YEAR}/${CLASS}/latest/julia - name: Configure Docker - run: gcloud auth configure-docker + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet - name: Build JH Image run: | COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up jh_image diff --git a/dev/templates/class_workflow.yml b/dev/templates/class_workflow.yml index 093b6710..139825fd 100644 --- a/dev/templates/class_workflow.yml +++ b/dev/templates/class_workflow.yml @@ -37,7 +37,7 @@ jobs: sudo --preserve-env=CLASS docker compose up julia_build - name: Configure Docker - run: gcloud auth configure-docker + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet - name: Build JH Image run: |