Repository: easybuilders/easybuild-framework

Issue:
Report progress during extentions installation
It would be nice to have some form of feedback during the `== taking care of extensions...` phase. Some easyconfigs spend the majority of time in there so any indication of progress would be nice.

Something like this:

```
...
== testing...
== installing...
== taking care of extensions...
== * Working on extension a-1.23
== * Working on extension a-1.23
== * Working on extension a-1.23
== * Working on extension a-1.23
== postprocessing...
...
```



Discussion:
@serverhorror: up for taking a stab at it yourself? it's fairly trivial

see https://github.com/hpcugent/easybuild-framework/blob/master/easybuild/framework/easyblock.py#L1550, to print, use the `print_msg` function

Should this be reported always or maybe just on `eb --force --skip ...` or maybe even the other way around (only when building initially)?

I've been spamming myself with messages and I'm not convinced anymore that it is a good idea to report that level of detail unconditionally

@serverhorror: there are several options
- print the name/version for extensions being installed one-by-one but all on the same line (to avoid scrolling)
- print a N/M overview of how many extensions are left to be installed, and refresh it (one the same line)
- just print a '`.`' or `'x'` for every extension

Hi,

I like the second option.Is adding a new dependency OK? I'll look into
progress bar libs then.

/Martin

On Tue, Jan 26, 2016 at 11:37 AM, Kenneth Hoste notifications@github.com
wrote:

> @serverhorror https://github.com/serverhorror: there are several options
> - print the name/version for extensions being installed one-by-one but
>   all on the same line (to avoid scrolling)
> - print a N/M overview of how many extensions are left to be
>   installed, and refresh it (one the same line)
> - just print a '.' or 'x' for every extension
> 
> —
> Reply to this email directly or view it on GitHub
> https://github.com/hpcugent/easybuild-framework/issues/1507#issuecomment-174949872
> .

## 

http://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher
Mobil: +43 / 660 / 62 45 103
UID: ATU68801424


Resolving patch:
diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py
--- a/easybuild/framework/easyblock.py
+++ b/easybuild/framework/easyblock.py
@@ -1648,8 +1648,10 @@ def extensions_step(self, fetch=False):
             raise EasyBuildError("Improper default extension class specification, should be list/tuple or string.")
 
         # get class instances for all extensions
-        for ext in self.exts:
+        exts_cnt = len(self.exts)
+        for idx, ext in enumerate(self.exts):
             self.log.debug("Starting extension %s" % ext['name'])
+            print_msg("installing extension %s %s (%d/%d)..." % (ext['name'], ext.get('version', ''), idx+1, exts_cnt))
 
             # always go back to original work dir to avoid running stuff from a dir that no longer exists
             os.chdir(self.orig_workdir)
@@ -1696,8 +1698,8 @@ def extensions_step(self, fetch=False):
                 self.log.debug("Installing extension %s with class %s (from %s)" % (ext['name'], class_name, mod_path))
 
             if self.dry_run:
-                eb_class = cls.__name__
-                msg = "\n* installing extension %s %s using '%s' easyblock\n" % (ext['name'], ext['version'], eb_class)
+                tup = (ext['name'], ext.get('version', ''), cls.__name__)
+                msg = "\n* installing extension %s %s using '%s' easyblock\n" % tup
                 self.dry_run_msg(msg)
 
             self.log.debug("List of loaded modules: %s", self.modules_tool.list())


Test patch: