Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Issue 2538203002: LogDog: Add signed GS URL fetching. (Closed)

Created:
4 years ago by dnj
Modified:
4 years ago
Reviewers:
Vadim Sh., estaab
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, maruel+w_chromium.org, tandrii+luci-go_chromium.org
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

LogDog: Add signed GS URL fetching. Allow a "Get" RPC request to additionally request a signed URL to the archive log entry stream, if available. To really support this, we restructure (for the better) the internal service API and the Coordinator test framework to enable fetching bound storage instances instead of the motley assortment of composite services that was previously implemented. BUG=chromium:669994 TEST=unit Committed: https://github.com/luci/luci-go/commit/2568e271f92ed046ea2c10318e90c2f53147eda1

Patch Set 1 #

Total comments: 15

Patch Set 2 : Allow index signing, use gaesigner. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1809 lines, -1354 lines) Patch
M logdog/api/endpoints/coordinator/logs/v1/logs.proto View 1 3 chunks +29 lines, -0 lines 1 comment Download
M logdog/api/endpoints/coordinator/logs/v1/logs.pb.go View 1 7 chunks +167 lines, -63 lines 0 comments Download
M logdog/api/endpoints/coordinator/logs/v1/pb.discovery.go View 1 1 chunk +1100 lines, -1051 lines 0 comments Download
M logdog/appengine/coordinator/coordinatorTest/context.go View 4 chunks +33 lines, -6 lines 0 comments Download
M logdog/appengine/coordinator/coordinatorTest/service.go View 4 chunks +11 lines, -31 lines 0 comments Download
A logdog/appengine/coordinator/coordinatorTest/storage.go View 1 1 chunk +145 lines, -0 lines 0 comments Download
D logdog/appengine/coordinator/coordinatorTest/storage_cache.go View 1 chunk +0 lines, -70 lines 0 comments Download
M logdog/appengine/coordinator/endpoints/logs/get.go View 1 5 chunks +55 lines, -67 lines 0 comments Download
M logdog/appengine/coordinator/endpoints/logs/get_test.go View 1 8 chunks +37 lines, -18 lines 0 comments Download
M logdog/appengine/coordinator/service.go View 1 7 chunks +204 lines, -14 lines 0 comments Download
M logdog/common/storage/archive/logdog_archive_test/main.go View 1 2 chunks +6 lines, -6 lines 0 comments Download
M logdog/common/storage/archive/storage.go View 5 chunks +11 lines, -17 lines 0 comments Download
M logdog/common/storage/archive/storage_test.go View 5 chunks +11 lines, -11 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
dnj
PTAL
4 years ago (2016-11-30 19:06:19 UTC) #2
Vadim Sh.
lgtm with nits https://codereview.chromium.org/2538203002/diff/1/logdog/api/endpoints/coordinator/logs/v1/logs.proto File logdog/api/endpoints/coordinator/logs/v1/logs.proto (right): https://codereview.chromium.org/2538203002/diff/1/logdog/api/endpoints/coordinator/logs/v1/logs.proto#newcode73 logdog/api/endpoints/coordinator/logs/v1/logs.proto:73: // The signed URL will have ...
4 years ago (2016-11-30 21:03:53 UTC) #3
Vadim Sh.
https://codereview.chromium.org/2538203002/diff/1/logdog/appengine/coordinator/service.go File logdog/appengine/coordinator/service.go (right): https://codereview.chromium.org/2538203002/diff/1/logdog/appengine/coordinator/service.go#newcode390 logdog/appengine/coordinator/service.go:390: acct, err := info.ServiceAccount(c) oh, btw this is RPC ...
4 years ago (2016-11-30 21:09:09 UTC) #4
dnj
Thanks! https://codereview.chromium.org/2538203002/diff/1/logdog/api/endpoints/coordinator/logs/v1/logs.proto File logdog/api/endpoints/coordinator/logs/v1/logs.proto (right): https://codereview.chromium.org/2538203002/diff/1/logdog/api/endpoints/coordinator/logs/v1/logs.proto#newcode73 logdog/api/endpoints/coordinator/logs/v1/logs.proto:73: // The signed URL will have an expiration ...
4 years ago (2016-12-01 17:39:31 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2538203002/20001
4 years ago (2016-12-01 17:57:06 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://github.com/luci/luci-go/commit/2568e271f92ed046ea2c10318e90c2f53147eda1
4 years ago (2016-12-01 18:03:53 UTC) #11
Vadim Sh.
4 years ago (2016-12-01 19:32:13 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/2538203002/diff/1/logdog/api/endpoints/coordi...
File logdog/api/endpoints/coordinator/logs/v1/logs.proto (right):

https://codereview.chromium.org/2538203002/diff/1/logdog/api/endpoints/coordi...
logdog/api/endpoints/coordinator/logs/v1/logs.proto:73: // The signed URL will
have an expiration that is <= the requested expiration.
On 2016/12/01 17:39:30, dnj wrote:
> On 2016/11/30 21:03:52, Vadim Sh. wrote:
> > you mean >=?
> 
> I mean <=, as in if you request 24 days and the server caps at 1 day, you'll
get
> 1 day.'
> 
> The expiration here is a duration, not a time, so it probably will always be <
> in practice b/c of delay.

Oh, I thought it would return an URL that lives at least
"sign_entry_url_lifetime" (and possibly more).

https://codereview.chromium.org/2538203002/diff/1/logdog/appengine/coordinato...
File logdog/appengine/coordinator/service.go (right):

https://codereview.chromium.org/2538203002/diff/1/logdog/appengine/coordinato...
logdog/appengine/coordinator/service.go:43: // maxSignedURLLifetime is the
maximum allowed signed URL lifetime.
On 2016/12/01 17:39:31, dnj wrote:
> On 2016/11/30 21:03:52, Vadim Sh. wrote:
> > mention this limit in *.proto doc too
> 
> I don't want to put constraints in the proto doc, as I consider this an
> implementation detail. The RPC returns the expiration, and the proto mentions
> that the return expiration will be <= the requested, so I think everything is
> covered.

1. The doc doesn't mention it anymore.
2. "<=" is very vague. A cap at 1 min is also <=, does it mean all callers
should expect very short-lived URLs? I think it is reasonable to mention that
lifetime is limited by 1 hour. Or as alternative set an expectation of what
callers should pass, e.g. "sign_entry_url_lifetime should usually be several
minutes or tens of minutes".

https://codereview.chromium.org/2538203002/diff/1/logdog/appengine/coordinato...
logdog/appengine/coordinator/service.go:417: if url, err =
gcst.SignedURL(gs.stream.Bucket(), gs.stream.Filename(), &opts); err != nil {
On 2016/12/01 17:39:31, dnj wrote:
> On 2016/11/30 21:03:52, Vadim Sh. wrote:
> > consider caching the result in the future. SignBytes is RPC to google
> backends,
> > it is relatively expensive (compared to memcache) and has a separate quota. 
> > 
> > e.g. if Logdog viewer switches to signed URLs exclusively, there'll be a LOT
> of
> > SignBytes requests.
> 
> This gets tricky, since the actual signed URLs have individual expiration
times
> associated with them.
That's why I assumed >= in sign_entry_url_lifetime doc: it makes sense if
coordinator reuses signed URLs.

https://codereview.chromium.org/2538203002/diff/20001/logdog/api/endpoints/co...
File logdog/api/endpoints/coordinator/logs/v1/logs.proto (right):

https://codereview.chromium.org/2538203002/diff/20001/logdog/api/endpoints/co...
logdog/api/endpoints/coordinator/logs/v1/logs.proto:136: //
"sign_entry_url_lifetime".
"sign_entry_url_lifetime" is no longer defined

Powered by Google App Engine
This is Rietveld 408576698