Commit Graph

22 Commits

Author SHA1 Message Date
Adrien Delorme a9107a8fe9 noop progress bar is nil progress bar 2020-09-24 12:26:09 +02:00
Megan Marsh 15ee44e857 review comments 2020-09-23 11:33:51 -07:00
Megan Marsh ae8d359bf1 Switch to explicitly declaring TrackProgress on UI, using an underlying progress bar specifically stored on the struct. Export UiProgressTracker. These changes allow us to optionaly switch to the NoopProgressTracker when no TTY is set. 2020-09-21 16:05:14 -07:00
Adrien Delorme 5f076d4328 allow building packer on solaris by removing progress bar and tty imports
fix #7586
2019-05-07 15:58:49 +02:00
Adrien Delorme 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Adrien Delorme c393ccb7ca fix progress bar termination typo 2018-10-26 11:29:15 +02:00
Adrien Delorme 25775cd266 fix more race conditions 2018-10-15 16:31:59 +02:00
Adrien Delorme 27f4b9e4a1 pb/testing: triger more race condition by having the progress bar refresh more often 2018-10-15 15:28:46 +02:00
Adrien Delorme 4cae413a29 remove unedded atomic call ( protected by a lock ) 2018-10-15 15:28:08 +02:00
Adrien Delorme 56ccba86c7 fix some race conditions 2018-10-15 13:53:59 +02:00
Adrien Delorme 611610c89d BasicProgresssBar: protect add with a lock
to avoid weird race conditions.
2018-10-02 16:57:16 +02:00
Megan Marsh 3f8407d95f Revert "Merge pull request #6700 from hashicorp/multi_progressbar"
This reverts commit 5470c08345, reversing
changes made to c427486bca.
2018-09-20 13:14:17 -07:00
Adrien Delorme be27775a3c start the pool only once 2018-09-12 17:04:10 -07:00
Adrien Delorme dfeca9f0df split progressbars per object 2018-09-12 16:21:58 -07:00
Megan Marsh 77980a7b53 fix progress bar mutex 2018-09-12 10:53:15 -07:00
Adrien Delorme 0ac7b64364 fix panic of the future using a mutex instead of some atomic calls + more docs 2018-09-06 18:12:15 +02:00
Adrien Delorme 8a851efcc8 progressbar: more godocs 2018-09-06 17:01:14 +02:00
Adrien Delorme bb59a70e8f progressbar: use int64 instead of uint64
* it's what's used for file sizes and used lib
2018-09-06 16:49:15 +02:00
Adrien Delorme 408578507f also prefix bar with number of items processing 2018-09-06 15:53:59 +02:00
Adrien Delorme 541c68aed5 add StackableProgressBar struct that will refresh/show dl status for multiple files
* simplified the downloader interface, and removed the total/current values from them
* downloaders use a proxy reader that will add all read bytes to progress
* removed unused const mtu
* DownloadClient doesn't need a downloader, so I removed it too
2018-09-06 15:53:59 +02:00
Adrien Delorme fd7cb47adc use proxy reader for download progress & stop storing total/current in downloaders 2018-09-06 15:53:59 +02:00
Adrien Delorme ddd96c513b first draft at self refreshing loading bar centralized/controlled by Ui 2018-09-06 15:53:59 +02:00