[yast-devel] Hackweek: Unified Installation Progress
Hi Hackers! So, Hackweek III is over and here is the result of my work - a grand unified installation progress. Global progress =============== The basic idea is that the progress consists "stages" - during a new install, there are 3: disk preparation, image deployment and package installation. Before the first client using the unified progress, the stages need to be set up, e.g. : list< map<string,any> > stages = [ $[ "name" : "disk", "description": _("Preparing disks..."), "value" : Mode::update() ? 0 : 120, // 2 minutes, who needs more? ;-) "units" : `sec, ], $[ "name" : "images", "description": _("Deploying Images..."), "value" : ImageInstallation::TotalSize() / 1024, // kilobytes "units" : `kb, ], $[ "name" : "packages", "description": _("Installing Packages..."), // here, we do a hack, because until images are deployed, we cannot determine how many // packages will be really installed additionally "value" : (PackageSlideShow::total_size_to_install - ImageInstallation::TotalSize()) / 1024 , // kilobytes "units" : `kb, ], ]; SlideShow::Setup( stages ); The function will calculate the partitioning of the unified progress based on estimate of a needed time. A stage can provide the estimate of time or an amount of data to be transferred (the constants used are based on assumption of 15 min install time and that the data are downloaded and written to disk). The logic is no rocket science as the only goal for a progress bar is to have it move somewhat regularly. A client using the new unified progress will do basically 2 things: 1) calls SlideShow::MoveToStage( stage-id ) - this will move the global progress to a proper position for start of the stage and updates also the label ("description" entry in the map) 2) calls regularly SlideShow::StageProgress( new_percent, new_label ) - new_percent is the progress inside of the current stage, the library will recompute this to get a global progress percents. - if new_label is nil, label is not updated. More functionality ================== The SlideShow dialog contains the following functionality: - global progress (see above) - subprogress for the current action (e.g. download a package, format disk, ...) - installation log - slide show support - optional package table - release notes viewer See the SlideShow API how to handle those. Implementation Notes ==================== During the hacking, I've splitted the old SlideShow module into 3: - Slides.ycp - handling of slide loading from the installation medium - SlideShow.ycp - generic API for the unified installation progress - PackageSlideShow - code specific for handling package installation, e.g. CDs, summary table, .... Attached are the complete new modules as diffs do not make much sense. Next, there is updated control.xml with a new installation client inst_prepareprogress which sets up the stages for normal installation. The rest are diffs for adapting to new APIs. Influenced code is in yast2-installation, yast2-packager and yast2-storage I've tested the code on modified alpha2 - new installation, update and also on running system. Qt and ncurses. Stano
Stanislav Visnovsky wrote:
Hi Hackers!
So, Hackweek III is over and here is the result of my work - a grand unified installation progress.
Global progress =============== The basic idea is that the progress consists "stages" - during a new install, there are 3: disk preparation, image deployment and package installation.
Well done :) Will you commit these changes to SVN and autobuild yourself or do you want every single developer (packager, storage, installation) to do it? In my opinion, it would be better if just one did it as RPM dependencies need to be set properly. Bye Lukas
Dňa Monday 01 September 2008 09:59:12 Lukas Ocilka ste napísal:
Stanislav Visnovsky wrote:
Hi Hackers!
So, Hackweek III is over and here is the result of my work - a grand unified installation progress.
Global progress =============== The basic idea is that the progress consists "stages" - during a new install, there are 3: disk preparation, image deployment and package installation.
Well done :)
;-)
Will you commit these changes to SVN and autobuild yourself or do you want every single developer (packager, storage, installation) to do it? In my opinion, it would be better if just one did it as RPM dependencies need to be set properly.
It would be great if someone can review the patches (at least). I can commit afterwards (but have no idea how you adapt RPM dependencies). Stano -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Hi! Here is updated patch for yast2-storage to make 'yast disk' work on running system. Arvin, does this look better? The installation part and packager part is commited now in trunk (and thanks to Bubli now even sw_single works - sorry for that). control.xml for products still need to be adapted. Stano Dňa Monday 01 September 2008 09:29:59 Stanislav Visnovsky ste napísal:
Hi Hackers!
So, Hackweek III is over and here is the result of my work - a grand unified installation progress.
Global progress =============== The basic idea is that the progress consists "stages" - during a new install, there are 3: disk preparation, image deployment and package installation.
Before the first client using the unified progress, the stages need to be set up, e.g. :
list< map<string,any> > stages = [ $[ "name" : "disk", "description": _("Preparing disks..."), "value" : Mode::update() ? 0 : 120, // 2 minutes, who needs more? ;-) "units" : `sec, ], $[ "name" : "images", "description": _("Deploying Images..."), "value" : ImageInstallation::TotalSize() / 1024, // kilobytes "units" : `kb, ], $[ "name" : "packages", "description": _("Installing Packages..."), // here, we do a hack, because until images are deployed, we cannot determine how many // packages will be really installed additionally "value" : (PackageSlideShow::total_size_to_install - ImageInstallation::TotalSize()) / 1024 , // kilobytes "units" : `kb, ], ];
SlideShow::Setup( stages );
The function will calculate the partitioning of the unified progress based on estimate of a needed time. A stage can provide the estimate of time or an amount of data to be transferred (the constants used are based on assumption of 15 min install time and that the data are downloaded and written to disk). The logic is no rocket science as the only goal for a progress bar is to have it move somewhat regularly.
A client using the new unified progress will do basically 2 things:
1) calls SlideShow::MoveToStage( stage-id ) - this will move the global progress to a proper position for start of the stage and updates also the label ("description" entry in the map)
2) calls regularly SlideShow::StageProgress( new_percent, new_label ) - new_percent is the progress inside of the current stage, the library will recompute this to get a global progress percents. - if new_label is nil, label is not updated.
More functionality ================== The SlideShow dialog contains the following functionality: - global progress (see above) - subprogress for the current action (e.g. download a package, format disk, ...) - installation log - slide show support - optional package table - release notes viewer
See the SlideShow API how to handle those.
Implementation Notes ==================== During the hacking, I've splitted the old SlideShow module into 3: - Slides.ycp - handling of slide loading from the installation medium - SlideShow.ycp - generic API for the unified installation progress - PackageSlideShow - code specific for handling package installation, e.g. CDs, summary table, ....
Attached are the complete new modules as diffs do not make much sense. Next, there is updated control.xml with a new installation client inst_prepareprogress which sets up the stages for normal installation. The rest are diffs for adapting to new APIs. Influenced code is in yast2-installation, yast2-packager and yast2-storage
I've tested the code on modified alpha2 - new installation, update and also on running system. Qt and ncurses.
Stano
participants (2)
-
Lukas Ocilka
-
Stanislav Visnovsky