From ffb2ffb1904efb5f03bfe34575087cdc5dd5924b Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Sun, 27 Aug 2023 19:41:52 -0400 Subject: [PATCH 1/8] Added base python packages --- .github/workflows/neur1630-fall-tag.yml | 52 +++++++++++++++++++ .github/workflows/neur1630.yml | 47 +++++++++++++++++ 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 | 52 +++++++++++++++++++ 7 files changed, 185 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..47abf1b0 --- /dev/null +++ b/.github/workflows/neur1630-fall-tag.yml @@ -0,0 +1,52 @@ +name: tag-image-neur1630 +on: [workflow_dispatch] + +env: + CLASS: neur1630 + TARGET: base + SQLITE: false + PYTHON_VERSION: "3.9.17" + +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-2023/neur1630/past/${GITHUB_SHA}/julia + gsutil cp -r requirements/classes/neur1630/julia_env gs://jupyterhub-environment-files/fall-2023/neur1630/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/neur1630:${GITHUB_REF##*/} + docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/neur1630:${GITHUB_SHA} + docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/neur1630:latest + docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/neur1630:fall-2023 + docker push gcr.io/jupyterhub-docker-images/neur1630:latest + docker push gcr.io/jupyterhub-docker-images/neur1630:fall-2023 + docker push gcr.io/jupyterhub-docker-images/neur1630:${GITHUB_REF##*/} + docker push gcr.io/jupyterhub-docker-images/neur1630:${GITHUB_SHA} + + - name: Upload Conda Env Files to Google Storage Bucket + run: | + gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2023/neur1630/past/${GITHUB_SHA}/conda + gsutil cp -r requirements/out gs://jupyterhub-environment-files/fall-2023/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..96fdf3d2 --- /dev/null +++ b/.github/workflows/neur1630.yml @@ -0,0 +1,47 @@ +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" + +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 + - uses: satackey/action-docker-layer-caching@v0.0.11 + # 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/neur1630:${GITHUB_REF##*/} + docker tag jupyterhub-docker-images_jh_image:latest gcr.io/jupyterhub-docker-images/neur1630:latest + docker push gcr.io/jupyterhub-docker-images/neur1630:latest + docker push gcr.io/jupyterhub-docker-images/neur1630:${GITHUB_REF##*/} 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..e0689d67 --- /dev/null +++ b/requirements/classes/neur1630/requirements.txt @@ -0,0 +1,52 @@ +# 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 ) +r-base=4.2.* +r-caret=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.* +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 +ipykernel From eb3a7fef54c0360425d4b002a608ab9949df0502 Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Sun, 24 Sep 2023 22:29:21 -0400 Subject: [PATCH 2/8] Adding Tuan's packages --- requirements/classes/neur1630/condarc | 2 ++ .../classes/neur1630/requirements.pip.txt | 6 +++++- requirements/classes/neur1630/requirements.txt | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/requirements/classes/neur1630/condarc b/requirements/classes/neur1630/condarc index d2a82925..af9e69f3 100644 --- a/requirements/classes/neur1630/condarc +++ b/requirements/classes/neur1630/condarc @@ -5,7 +5,9 @@ # (this can be changed by modifying the channel_alias key; see below). # The default is just 'defaults'. channels: + - bioconda - conda-forge + - defaults # Show channel URLs when displaying what is going to be downloaded # and in 'conda list'. The default is False. diff --git a/requirements/classes/neur1630/requirements.pip.txt b/requirements/classes/neur1630/requirements.pip.txt index 43719b70..2a1ad037 100644 --- a/requirements/classes/neur1630/requirements.pip.txt +++ b/requirements/classes/neur1630/requirements.pip.txt @@ -1,2 +1,6 @@ # add class-specific classes here: - +scanpy +harmonypy +rpy2 +nwbwidgets +pynapple \ No newline at end of file diff --git a/requirements/classes/neur1630/requirements.txt b/requirements/classes/neur1630/requirements.txt index e0689d67..80d94f9e 100644 --- a/requirements/classes/neur1630/requirements.txt +++ b/requirements/classes/neur1630/requirements.txt @@ -1,4 +1,19 @@ # 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 From ac3e93f244e615dbbbfcabe381a09e323bebc18c Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Sun, 24 Sep 2023 22:59:14 -0400 Subject: [PATCH 3/8] removing defaults channel --- requirements/classes/neur1630/condarc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/classes/neur1630/condarc b/requirements/classes/neur1630/condarc index af9e69f3..26d2ae4b 100644 --- a/requirements/classes/neur1630/condarc +++ b/requirements/classes/neur1630/condarc @@ -7,7 +7,7 @@ channels: - bioconda - conda-forge - - defaults +# - defaults # Show channel URLs when displaying what is going to be downloaded # and in 'conda list'. The default is False. From c7a3ef59d2afd8c56d19eb5849f1f61c16167d6d Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Sun, 24 Sep 2023 23:17:42 -0400 Subject: [PATCH 4/8] removing caching --- .github/workflows/neur1630.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/neur1630.yml b/.github/workflows/neur1630.yml index 96fdf3d2..b38764dd 100644 --- a/.github/workflows/neur1630.yml +++ b/.github/workflows/neur1630.yml @@ -35,9 +35,9 @@ jobs: - name: Configure Docker run: gcloud auth configure-docker - - uses: satackey/action-docker-layer-caching@v0.0.11 - # Ignore the failure of a step and avoid terminating the job. - continue-on-error: true +# - uses: satackey/action-docker-layer-caching@v0.0.11 +# # 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 From bdc1b7cb2f0f9911f67dbf8ba570be0d0399cb15 Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Sun, 24 Sep 2023 23:37:16 -0400 Subject: [PATCH 5/8] temporarily changing dockerfile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 94577c20..aafa9686 100644 --- a/Dockerfile +++ b/Dockerfile @@ -144,6 +144,8 @@ RUN jupyter kernelspec remove -f python3 COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS} /home/$NB_USER/tmp/ COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS}/condarc /home/$NB_USER/.mambarc +RUN mamba config --show channels + RUN mamba create --quiet --yes -p ${CONDA_DIR}/envs/${CLASS} python=${PYTHON_VERSION} && \ mamba install -y --name ${CLASS} --file /home/$NB_USER/tmp/requirements.txt && \ mamba clean --all -f -y From 110169ffe1e144c4e682129f04c85316e0623425 Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Mon, 25 Sep 2023 10:09:30 -0400 Subject: [PATCH 6/8] running mamba info -a --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index aafa9686..ad541842 100644 --- a/Dockerfile +++ b/Dockerfile @@ -144,7 +144,7 @@ RUN jupyter kernelspec remove -f python3 COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS} /home/$NB_USER/tmp/ COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS}/condarc /home/$NB_USER/.mambarc -RUN mamba config --show channels +RUN mamba info -a RUN mamba create --quiet --yes -p ${CONDA_DIR}/envs/${CLASS} python=${PYTHON_VERSION} && \ mamba install -y --name ${CLASS} --file /home/$NB_USER/tmp/requirements.txt && \ From 902d28d4fd786430a25ceadd4334f06c37f0431e Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Mon, 25 Sep 2023 10:45:26 -0400 Subject: [PATCH 7/8] creating .condarc --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad541842..679f7767 100644 --- a/Dockerfile +++ b/Dockerfile @@ -143,8 +143,7 @@ RUN jupyter kernelspec remove -f python3 COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS} /home/$NB_USER/tmp/ COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS}/condarc /home/$NB_USER/.mambarc - -RUN mamba info -a +COPY --chown=${NB_UID}:${NB_GID} requirements/classes/${CLASS}/condarc /home/$NB_USER/.condarc RUN mamba create --quiet --yes -p ${CONDA_DIR}/envs/${CLASS} python=${PYTHON_VERSION} && \ mamba install -y --name ${CLASS} --file /home/$NB_USER/tmp/requirements.txt && \ From c71cf27d9b49755781542701c0cce5fdb0f90105 Mon Sep 17 00:00:00 2001 From: Prasad Bandarkar Date: Thu, 12 Oct 2023 17:10:37 -0400 Subject: [PATCH 8/8] Adding additional packages --- requirements/classes/neur1630/requirements.pip.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements/classes/neur1630/requirements.pip.txt b/requirements/classes/neur1630/requirements.pip.txt index 2a1ad037..d100ddc3 100644 --- a/requirements/classes/neur1630/requirements.pip.txt +++ b/requirements/classes/neur1630/requirements.pip.txt @@ -3,4 +3,7 @@ scanpy harmonypy rpy2 nwbwidgets -pynapple \ No newline at end of file +pynapple +pybiomart +pyranges +gseapy \ No newline at end of file