Skip to content

WIP - feat(atc): support volume size awareness for volume streaming#8693

Draft
SimonXming wants to merge 4 commits into
concourse:masterfrom
SimonXming:add-volume-size
Draft

WIP - feat(atc): support volume size awareness for volume streaming#8693
SimonXming wants to merge 4 commits into
concourse:masterfrom
SimonXming:add-volume-size

Conversation

@SimonXming

@SimonXming SimonXming commented Mar 1, 2023

Copy link
Copy Markdown
Contributor

What does this PR accomplish?

Bug Fix | Feature | Documentation

We received multiple user report error like failed to create container on worker: context deadline exceeded in our environment recently, the root cause seems to be user pipeline often stream huge volume unintentionally. And sometimes because of intermittent network instability, the volume streaming could be flaky especially when the volume is huge. Adding volume size awareness for volume streaming could be helpful in this situation, for example user could notice the unexpected huge volume size and then optimize the pipeline by remove unnecessary files in the volume.

Changes proposed by this PR:

  1. Detect volume size before volume streaming and display volume size from UI
  2. Cache volume size in the volume table to avoid duplicate volume size detection.

Notes to reviewer:

The screenshot contains streaming volume volume1 ($volumeSize) from worker1...

Screen Shot 2023-03-02 at 10 39 15

Release Note

  • feat(atc): support volume size awareness for volume streaming

Contributor Checklist

Reviewer Checklist

  • Code reviewed
  • Tests reviewed
  • Documentation reviewed
  • Release notes reviewed
  • PR acceptance performed
  • New config flags added? Ensure that they are added to the
    BOSH and
    Helm packaging; otherwise, ignored for
    the integration
    tests

    (for example, if they are Garden configs that are not displayed in the
    --help text).

Signed-off-by: Ming Xu <mingx@vmware.com>
Signed-off-by: Ming Xu <mingx@vmware.com>
Signed-off-by: Ming Xu <mingx@vmware.com>
@SimonXming
SimonXming requested a review from a team March 1, 2023 08:41
Comment thread atc/worker/gardenruntime/volume.go Outdated
"worker": volume.worker.DBWorker().Name(),
"size": bcSourceVolume.Size(),
})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When volume.DBVolume().Size() > 0, where bcSourceVolume is initialized?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

logger.Error("failed-to-find-source-volume-for-streaming", err)
return Volume{}, err
}
if inputPath == "for image" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should open this feature to all volumes. If you only want to apply to image volume, then this check should go to line 720.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Based on the metrics, streamed image volume accounts for more than 80% of the total streamed volume(image & non-image).
Also, calculate&cache image volume size should make more sense than non-image volume, because non-image volume size may change swiftly but image volume size could be considered as unchanged.

}
}

func (vs *VolumeServer) GetVolumeWithSize(w http.ResponseWriter, req *http.Request) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function has completely duplicate to GetVolume(). We should add an private function:

func (vs *VolumeServer) getVolume(w http.ResponseWriter, req *http.Request, withSize bool) {
}

func (vs *VolumeServer) GetVolume(w http.ResponseWriter, req *http.Request) {
  return vs.getVolume(w, req, false)
}

func (vs *VolumeServer) GetVolumeWithSize(w http.ResponseWriter, req *http.Request) {
  return vs.getVolume(w, req, true)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where GetVolumeWithSize() is used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, updated.

Where GetVolumeWithSize() is used?
It's used in getVolumeResponse() for sending GetVolume or GetVolumeWithSize request.

  • worker/baggageclaim/client/client.go

Signed-off-by: Ming Xu <mingx@vmware.com>
@marco-m-pix4d

Copy link
Copy Markdown
Contributor

I wonder what is the relationship between this PR and #8756 (the latter being in release https://github.com/concourse/concourse/releases/tag/v7.10.0) ?

@taylorsilva

Copy link
Copy Markdown
Member

@SimonXming any interest in continuing this PR? If not, feel free to close it. If anyone else wants to pick this up and re-submit, feel free to do so. I'll close this PR after a few weeks if there's no movement.

@taylorsilva
taylorsilva marked this pull request as draft July 10, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants