From 3f77c6661b46dfa6fa96b5e48b1517905585363d Mon Sep 17 00:00:00 2001 From: Qiwei Date: Thu, 20 Jul 2023 16:39:23 +0200 Subject: [PATCH] remove jupyter python part --- .../app/jupyter/jupyterlab-python/Dockerfile | 63 ---------- .../jupyterlab-python/build.gradle.kts | 39 ------ .../jupyter/jupyterlab-python/context.yaml | 12 -- .../jupyter/jupyterlab-python/dockerInfo.yaml | 4 - .../jupyter/jupyterlab-python/image_test.yaml | 114 ------------------ .../resources/kernel-3.10.json | 12 -- .../resources/kernel-3.8.json | 12 -- .../resources/kernel-3.9.json | 12 -- .../resources/kernel-startup-3.10.sh | 7 -- .../resources/kernel-startup-3.8.sh | 7 -- .../resources/kernel-startup-3.9.sh | 7 -- 11 files changed, 289 deletions(-) delete mode 100644 technologies/app/jupyter/jupyterlab-python/Dockerfile delete mode 100644 technologies/app/jupyter/jupyterlab-python/build.gradle.kts delete mode 100644 technologies/app/jupyter/jupyterlab-python/context.yaml delete mode 100644 technologies/app/jupyter/jupyterlab-python/dockerInfo.yaml delete mode 100644 technologies/app/jupyter/jupyterlab-python/image_test.yaml delete mode 100644 technologies/app/jupyter/jupyterlab-python/resources/kernel-3.10.json delete mode 100644 technologies/app/jupyter/jupyterlab-python/resources/kernel-3.8.json delete mode 100644 technologies/app/jupyter/jupyterlab-python/resources/kernel-3.9.json delete mode 100644 technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.10.sh delete mode 100644 technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.8.sh delete mode 100644 technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.9.sh diff --git a/technologies/app/jupyter/jupyterlab-python/Dockerfile b/technologies/app/jupyter/jupyterlab-python/Dockerfile deleted file mode 100644 index 0251139c2..000000000 --- a/technologies/app/jupyter/jupyterlab-python/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -ARG PYTHON310_IMG -ARG BASE_CONTAINER - -FROM $PYTHON310_IMG AS PYTHON310 -FROM $BASE_CONTAINER - -LABEL Maintainer="Saagie" - -################ Kernels / Conda envs / requirements PART BEGIN ################ -USER $NB_USER - -# Update conda to latest version and install jupyterlab-git plugin -RUN conda update -n root conda \ - && conda install -c conda-forge jupyterlab==3.6.3 jupyterlab-git \ - && conda clean -ay - -RUN conda create -n py38 python=3.8.12 \ - && bash -c "source activate py38 && conda install notebook ipykernel -y && ipython kernel install --user --name py38 --display-name 'Python 3.8'" \ - && conda create -n py39 python=3.9.10 \ - && bash -c "source activate py39 && conda install notebook ipykernel -y && ipython kernel install --user --name py39 --display-name 'Python 3.9'" \ - && conda create -n py310 python=3.10.2 \ - && bash -c "source activate py310 && conda install notebook ipykernel -y && ipython kernel install --user --name py310 --display-name 'Python 3.10'" \ - && conda clean -ay \ - && rm -rf ~/.cache/pip - -# Updating kernels to force activating conda env whenever opening a console -ADD resources/kernel-3.8.json /home/$NB_USER/.local/share/jupyter/kernels/py38/kernel.json -ADD resources/kernel-3.9.json /home/$NB_USER/.local/share/jupyter/kernels/py39/kernel.json -ADD resources/kernel-3.10.json /home/$NB_USER/.local/share/jupyter/kernels/py310/kernel.json -ADD resources/kernel-*.sh / - -# Uninstall default python3 kernel -RUN jupyter kernelspec remove -f python3 -SHELL ["/bin/bash", "-c"] -COPY --from=PYTHON310 /tmp/requirements.txt /home/$NB_USER/requirements.txt - -RUN sh -x \ - && pip install jupyter_ai \ - && for env in py38 py39 py310; \ - do \ - . activate $env \ - && python -m pip install --no-cache-dir -r /home/$NB_USER/requirements.txt \ - && python -m pip uninstall matplotlib -y \ - && grep matplotlib* /home/$NB_USER/requirements.txt | xargs python -m pip install --no-cache \ - && pip install jupyter_ai \ - && conda deactivate; \ - done \ - && conda clean -ay \ - && rm -rf ~/.cache/pip - - -################ Kernels / Conda envs / requirements PART ENDS ################# - -# Should run as $NB_USER ... but ... -# USER $NB_USER -# Saagie mounts the /notebook-dir as root so it needs to be chown in the entrypoint as root -USER root - -# Runs Jupyter in a loop so that quitting Jupyter does not cause the container to exit. -ENV RESTARTABLE yes - - - diff --git a/technologies/app/jupyter/jupyterlab-python/build.gradle.kts b/technologies/app/jupyter/jupyterlab-python/build.gradle.kts deleted file mode 100644 index 792c7488e..000000000 --- a/technologies/app/jupyter/jupyterlab-python/build.gradle.kts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright 2019-2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import com.bmuschko.gradle.docker.DockerRemoteApiPlugin -import com.saagie.technologies.SaagieTechnologiesGradlePlugin -import com.saagie.technologies.readDockerInfo -import com.saagie.technologies.getVersionForDocker - - -apply() -apply() - -val dockerInfo = readDockerInfo(projectDir) - -tasks.withType(com.bmuschko.gradle.docker.tasks.image.DockerBuildImage::class) { - dependsOn(":jupyterlab-base:testImage") - this.buildArgs.put( - "BASE_CONTAINER", - "${dockerInfo?.image}:${dockerInfo?.baseTag}-base-${this.project.getVersionForDocker()}" - ) - this.buildArgs.put( - "PYTHON310_IMG", - "saagie/python:3.10-1.137.0" - ) -} diff --git a/technologies/app/jupyter/jupyterlab-python/context.yaml b/technologies/app/jupyter/jupyterlab-python/context.yaml deleted file mode 100644 index b10b79fd0..000000000 --- a/technologies/app/jupyter/jupyterlab-python/context.yaml +++ /dev/null @@ -1,12 +0,0 @@ -id: jupyterlab-3.6-python-3 -label: JupyterLab 3.6 with python 3.8 / 3.9 / 3.10 -releaseNotes: Enable jupyter_ai as extension. -available: true -trustLevel: stable -recommended: true -ports: - - port: 8888 - name: Notebook - rewriteUrl: false - basePath: SAAGIE_BASE_PATH -volumes: ["/notebooks-dir"] diff --git a/technologies/app/jupyter/jupyterlab-python/dockerInfo.yaml b/technologies/app/jupyter/jupyterlab-python/dockerInfo.yaml deleted file mode 100644 index 35787a4f8..000000000 --- a/technologies/app/jupyter/jupyterlab-python/dockerInfo.yaml +++ /dev/null @@ -1,4 +0,0 @@ -image: saagie/jupyterlab-python-nbk -baseTag: 3.6.3-python3 -dynamicVersion: -version: 3.6.3-python3 \ No newline at end of file diff --git a/technologies/app/jupyter/jupyterlab-python/image_test.yaml b/technologies/app/jupyter/jupyterlab-python/image_test.yaml deleted file mode 100644 index 67bf88f2c..000000000 --- a/technologies/app/jupyter/jupyterlab-python/image_test.yaml +++ /dev/null @@ -1,114 +0,0 @@ -schemaVersion: "2.0.0" - -metadataTest: - env: - - key: LANG - value: "en_US.UTF-8" - - key: LC_ALL - value: "en_US.UTF-8" - -fileExistenceTests: - - name: "entrypoint" - path: "/entrypoint.sh" - shouldExist: true - permissions: "-rwxr-xr-x" - -fileContentTests: - - name: "entrypoint" - path: "/entrypoint.sh" - expectedContents: - [ - "export CLASSPATH=`hadoop classpath --glob`" - ] - -commandTests: - - name: "Workdir" - command: "pwd" - expectedOutput: ["/notebooks-dir"] - - name: "curl" - args: ["--help"] - command: "curl" - exitCode: 0 - - name: "Check conda virtual env for Python 3.8" - command: "bash" - args: ["-c", "conda env list | grep py38"] - expectedOutput: ["/opt/conda/envs/py38"] - exitCode: 0 - - name: "Check conda virtual env for Python 3.9" - command: "bash" - args: ["-c", "conda env list | grep py39"] - expectedOutput: ["/opt/conda/envs/py39"] - exitCode: 0 - - name: "Check conda virtual env for Python 3.10" - command: "bash" - args: [ "-c", "conda env list | grep py310" ] - expectedOutput: [ "/opt/conda/envs/py310" ] - exitCode: 0 - - name: check Python 3.8 libs - command: "bash" - args: ["-c", ". activate py38; python -c 'import numpy; - import pandas; - import matplotlib; - import scipy; - from sklearn import datasets; - import pyodbc; - from impala.dbapi import connect; - import hdfs; - import thrift_sasl; - from sqlalchemy import create_engine; - import ibis; - import pymongo; - import mlflow; - import mysql.connector; - import cython; - import psycopg2; - from fastparquet import ParquetFile; - from requests_kerberos import *; - from pyarrow import *; - '"] - exitCode: 0 - - name: check Python 3.9 libs - command: "bash" - args: ["-c", ". activate py39; python -c 'import numpy; - import pandas; - import matplotlib; - import scipy; - from sklearn import datasets; - import pyodbc; - from impala.dbapi import connect; - import hdfs; - import thrift_sasl; - from sqlalchemy import create_engine; - import ibis; - import pymongo; - import mlflow; - import mysql.connector; - import cython; - import psycopg2; - from fastparquet import ParquetFile; - from requests_kerberos import *; - from pyarrow import *; - '"] - - name: check Python 3.10 libs - command: "bash" - args: ["-c", ". activate py310; python -c 'import numpy; - import pandas; - import matplotlib; - import scipy; - from sklearn import datasets; - import pyodbc; - from impala.dbapi import connect; - import hdfs; - import thrift_sasl; - from sqlalchemy import create_engine; - import ibis; - import pymongo; - import mlflow; - import mysql.connector; - import cython; - import psycopg2; - from fastparquet import ParquetFile; - from requests_kerberos import *; - from pyarrow import *; - '"] - exitCode: 0 diff --git a/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.10.json b/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.10.json deleted file mode 100644 index 2a6e0e851..000000000 --- a/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.10.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "argv": [ - "/kernel-startup-3.10.sh", - "-f", - "{connection_file}" - ], - "display_name": "Python 3.10", - "language": "python", - "metadata": { - "debugger": true - } -} \ No newline at end of file diff --git a/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.8.json b/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.8.json deleted file mode 100644 index 414e9c093..000000000 --- a/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.8.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "argv": [ - "/kernel-startup-3.8.sh", - "-f", - "{connection_file}" - ], - "display_name": "Python 3.8", - "language": "python", - "metadata": { - "debugger": true - } -} \ No newline at end of file diff --git a/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.9.json b/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.9.json deleted file mode 100644 index 651ddac3b..000000000 --- a/technologies/app/jupyter/jupyterlab-python/resources/kernel-3.9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "argv": [ - "/kernel-startup-3.9.sh", - "-f", - "{connection_file}" - ], - "display_name": "Python 3.9", - "language": "python", - "metadata": { - "debugger": true - } -} \ No newline at end of file diff --git a/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.10.sh b/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.10.sh deleted file mode 100644 index 2463d6cb9..000000000 --- a/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.10.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# activate anaconda env -source activate py310 - -# this is the critical part, and should be at the end of your script: -exec /opt/conda/envs/py310/bin/python -m ipykernel_launcher $@ \ No newline at end of file diff --git a/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.8.sh b/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.8.sh deleted file mode 100644 index ed11fe0e1..000000000 --- a/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.8.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# activate anaconda env -source activate py38 - -# this is the critical part, and should be at the end of your script: -exec /opt/conda/envs/py38/bin/python -m ipykernel_launcher $@ \ No newline at end of file diff --git a/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.9.sh b/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.9.sh deleted file mode 100644 index a14f4be24..000000000 --- a/technologies/app/jupyter/jupyterlab-python/resources/kernel-startup-3.9.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# activate anaconda env -source activate py39 - -# this is the critical part, and should be at the end of your script: -exec /opt/conda/envs/py39/bin/python -m ipykernel_launcher $@ \ No newline at end of file