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

File Size for Backups #3152

Closed
tnelson-doghouse opened this issue Mar 3, 2022 · 7 comments
Closed

File Size for Backups #3152

tnelson-doghouse opened this issue Mar 3, 2022 · 7 comments

Comments

@tnelson-doghouse
Copy link

In the list of backups, it'd be great to have the file size, especially once it's been retrieved and is available for download.

If this ticket is attached to the wrong repo, feel free to move it.

Thanks!

@shreddedbacon shreddedbacon transferred this issue from uselagoon/lagoon-ui May 26, 2022
@chandanatk
Copy link

@tnelson-doghouse we moved this to the lagoon repo, that is the best place to raise Lagoon issues at first, even for UI. Thanks.

Also noting down comments from another customer in the APAC region, requesting the same.
Currrently, to find out the size of the files we need to download the tarball and decompress. It would great if this was simply displayed in the UI to save huge downloads that we instantly delete.

@shreddedbacon
Copy link
Member

Off the top of my head, with our current backup implementation this isn't possible to know the size of the files before they are retrieved. But once they have been retrieved, it may be possible to report the file size against the download, but this would depend heavily on how quick the filesize could be retrieved from S3.

IMHO, it would be better if the backup system we utilised (k8up) could send this information in the payload so we wouldn't need to try and figure it out.

@dan2k3k4
Copy link
Contributor

It should be possible to send a HEAD request to get the file size info:
https://stackoverflow.com/a/44134068/187505

Docs for AWS S3:
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#headObject-property

@tobybellwood
Copy link
Member

We use the aws-sdk v2 under the hood, and it seems to support getObjectAttributes requests, so as long as the object host (S3 on AWS, otherwise S3-compatible-ish) returns that, it's possible.

@dan2k3k4
Copy link
Contributor

Reposting here as mentioned on Slack

Sent a HEAD request for a couple backup links (Download links, after Retrieve).

HEAD returned content-length: 18001067
Which translates to around 18 MB
And ls -lisah shows 18M

So the HEAD request works for the Download ready links.

Thus, we can expose the file size of the Download links by doing a HEAD request or, as mentioned, using the aws-sdk to getObjectAttributes or similar.

@shreddedbacon
Copy link
Member

I just created a PR that can retrieve the file size from the ContentLength of the head request and return it in the query, which could then be displayed in the UI

@rocketeerbkw
Copy link
Member

The restore size is now shown in the UI with Lagoon v2.18.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants