Skip to content

Commit 2e5c6ab

Browse files
committed
start extensions progress bar a bit earlier, also mention preparatory steps (like creating of Extension instances)
1 parent 3fe1f68 commit 2e5c6ab

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

easybuild/framework/easyblock.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,6 @@ def install_extensions_sequential(self, install=True):
16611661
self.log.info("Installing extensions sequentially...")
16621662

16631663
exts_cnt = len(self.ext_instances)
1664-
start_progress_bar(PROGRESS_BAR_EXTENSIONS, exts_cnt)
16651664

16661665
for idx, ext in enumerate(self.ext_instances):
16671666

@@ -1670,7 +1669,7 @@ def install_extensions_sequential(self, install=True):
16701669
# always go back to original work dir to avoid running stuff from a dir that no longer exists
16711670
change_dir(self.orig_workdir)
16721671

1673-
progress_label = "Installing '%s' extension" % ext.name
1672+
progress_label = "Installing '%s' extension (%s/%s)" % (ext.name, idx + 1, exts_cnt)
16741673
update_progress_bar(PROGRESS_BAR_EXTENSIONS, label=progress_label)
16751674

16761675
tup = (ext.name, ext.version or '', idx + 1, exts_cnt)
@@ -1711,8 +1710,6 @@ def install_extensions_sequential(self, install=True):
17111710
elif self.logdebug or build_option('trace'):
17121711
print_msg("\t... (took < 1 sec)", log=self.log, silent=self.silent)
17131712

1714-
stop_progress_bar(PROGRESS_BAR_EXTENSIONS, visible=False)
1715-
17161713
def install_extensions_parallel(self, install=True):
17171714
"""
17181715
Install extensions in parallel.
@@ -1734,8 +1731,6 @@ def install_extensions_parallel(self, install=True):
17341731
exts_cnt = len(all_ext_names)
17351732
exts_queue = self.ext_instances[:]
17361733

1737-
start_progress_bar(PROGRESS_BAR_EXTENSIONS, exts_cnt)
1738-
17391734
def update_exts_progress_bar(running_exts, progress_size):
17401735
"""Helper function to update extensions progress bar."""
17411736
running_exts_cnt = len(running_exts)
@@ -1747,6 +1742,7 @@ def update_exts_progress_bar(running_exts, progress_size):
17471742
progress_label = "Not installing extensions (yet)"
17481743

17491744
progress_label += ' '.join(e.name for e in running_exts)
1745+
progress_label += "(%d/%d done)" % (len(installed_ext_names), exts_cnt)
17501746
update_progress_bar(PROGRESS_BAR_EXTENSIONS, label=progress_label, progress_size=progress_size)
17511747

17521748
iter_id = 0
@@ -1831,8 +1827,6 @@ def update_exts_progress_bar(running_exts, progress_size):
18311827
self.log.info("Started installation of extension %s in the background...", ext.name)
18321828
update_exts_progress_bar(running_exts, 0)
18331829

1834-
stop_progress_bar(PROGRESS_BAR_EXTENSIONS, visible=False)
1835-
18361830
#
18371831
# MISCELLANEOUS UTILITY FUNCTIONS
18381832
#
@@ -2587,9 +2581,12 @@ def extensions_step(self, fetch=False, install=True):
25872581

25882582
fake_mod_data = self.load_fake_module(purge=True, extra_modules=build_dep_mods)
25892583

2584+
start_progress_bar(PROGRESS_BAR_EXTENSIONS, len(self.cfg['exts_list']))
2585+
25902586
self.prepare_for_extensions()
25912587

25922588
if fetch:
2589+
update_progress_bar(PROGRESS_BAR_EXTENSIONS, label="fetching extension sources/patches", progress_size=0)
25932590
self.exts = self.collect_exts_file_info(fetch_files=True)
25942591

25952592
self.exts_all = self.exts[:] # retain a copy of all extensions, regardless of filtering/skipping
@@ -2603,9 +2600,11 @@ def extensions_step(self, fetch=False, install=True):
26032600
self.clean_up_fake_module(fake_mod_data)
26042601
raise EasyBuildError("ERROR: No default extension class set for %s", self.name)
26052602

2603+
update_progress_bar(PROGRESS_BAR_EXTENSIONS, label="creating Extension instances", progress_size=0)
26062604
self.init_ext_instances()
26072605

26082606
if self.skip:
2607+
update_progress_bar(PROGRESS_BAR_EXTENSIONS, label="skipping installed extensions", progress_size=0)
26092608
self.skip_extensions()
26102609

26112610
self.install_extensions(install=install)
@@ -2614,6 +2613,8 @@ def extensions_step(self, fetch=False, install=True):
26142613
if fake_mod_data:
26152614
self.clean_up_fake_module(fake_mod_data)
26162615

2616+
stop_progress_bar(PROGRESS_BAR_EXTENSIONS, visible=False)
2617+
26172618
def package_step(self):
26182619
"""Package installed software (e.g., into an RPM), if requested, using selected package tool."""
26192620

easybuild/tools/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def extensions_progress_bar():
242242
Get progress bar to show progress for installing extensions.
243243
"""
244244
progress_bar = Progress(
245-
TextColumn("[bold blue]{task.description} ({task.completed}/{task.total})"),
245+
TextColumn("[bold blue]{task.description}"),
246246
BarColumn(),
247247
TimeElapsedColumn(),
248248
)

0 commit comments

Comments
 (0)