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

Add compressed writes to cas.go. #240

Merged
merged 1 commit into from
Nov 24, 2020
Merged

Add compressed writes to cas.go. #240

merged 1 commit into from
Nov 24, 2020

Conversation

rubensf
Copy link
Contributor

@rubensf rubensf commented Nov 13, 2020

This follows the current tentative API. This PR potentially replaces #232

@google-cla google-cla bot added the cla: yes The author signed a CLA label Nov 13, 2020
// Notice that the digest in the chunker might be misleading.
// Specifically, for compressed blob uploads, the resource
// name should include the uncompressed digest - while chunker
// should be including the compressed digest.
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought that you removed the Digest() function from Chunker altogether, instead relying on UE.digest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - this is just an artifact of rebasing :)

@@ -65,7 +65,7 @@ func shouldIgnore(inp string, t command.InputType, excl []*command.InputExclusio

// loadFiles reads all files specified by the given InputSpec (descending into subdirectories
// recursively), and loads their contents into the provided map.
func loadFiles(execRoot string, excl []*command.InputExclusion, path string, fs map[string]*fileSysNode, cache filemetadata.Cache) error {
func (c *Client) loadFiles(execRoot string, excl []*command.InputExclusion, path string, fs map[string]*fileSysNode, cache filemetadata.Cache) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are you using the client here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I shouldn't - this was a bad rebasing.

@rubensf rubensf force-pushed the c-write-cup branch 4 times, most recently from 8256f1e to a3b47c1 Compare November 17, 2020 18:59
@google-cla
Copy link

google-cla bot commented Nov 17, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no The author needs to sign a CLA and removed cla: yes The author signed a CLA labels Nov 17, 2020
@rubensf
Copy link
Contributor Author

rubensf commented Nov 17, 2020

@googlebot I fixed it.

@google-cla google-cla bot added cla: yes The author signed a CLA and removed cla: no The author needs to sign a CLA labels Nov 17, 2020
@rubensf rubensf force-pushed the c-read-cup branch 2 times, most recently from 9f91be9 to abc1ab3 Compare November 24, 2020 16:30
Base automatically changed from c-read-cup to master November 24, 2020 16:40
This follows the current tentative API being worked on in
bazelbuild/remote-apis#168. While there's technically room for it to
change, it has reached a somewhat stable point worth implementing.
@@ -1377,3 +1387,14 @@ func (c *Client) DownloadFiles(ctx context.Context, execRoot string, outputs map
}
return nil
}

func (c *Client) shouldCompress(sizeBytes int64) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: If the function is not reused, maybe inline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll be reusing it on read compression :)

for _, blob := range tc.input {
input = append(input, uploadinfo.EntryFromBlob(blob))
}
for _, cmp := range []client.CompressedBytestreamThreshold{-1, 0} {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: add a []client.Opt field to tests and expand the tests to contain the cartesian product of these options in a loop before running them. The indentation is getting out of hand...
(I'll clean this up separately)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sgtm - if the indentation is the only problem you can also move the inner block into a separate function. Too late for it right now, but it is useful whereas in it preserves the original blame!

@rubensf rubensf merged commit d907a15 into master Nov 24, 2020
@rubensf rubensf deleted the c-write-cup branch November 24, 2020 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes The author signed a CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants