-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path1-splunk-lab-ml
124 lines (97 loc) · 4.58 KB
/
1-splunk-lab-ml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# This is based on our existing Splunk Lab
#
FROM splunk-lab-core as builder
ARG DEPLOY
WORKDIR /tmp
COPY ${DEPLOY}/splunk-machine-learning-toolkit_520.tgz /tmp/splunk-packages/
COPY ${DEPLOY}/nlp-text-analytics_102.tgz /tmp/splunk-packages/
COPY ${DEPLOY}/halo-custom-visualization_113.tgz /tmp/splunk-packages/
COPY ${DEPLOY}/sankey-diagram-custom-visualization_130.tgz /tmp/splunk-packages/
#
# I know that at first glance, this looks kinda crazy.
# The reason for all these files is because the Python tarball is HUGE, and breaking it
# up into smaller pieces keeps individual Docker layers from getting too big.
# I'm not thrilled with this approach either, it's the best I can do for now, though.
#
#
# NOTE: Now that I have a builder container, this may no longer be necessary, and
# I should revisit it in a future maintenance.
#
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-1-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-2-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-3-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-4-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-5-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-6-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-7-of-8 /tmp/
COPY ${DEPLOY}/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-8-of-8 /tmp/
#
# Install Python for Scientific computing and Splunk ML Toolkit
#
RUN mkdir -p /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-1-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-2-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-3-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-4-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-5-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-6-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-7-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
RUN tar xfvz /tmp/python-for-scientific-computing-for-linux-64-bit_202.tgz-part-8-of-8 \
--strip 1 -C /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
#
# Machine Learning toolkit
#
RUN tar xfvz /tmp/splunk-packages/splunk-machine-learning-toolkit_520.tgz
#
# NLP text analytics
#
RUN tar xfvz /tmp/splunk-packages/nlp-text-analytics_102.tgz
#
# Halo custom visualization
#
RUN tar xfvz /tmp/splunk-packages/halo-custom-visualization_113.tgz
#
# Sankey custom visualization
#
RUN tar xfvz /tmp/splunk-packages/sankey-diagram-custom-visualization_130.tgz
#
# Now that apps are installed, we can install the config files, with a lot less
# stuff being downlaoded/images being re-built.
#
FROM splunk-lab-core
WORKDIR /tmp
COPY --from=builder /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64 /opt/splunk/etc/apps/Splunk_SA_Scientific_Python_linux_x86_64
COPY --from=builder /tmp/Splunk_ML_Toolkit /opt/splunk/etc/apps/Splunk_ML_Toolkit
COPY --from=builder /tmp/nlp-text-analytics /opt/splunk/etc/apps/nlp-text-analytics
COPY --from=builder /tmp/viz_halo /opt/splunk/etc/apps/viz_halo
COPY --from=builder /tmp/sankey_diagram_app /opt/splunk/etc/apps/sankey_diagram_app
#
# Copy in our READMEs
#
COPY vendor/README.md /README-vendor.md
COPY README.md /README.md
#
# Copy in some Splunk configuration
#
COPY splunk-config/splunk-launch.conf /opt/splunk/etc/
COPY splunk-config/* /opt/splunk/etc/system/local/
#
# Install the Splunk Lab app and set it to the default
#
COPY splunk-lab-app /opt/splunk/etc/apps/splunk-lab
RUN mkdir -p /opt/splunk/etc/users/admin/user-prefs/local \
&& mv /opt/splunk/etc/apps/splunk-lab/user-prefs.conf /opt/splunk/etc/users/admin/user-prefs/local/
#
# Expose Splunk web
#
EXPOSE 8000/tcp
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]