Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

ChangeSet Improvements #3464

Closed
wants to merge 3 commits into from
Closed

ChangeSet Improvements #3464

wants to merge 3 commits into from

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Apr 23, 2018

https://pulp.plan.io/issues/3582

Improvements:

  • The ChangeSet.apply_and_drain() removed.
  • The SizedIterator no longer used.
  • ChangeSet.apply() signature updated.
  • Progress reported for artifact downloads.
  • Exposed ContentIterator as it will be useful for other abstractions.

while pending:
future = asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED)
completed, pending = loop.run_until_complete(future)
for task in completed:
if self.bar:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the use of the BatchIterator unusual for downloading.

Say for example, the we have to download 20 artifacts overall. The size of the artifacts are 1* 1GB + 19 * 1MB (they are yielded in this order by the artifact iterator).
With a batch size of 10, the first 10 downloads will be started in parallel. However, all of them need to terminate (including the 1 GB one) before the second batch is started. In the first batch, there will be only one concurrent download for most of the time with 10 queued downloads that do not start.

I would expect pending to be filled with up to 10 downloads initially. Then, it is backfilled by one download for each completed task in order to always have 10 concurrent downloads. But perhaps I am missing something here...

Copy link
Contributor Author

@jortel jortel Apr 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @gmbnomis. You have identified a flaw where. Using the BatchIterator here to support the progressive progress reporting will still be useful but the batch needs to be bigger (like the default: 1024). Then within each batch the self.concurrent needs to be used differently to constrain the number of concurrent downloads. Will fix.

else:
return


class Batch(Iterable, Sized):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the Batch because it adds no value. Not sure what I was thinking :-/

@jortel jortel mentioned this pull request May 11, 2018
@bmbouter bmbouter closed this May 31, 2018
@werwty werwty changed the base branch from 3.0-dev to master May 31, 2018 22:08
@werwty werwty reopened this May 31, 2018
@codecov
Copy link

codecov bot commented Jun 7, 2018

Codecov Report

Merging #3464 into master will decrease coverage by 56.39%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3464      +/-   ##
=========================================
- Coverage   56.64%   0.24%   -56.4%     
=========================================
  Files          59      59              
  Lines        2415    2415              
=========================================
- Hits         1368       6    -1362     
- Misses       1047    2409    +1362
Impacted Files Coverage Δ
pulpcore/pulpcore/tasking/constants.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/exceptions/__init__.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/pagination.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/tasks/__init__.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/viewsets/__init__.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/views/__init__.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/viewsets/user.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/models/__init__.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/serializers/__init__.py 0% <0%> (-100%) ⬇️
pulpcore/pulpcore/app/serializers/status.py 0% <0%> (-100%) ⬇️
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9795a18...5de4c76. Read the comment docs.

@dralley
Copy link
Contributor

dralley commented Oct 19, 2018

Closing this since ChangeSets are being removed in favor of stages @bmbouter @jortel

@dralley dralley closed this Oct 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants