Skip to content

Commit 98c6cc8

Browse files
committed
Improve package version tracking. Remove requirement on artdaq version
1 parent 8a99fa0 commit 98c6cc8

3 files changed

Lines changed: 6 additions & 99 deletions

File tree

rc/control/bookkeeping.py

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -20,83 +20,6 @@
2020

2121
def bookkeeping_for_fhicl_documents_artdaq_v3_base(self):
2222

23-
# Determine that the artdaq package used is new enough to be
24-
# compatible with the assumptions made by DAQInterface about the
25-
# interface artdaq offers
26-
27-
# JCF, Nov-20-2018: update this when ready to require subsystem-compatible
28-
# artdaq
29-
30-
if os.path.exists(self.daq_dir + "/srcs/artdaq"):
31-
commit_check_throws_if_failure(
32-
self.daq_dir + "/srcs/artdaq",
33-
"b434f3b71dd5c87da68d6b13f040701ff610fee1",
34-
"July 15, 2018",
35-
True,
36-
)
37-
else:
38-
39-
# JCF, Sep-20-2018: not yet logic for requiring an artdaq
40-
# version with a letter at the end of it (e.g., v3_02_01a as
41-
# opposed to v3_02_01)
42-
43-
min_majorver = "3"
44-
min_minorver = "03"
45-
min_minorerver = "00"
46-
47-
# ...so we'll also have a list of versions where if the artdaq
48-
# version matches one of them, we'll be considered OK
49-
50-
other_allowed_versions = ["v3_02_01a"]
51-
52-
self.fill_package_versions(["artdaq"])
53-
version = self.package_versions["artdaq"]
54-
55-
res = re.search(r"v([0-9]+)_([0-9]+)_([0-9]+)(.*)", version)
56-
57-
if not res:
58-
raise Exception(
59-
"Problem parsing the calculated version of artdaq, %s" % (version)
60-
)
61-
62-
majorver = res.group(1)
63-
minorver = res.group(2)
64-
minorerver = res.group(3)
65-
extension = res.group(4)
66-
67-
passes_requirement = False
68-
69-
if int(majorver) > int(min_majorver):
70-
passes_requirement = True
71-
elif int(majorver) == int(min_majorver):
72-
if int(minorver) > int(min_minorver):
73-
passes_requirement = True
74-
elif int(minorver) == int(min_minorver):
75-
if int(minorerver) >= int(min_minorerver):
76-
passes_requirement = True
77-
78-
if not passes_requirement:
79-
for an_allowed_version in other_allowed_versions:
80-
if version == an_allowed_version:
81-
passes_requirement = True
82-
83-
if not passes_requirement:
84-
raise Exception(
85-
make_paragraph(
86-
'Version of artdaq set up by setup script "%s" is v%s_%s_%s%s; need a version at least as recent as v%s_%s_%s'
87-
% (
88-
self.daq_setup_script,
89-
majorver,
90-
minorver,
91-
minorerver,
92-
extension,
93-
min_majorver,
94-
min_minorver,
95-
min_minorerver,
96-
)
97-
)
98-
)
99-
10023
# Start calculating values (fragment counts, memory sizes, etc.)
10124
# which will need to appear in the FHiCL
10225

rc/control/daqinterface.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,26 +2033,12 @@ def fill_package_versions(self, packages):
20332033
if package in self.package_versions:
20342034
continue
20352035
else:
2036-
needed_packages.append(package if self.productsdir != None else package.replace("_", "-"))
2036+
needed_packages.append(package)
20372037

20382038
if len(needed_packages) == 0:
20392039
return
20402040

2041-
if "artdaq_daqinterface" in packages:
2042-
assert (
2043-
len(packages) == 1
2044-
), "Note to developer: you'll probably need to refactor save_run_records.py if you want to get the version of other packages alongside the version of DAQInterface"
2045-
cmd = "ups active | sed -r -n 's/^artdaq_daqinterface\\s+(\\S+).*/artdaq_daqinterface \\1/p'"
2046-
elif self.productsdir != None:
2047-
cmd = (
2048-
"%s ; . %s; ups active | sed -r -n 's/^(%s)\\s+(\\S+).*/\\1 \\2/p'"
2049-
% (
2050-
";".join(get_setup_commands(self.productsdir, self.spackdir)),
2051-
self.daq_setup_script,
2052-
"|".join(needed_packages),
2053-
)
2054-
)
2055-
elif self.spackdir != None:
2041+
if self.spackdir != None:
20562042
cmd = (
20572043
"%s ; . %s; spack find --loaded | sed -r -n 's/^(%s)@(\\S+).*/\\1 \\2/p'" % (
20582044
";".join(get_setup_commands(self.productsdir, self.spackdir)),
@@ -2122,7 +2108,7 @@ def fill_package_versions(self, packages):
21222108
)
21232109
)
21242110
# print('package=%s type(package)=%s' % (package,type(package)))
2125-
self.package_versions[package.replace("-", "_")] = version
2111+
self.package_versions[package] = version
21262112

21272113
for package in packages:
21282114
if package not in self.package_versions:

rc/control/save_run_record.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def save_run_record_base(self):
225225

226226
for pkgname in self.package_hashes_to_save:
227227

228-
pkg_full_path = "%s/srcs/%s" % (self.daq_dir, pkgname.replace("-", "_"))
228+
pkg_full_path = "%s/srcs/%s" % (self.daq_dir, pkgname)
229229
commit_info_fullpathname = "%s/%s" % (
230230
os.path.dirname(self.daq_setup_script),
231231
get_commit_info_filename(pkgname),
@@ -248,14 +248,12 @@ def save_run_record_base(self):
248248
# We'll throw this on the list of packages whose actual versions we need to figure out in real-time
249249
packages_whose_versions_we_need.append(pkgname)
250250

251-
self.fill_package_versions(
252-
[pkg.replace("-", "_") for pkg in packages_whose_versions_we_need]
253-
)
251+
self.fill_package_versions( packages_whose_versions_we_need )
254252

255253
for pkgname in packages_whose_versions_we_need:
256254
package_commit_dict[pkgname] = "%s commit/version: %s" % (
257255
pkgname,
258-
self.package_versions[pkgname.replace("-", "_")],
256+
self.package_versions[pkgname],
259257
)
260258

261259
for pkg in sorted(package_commit_dict.keys()):

0 commit comments

Comments
 (0)