Add support for GCS deps

Also take out GCS calling logic from download_google_storage and
into call_google_storage.

GCS deps look like:
   'src/third_party/node/linux': {
       'dep_type': 'gcs',
       'condition': 'checkout_linux',
       'bucket': 'chromium-nodejs/20.11.0',
       'object_name': '46795170ff5df9831955f163f6966abde581c8af',
       'sha256sum': '887504c37404898ca41b896f448ee6d7fc24179d8fb6a4b79d028ab7e1b7153d',
   },

   'src/third_party/llvm-build/Release+Asserts': {
       'dep_type': 'gcs',
       'condition': 'checkout_linux',
       'bucket': 'chromium-browser-clang',
       'object_name': 'Linux_x64/clang-llvmorg-18-init-17730-gf670112a-2.tar.xz',
       'sha256sum': '1e46df9b4e63c074064d75646310cb76be2f19815997a8486987189d80f991e8',
   },

Example directory for src/third_party/node/linux after gclient sync:
- tar_file.gz is the downloaded file from GCS.
- node_linux_x64/ is extracted in its path.
- `hash` contains the sha of GCS filename.
```
chromium/src/ ->
   third_party/node/linux/ ->
       hash, tar_file.gz, node_linux_x64/
```

Bug: b/324418194
Change-Id: Ibcbbff27e211f194ddb8a08494af56570a84a12b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5299722
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
This commit is contained in:
Stephanie Kim
2024-02-29 19:18:32 +00:00
committed by LUCI CQ
parent 1ac3eb7b98
commit 3eedee7b55
12 changed files with 619 additions and 118 deletions

View File

@@ -1913,6 +1913,57 @@ class CipdWrapper(SCMWrapper):
"""
class GcsWrapper(SCMWrapper):
"""Wrapper for GCS.
Currently only supports content from Google Cloud Storage.
"""
name = 'gcs'
def __init__(self,
url=None,
root_dir=None,
relpath=None,
out_fh=None,
out_cb=None):
super(GcsWrapper, self).__init__(url=url,
root_dir=root_dir,
relpath=relpath,
out_fh=out_fh,
out_cb=out_cb)
#override
def GetCacheMirror(self):
return None
#override
def GetActualRemoteURL(self, options):
return None
#override
def DoesRemoteURLMatch(self, options):
del options
return True
def revert(self, options, args, file_list):
"""Does nothing."""
def diff(self, options, args, file_list):
"""GCS has no notion of diffing."""
def pack(self, options, args, file_list):
"""GCS has no notion of diffing."""
def revinfo(self, options, args, file_list):
"""Does nothing"""
def status(self, options, args, file_list):
pass
def update(self, options, args, file_list):
"""Does nothing."""
class CogWrapper(SCMWrapper):
"""Wrapper for Cog, all no-op."""
name = 'cog'