From 8d3557c3cbe745848e7aa49b977468f05376cda3 Mon Sep 17 00:00:00 2001 From: Pan Luo Date: Tue, 26 Nov 2024 15:48:09 -0800 Subject: [PATCH] Update user image base to hub-5.2.0 --- .github/workflows/build.yml | 40 ++++++++++++++++++++++++++++++++++--- Dockerfile | 22 ++++++++++---------- 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e3e76d..70d6d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,14 +14,48 @@ on: jobs: build: name: Build Image - runs-on: self-hosted + #runs-on: self-hosted + runs-on: ubuntu-latest # These permissions are needed to interact with GitHub's OIDC Token endpoint. permissions: id-token: write contents: read - steps: + steps: + - name: Check disk space + run: df . -h + - name: Free disk space + run: | + sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true + sudo rm -rf \ + /usr/share/dotnet /usr/local/lib/android /opt/ghc \ + /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ + /usr/lib/jvm || true + echo "some directories deleted" + sudo apt install aptitude -y >/dev/null 2>&1 + sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ + esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \ + google-cloud-sdk imagemagick \ + libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \ + mercurial apt-transport-https mono-complete libmysqlclient \ + unixodbc-dev yarn chrpath libssl-dev libxft-dev \ + libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \ + snmp pollinate libpq-dev postgresql-client powershell ruby-full \ + sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \ + -y -f >/dev/null 2>&1 + sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 + sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true + sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true + sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1 + sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 + sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 + sudo apt-get autoremove -y >/dev/null 2>&1 + sudo apt-get autoclean -y >/dev/null 2>&1 + echo "some packages purged" + - name: Check disk space + run: df . -h + - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/Dockerfile b/Dockerfile index 075124d..415d7cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # sudo docker kill $(sudo docker ps -q); sudo docker rm $(sudo docker ps -a -q); sudo docker rmi $(sudo docker images -q) # sudo docker build --squash --no-cache -t 032401129069.dkr.ecr.ca-central-1.amazonaws.com/jupyterhub:jupyterlab-open . -ARG BASE_CONTAINER=quay.io/jupyter/datascience-notebook:hub-4.1.5 +ARG BASE_CONTAINER=quay.io/jupyter/datascience-notebook:hub-5.2.0 #ARG BASE_CONTAINER=032401129069.dkr.ecr.ca-central-1.amazonaws.com/jupyterhub:jupyterlab-all FROM $BASE_CONTAINER @@ -26,10 +26,11 @@ RUN apt-get update && \ zsh \ vim \ htop \ - build-essential \ libcurl4-openssl-dev \ libssl-dev \ libxml2-dev \ +# future version of base image will remove nodejs, uncomment below after upgrade +# npm \ gfortran && \ ldconfig && \ apt-get autoclean && \ @@ -41,11 +42,10 @@ USER ${NB_UID} # Install Conda Packages (Plotly, SageMath) RUN mamba create --yes -n sage sage python=3.11 && \ mamba install --yes -c conda-forge -c plotly \ - "sage" \ "plotly" \ "jupyterlab-spellchecker" \ "dash" \ - "xeus-cling" \ +# "xeus-cling" \ "openjdk" \ "maven" \ "ipython-sql" \ @@ -61,20 +61,20 @@ RUN R -e 'require(devtools); \ # Install R packages RUN mamba install --yes -c conda-forge \ 'r-stargazer' \ - 'r-quanteda' \ - 'r-quanteda.textmodels' \ - 'r-quanteda.textplots' \ - 'r-quanteda.textstats' \ +# 'r-quanteda' \ +# 'r-quanteda.textmodels' \ +# 'r-quanteda.textplots' \ +# 'r-quanteda.textstats' \ 'r-caret' \ - 'r-ggiraph' \ +# 'r-ggiraph' \ 'r-ggextra' \ 'r-isocodes' \ 'r-urltools' \ 'r-ggthemes' \ 'r-modelsummary' \ 'r-nsyllable' \ - 'r-proxyc' \ - 'r-tidytext' \ +# 'r-proxyc' \ +# 'r-tidytext' \ 'r-car' && \ mamba clean --all -f -y