-
Notifications
You must be signed in to change notification settings - Fork 4
/
images_hierarchy.py
93 lines (88 loc) · 2.82 KB
/
images_hierarchy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from dataclasses import dataclass, field
from typing import Optional
from tagging.manifests import (
AptPackagesManifest,
CondaEnvironmentManifest,
JuliaPackagesManifest,
ManifestInterface,
RPackagesManifest,
SparkInfoManifest,
)
from tagging.taggers import (
DateTagger,
JavaVersionTagger,
JuliaVersionTagger,
JupyterHubVersionTagger,
JupyterLabVersionTagger,
JupyterNotebookVersionTagger,
PythonMajorMinorVersionTagger,
PythonVersionTagger,
PytorchVersionTagger,
RVersionTagger,
SHATagger,
SparkVersionTagger,
TaggerInterface,
TensorflowVersionTagger,
UbuntuVersionTagger,
)
@dataclass
class ImageDescription:
parent_image: Optional[str]
taggers: list[TaggerInterface] = field(default_factory=list)
manifests: list[ManifestInterface] = field(default_factory=list)
ALL_IMAGES = {
"docker-stacks-foundation": ImageDescription(
parent_image=None,
taggers=[
SHATagger(),
DateTagger(),
UbuntuVersionTagger(),
PythonMajorMinorVersionTagger(),
PythonVersionTagger(),
],
manifests=[CondaEnvironmentManifest(), AptPackagesManifest()],
),
"base-notebook": ImageDescription(
parent_image="docker-stacks-foundation",
taggers=[
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()],
manifests=[RPackagesManifest()],
),
"julia-notebook": ImageDescription(
parent_image="minimal-notebook",
taggers=[JuliaVersionTagger()],
manifests=[JuliaPackagesManifest()],
),
"tensorflow-notebook": ImageDescription(
parent_image="scipy-notebook", taggers=[TensorflowVersionTagger()]
),
"pytorch-notebook": ImageDescription(
parent_image="scipy-notebook", taggers=[PytorchVersionTagger()]
),
"datascience-notebook": ImageDescription(
parent_image="scipy-notebook",
taggers=[RVersionTagger(), JuliaVersionTagger()],
manifests=[RPackagesManifest(), JuliaPackagesManifest()],
),
"pyspark-notebook": ImageDescription(
parent_image="scipy-notebook",
taggers=[SparkVersionTagger(), JavaVersionTagger()],
manifests=[SparkInfoManifest()],
),
"all-spark-notebook": ImageDescription(
parent_image="pyspark-notebook",
taggers=[RVersionTagger()],
manifests=[RPackagesManifest()],
),
}