mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-15 22:12:57 +00:00
Add images_hierarchy.py file
This commit is contained in:
@@ -3,63 +3,13 @@
|
|||||||
# Distributed under the terms of the Modified BSD License.
|
# Distributed under the terms of the Modified BSD License.
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
from dataclasses import dataclass, field
|
|
||||||
from typing import Optional, List
|
|
||||||
from taggers import TaggerInterface, \
|
|
||||||
SHATagger, \
|
|
||||||
PythonVersionTagger, \
|
|
||||||
JupyterNotebookVersionTagger, JupyterLabVersionTagger, JupyterHubVersionTagger, \
|
|
||||||
RVersionTagger, TensorflowVersionTagger, JuliaVersionTagger, \
|
|
||||||
SparkVersionTagger, HadoopVersionTagger, JavaVersionTagger
|
|
||||||
from plumbum.cmd import docker
|
from plumbum.cmd import docker
|
||||||
|
from images_hierarchy import ALL_IMAGES
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class ImageDescription:
|
|
||||||
parent_image: Optional[str]
|
|
||||||
taggers: List[TaggerInterface] = field(default_factory=list)
|
|
||||||
|
|
||||||
|
|
||||||
ALL_IMAGES = {
|
|
||||||
"base-notebook": ImageDescription(
|
|
||||||
parent_image=None,
|
|
||||||
taggers=[
|
|
||||||
SHATagger,
|
|
||||||
PythonVersionTagger, JupyterNotebookVersionTagger, JupyterLabVersionTagger, JupyterHubVersionTagger
|
|
||||||
]
|
|
||||||
),
|
|
||||||
"minimal-notebook": ImageDescription(
|
|
||||||
parent_image="base-notebook"
|
|
||||||
),
|
|
||||||
"scipy-notebook": ImageDescription(
|
|
||||||
parent_image="minimal-notebook"
|
|
||||||
),
|
|
||||||
"r-notebook": ImageDescription(
|
|
||||||
parent_image="minimal-notebook",
|
|
||||||
taggers=[RVersionTagger]
|
|
||||||
),
|
|
||||||
"tensorflow-notebook": ImageDescription(
|
|
||||||
parent_image="scipy-notebook",
|
|
||||||
taggers=[TensorflowVersionTagger]
|
|
||||||
),
|
|
||||||
"datascience-notebook": ImageDescription(
|
|
||||||
parent_image="scipy-notebook",
|
|
||||||
taggers=[JuliaVersionTagger]
|
|
||||||
),
|
|
||||||
"pyspark-notebook": ImageDescription(
|
|
||||||
parent_image="scipy-notebook",
|
|
||||||
taggers=[SparkVersionTagger, HadoopVersionTagger, JavaVersionTagger]
|
|
||||||
),
|
|
||||||
"allspark-notebook": ImageDescription(
|
|
||||||
parent_image="pyspark-notebook",
|
|
||||||
taggers=[RVersionTagger]
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def get_all_taggers(short_image_name):
|
def get_all_taggers(short_image_name):
|
||||||
taggers = []
|
taggers = []
|
||||||
while short_image_name is not None:
|
while short_image_name is not None:
|
||||||
|
54
tagging/images_hierarchy.py
Normal file
54
tagging/images_hierarchy.py
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# Copyright (c) Jupyter Development Team.
|
||||||
|
# Distributed under the terms of the Modified BSD License.
|
||||||
|
from dataclasses import dataclass, field
|
||||||
|
from typing import Optional, List
|
||||||
|
from taggers import TaggerInterface, \
|
||||||
|
SHATagger, \
|
||||||
|
PythonVersionTagger, \
|
||||||
|
JupyterNotebookVersionTagger, JupyterLabVersionTagger, JupyterHubVersionTagger, \
|
||||||
|
RVersionTagger, TensorflowVersionTagger, JuliaVersionTagger, \
|
||||||
|
SparkVersionTagger, HadoopVersionTagger, JavaVersionTagger
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class ImageDescription:
|
||||||
|
parent_image: Optional[str]
|
||||||
|
taggers: List[TaggerInterface] = field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
|
ALL_IMAGES = {
|
||||||
|
"base-notebook": ImageDescription(
|
||||||
|
parent_image=None,
|
||||||
|
taggers=[
|
||||||
|
SHATagger,
|
||||||
|
PythonVersionTagger,
|
||||||
|
JupyterNotebookVersionTagger, JupyterLabVersionTagger, JupyterHubVersionTagger
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"minimal-notebook": ImageDescription(
|
||||||
|
parent_image="base-notebook"
|
||||||
|
),
|
||||||
|
"scipy-notebook": ImageDescription(
|
||||||
|
parent_image="minimal-notebook"
|
||||||
|
),
|
||||||
|
"r-notebook": ImageDescription(
|
||||||
|
parent_image="minimal-notebook",
|
||||||
|
taggers=[RVersionTagger]
|
||||||
|
),
|
||||||
|
"tensorflow-notebook": ImageDescription(
|
||||||
|
parent_image="scipy-notebook",
|
||||||
|
taggers=[TensorflowVersionTagger]
|
||||||
|
),
|
||||||
|
"datascience-notebook": ImageDescription(
|
||||||
|
parent_image="scipy-notebook",
|
||||||
|
taggers=[JuliaVersionTagger]
|
||||||
|
),
|
||||||
|
"pyspark-notebook": ImageDescription(
|
||||||
|
parent_image="scipy-notebook",
|
||||||
|
taggers=[SparkVersionTagger, HadoopVersionTagger, JavaVersionTagger]
|
||||||
|
),
|
||||||
|
"allspark-notebook": ImageDescription(
|
||||||
|
parent_image="pyspark-notebook",
|
||||||
|
taggers=[RVersionTagger]
|
||||||
|
)
|
||||||
|
}
|
Reference in New Issue
Block a user