-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwct.toml
More file actions
194 lines (157 loc) · 6.29 KB
/
Copy pathwct.toml
File metadata and controls
194 lines (157 loc) · 6.29 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# This describes "kinds" of images. Each is a flat bag of parameters of
# templated string values or lists of strings. Lists imply an outer product is
# performed to make instances. Strings are formatted with values of other
# parameters. A kind may have zero or more parent kinds. One instance is made
# for each instance of the parent kind.
[debian]
# Params are used for formatting other variables and templates. A params of
# type list form a cross product.
#release = ['bookworm','trixie']
release = ['bookworm']
image = '{kind}:{release}'
label = '{kind} {release}'
[alma]
release = ["9"]
image = 'almalinux:{release}'
label = '{kind} {release}'
[alma_minimal]
# Each image class has zero or more parents kinds.
parent_kind = "alma"
image = '{parent_kind}-{parent[release]}-minimal'
label = '{parent[label]} minimal'
# but will be given a single "parent" which is the data structure from the
# single instance upon which a generated instance is built.
containerfile = """
FROM {parent[image]}
"""
[debian_minimal]
parent_kind = "debian"
image = '{parent_kind}-{parent[release]}-minimal'
label = '{parent[label]} minimal'
# The template will be formated with params of this node and the parent.
containerfile = """
FROM {parent[image]}
RUN apt update \
&& \
apt-get install -y \
build-essential ca-certificates coreutils curl gfortran git gpg clang autoconf \
lsb-release unzip zip direnv man-db emacs \
python-is-python3 python3 python3-distutils python3-venv python3-click python3-yaml \
&& \
apt-get clean
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && mv /root/.local/bin/uv* /usr/local/bin/
RUN bash -c "echo eval '$(direnv hook bash)' >> $HOME/.bashrc"
ENTRYPOINT ["bash","--login"]
"""
# fixme: that echo is broken. The $(direnv hook bash) gets expanded.
# This kind represents one "ecosystem". Future may inculude UPS or FNALSPACK
[spack]
#parent_kind = ["debian_minimal", "alma_minimal"]
parent_kind = "debian_minimal"
image = '{parent[image]}-spack'
label = '{parent[label]} spack'
containerfile = """
FROM {parent[image]}
RUN git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git
RUN /spack/bin/spack compiler find
RUN git clone https://github.com/WireCell/wire-cell-spack.git /spack/var/spack/repos/wirecell
RUN /spack/bin/spack repo add /spack/var/spack/repos/wirecell
RUN bash -c 'echo . /spack/share/spack/setup-env.sh >> $HOME/.bashrc'
ENTRYPOINT ["bash","--login"]
"""
# This kind of node represents building a seed package to provide dependencies
# for later.
[spackage]
parent_kind = "spack"
image = '{parent[image]}-wct-{version}'
label = '{parent[label]} WCT {version}'
package = "wire-cell-toolkit"
#version = ["master", "0.28.0"]
version = ["master"]
spec = "{package}@{version}"
containerfile = """
FROM {parent[image]}
RUN /spack/bin/spack install --fail-fast --no-cache --show-log-on-error -j 10 {spec} ^python@3.11.9
ENTRYPOINT ["bash","--login"]
"""
# This kind of node represents building a developer view for WCT.
[spackview]
parent_kind = "spackage"
image = '{parent[image]}-view'
label = '{parent[label]} view'
package = "wire-cell-toolkit"
containerfile = """
FROM {parent[image]}
# extra packages needed for WCT tests, not captured yet in wire-cell-spack
RUN /spack/bin/spack install --fail-fast --no-cache --show-log-on-error -j 10 jq
RUN /spack/bin/spack install --fail-fast --no-cache --show-log-on-error -j 10 graphviz+pangocairo
# The view
RUN /spack/bin/spack view -e {package} add -i winch/local {package} ^python@3.11.9
RUN for pkg in jq graphviz ; do /spack/bin/spack view add -i /winch/local $pkg; done
COPY dot.envrc winch/.envrc
RUN cd /winch && direnv allow
WORKDIR /winch
ENV PREFIX /winch/local
ENV PATH /winch/local/bin:/winch/toolkit/test/bats/bin:/bin:/usr/bin:/usr/local/bin
ENV LD_LIBRARY_PATH /winch/local/lib
ENV PKG_CONFIG_PATH /winch/local/share/pkgconfig:/winch/local/lib/pkgconfig:/winch/local/lib64/pkgconfig
ENV WIRECELL_PATH /winch/toolkit/cfg:/winch/local/share/wirecell
ENV BATS_LIB_PATH /winch/toolkit/test
"""
files = { "dot.envrc" = """
load_prefix "$PWD/local"
layout python
export PREFIX="$PWD/local"
path_add PKG_CONFIG_PATH "$PREFIX/share/pkgconfig"
path_add PKG_CONFIG_PATH "$PREFIX/lib/pkgconfig"
path_add PKG_CONFIG_PATH "$PREFIX/lib64/pkgconfig"
### Added by wcwc task wct-dev-view
# cfg from source and data from view
path_add WIRECELL_PATH $PWD/toolkit/cfg
path_add WIRECELL_PATH $PWD/local/share/wirecell
# find wct-bats.sh library in source
export BATS_LIB_PATH=$PWD/toolkit/test
PATH_add $PWD/toolkit/test/bats/bin
# Find python modules
export PYTHONPATH=$PWD/python
"""}
[wctdev]
parent_kind = "spackview"
image = '{parent[image]}-wctdev-{gitref}'
label = '{parent[label]} WCT dev'
## note: pushing fresh commits to a branch may require --force to rebuild the layer
#gitref = ["master","apply-pointcloud"]
# Note: 0.27.x will fail on recent SPDLOG
gitref = ["master", "0.29.x", "0.28.x"]
containerfile = """
FROM {parent[image]}
RUN git clone https://github.com/WireCell/wire-cell-python.git /winch/python
WORKDIR /winch/python
RUN python --version
RUN python -m pip install -r requirements/base.txt
RUN python -m pip install -r requirements/sigproc.txt
RUN python setup.py install
RUN echo "PREFIX is $PREFIX"
RUN echo "PATH is $PATH"
RUN git clone --branch {gitref} --single-branch https://github.com/WireCell/wire-cell-toolkit.git /winch/toolkit
WORKDIR /winch/toolkit
ENV PYTHONPATH /winch/python
ENV LIBRARY_PATH /winch/local/lib
RUN ./wcb configure --prefix=$PREFIX --boost-mt --boost-libs=$PREFIX/lib --boost-include=$PREFIX/include --with-jsonnet-libs=gojsonnet --with-jsonnet=$PREFIX --with-root=$PREFIX || cat /winch/toolkit/build/config.log
RUN ./wcb
RUN ./wcb install
# run wcdoctests explicitly to let their failures terminate the build
RUN for cmd in $(find ./build -regex '.*/wcdoctest-[a-z]*$') ; do $cmd; done
RUN cd /winch/toolkit && ./wcb --tests
"""
[wctdevdr]
parent_kind = "wctdev"
image = '{parent[image]}-datarepo'
containerfile = """
FROM {parent[image]}
RUN ls -l /winch/toolkit/build/tests/history
RUN ls -l /winch/toolkit/build/tests/history/$(git describe --tags)
RUN cd /winch/toolkit && tar -C build/tests -cf history-$(git describe --tags).tar history/$(git describe --tags)
RUN tar -tvf /winch/toolkit/history-$(git describe --tags).tar
RUN ls -l /winch/toolkit/history-$(git describe --tags).tar
"""