Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SimonXming
Copy link
Contributor

@SimonXming SimonXming commented Mar 1, 2023

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).

@SimonXming SimonXming requested a review from a team as a code owner March 1, 2023 08:41
atc/worker/gardenruntime/volume.go Outdated Show resolved Hide resolved
"worker": volume.worker.DBWorker().Name(),
"size": bcSourceVolume.Size(),
})
}
Copy link
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
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
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
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
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
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
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 <[email protected]>
@marco-m-pix4d
Copy link
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) ?

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.

None yet

3 participants