You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2019. It is now read-only.
Google has a need to support a new type of source for users who don't have their source in a Git repository, but instead may have source staged in Google Cloud Storage.
The simplest form is to specify a tar.gz file in GCS, which some client would upload before initiating the build/deployment, and which we'd fetch and untar during the build.
A slightly more complex form is to specify a "source manifest" file in GCS, which lists other individual objects in GCS, named after the file's SHA, and mapped to a location in the source context where that file should be downloaded to during the build.
For instance, a source manifest file might look like:
This indicates that two objects at gs://bucket/foo/bar/deadbeef and gs://bucket/foo/bar/facadecafe should be downloaded and placed at path/to/main.go and path/to/Dockerfile respectively. We'd also verify each object's SHA matches, during download.
The main benefit of source manifests is that they enable incremental source upload from the client, since objects are named by their hash, files with the same SHA may already uploaded from previous deployments. This is the basic mechanism that App Engine source uploads have used for many years, with no serious modifications or problems.
Here's a simple strawman of how to specify GCS source in the Build CRD (very open for discussion):
If gcs source is specified, the Build controller would prepend a step that specifies an image with code to fetch archives or manifests from GCS. We'll opensource the code for that fetcher image, and we'll document and opensource the spec for the source manifest file format.
If there are no concerns, we'd like to implement this as soon as this week. Please let me know if you have questions/concerns/ideas.
"named after the file's SHA" - this is not a requirement though I like your discussion as to why the JSON manifest format is useful (i.e., it allows renaming of GCS files to their correct source location - similarly, it can be used to collect resources from many GCS locations).
The sha1Sum in the manifest should be considered optional.
@squee1945 I think I may have misstated how manifest works. The sourceUrl is the full path to the object in GCS, which may be named after a hash of the object, but that's just an implementation detail.
In practice, "foo" and "bar" may be hashes of the file's contents, but they might not. The (optional) sha1Sum field is used to verify the expected contents of the object during download.
With that correction, I'm going to start phrasing this in terms of a PR, but this discussion remains open in the meantime.
@squee1945 Is there an image containing the fetcher code hosted somewhere public I can reference during testing? And longer-term, where/how should we opensource that codebase? In this repo? In another google-org repo? Happy to help with that however I can.
There is a "semi-public" version at gcr.io/gae-runtimes/fetcher:latest, feel free to use it for testing, but let's figure out something better for OSS publishing the source and the container.
Do we prefer to support a number of storage-specific domains (e.g. "gcs", "s3", "blob", etc), or focus on the transport types and assume some secret/external information is used for the fetch in a semi-agnostic manner (i.e. the same fetcher would work for google, amazon, azure, local swift, etc)? What about transports like NFS/glusterfs?
Another alternative is to ship a fetcher image as a sample, but not add a top-level construct for this sort of alternative storage packaging.
I lack confidence that we can do this in a vendor agnostic manner, but this may be my own naivete of other vendors. Perhaps we can shoot for this in v1beta1?
Another alternative is to ship a fetcher image as a sample, but not add a top-level construct for this sort of alternative storage packaging.
This sounds like what we have today: "go through custom:", the DevX for which was rejected for our happy path.
Re: vendor agnosticism: I think we should support GCS only as gcs, and if the format and protocol catches on and others want to support it for S3, or "blob" or whatever, we can add that case as another to-be-named source option. I don't want to generalize this to death until there's someone asking us to.
If we're happy with that approach, then I don't have any further arguments against it. It might be worth talking to some of the Kubernetes storage-sig participants or Eric Tune as to their experience with the volumes API.
Activity
mattmoor commentedon Mar 13, 2018
Very much like the existing git-init step for
gitsource.squee1945 commentedon Mar 13, 2018
"named after the file's SHA" - this is not a requirement though I like your discussion as to why the JSON manifest format is useful (i.e., it allows renaming of GCS files to their correct source location - similarly, it can be used to collect resources from many GCS locations).
The
sha1Sumin the manifest should be considered optional.Otherwise, this LGTM.
imjasonh commentedon Mar 13, 2018
@squee1945 I think I may have misstated how manifest works. The
sourceUrlis the full path to the object in GCS, which may be named after a hash of the object, but that's just an implementation detail.So the correct manifest file sample would be:
In practice, "foo" and "bar" may be hashes of the file's contents, but they might not. The (optional)
sha1Sumfield is used to verify the expected contents of the object during download.With that correction, I'm going to start phrasing this in terms of a PR, but this discussion remains open in the meantime.
mikehelmick commentedon Mar 13, 2018
@evankanderson - Please review this proposal
imjasonh commentedon Mar 13, 2018
@squee1945 Is there an image containing the fetcher code hosted somewhere public I can reference during testing? And longer-term, where/how should we opensource that codebase? In this repo? In another google-org repo? Happy to help with that however I can.
squee1945 commentedon Mar 13, 2018
There is a "semi-public" version at
gcr.io/gae-runtimes/fetcher:latest, feel free to use it for testing, but let's figure out something better for OSS publishing the source and the container.evankanderson commentedon Mar 13, 2018
Question:
Do we prefer to support a number of storage-specific domains (e.g. "gcs", "s3", "blob", etc), or focus on the transport types and assume some secret/external information is used for the fetch in a semi-agnostic manner (i.e. the same fetcher would work for google, amazon, azure, local swift, etc)? What about transports like NFS/glusterfs?
Another alternative is to ship a fetcher image as a sample, but not add a top-level construct for this sort of alternative storage packaging.
mattmoor commentedon Mar 13, 2018
I lack confidence that we can do this in a vendor agnostic manner, but this may be my own naivete of other vendors. Perhaps we can shoot for this in
v1beta1?This sounds like what we have today: "go through
custom:", the DevX for which was rejected for our happy path.imjasonh commentedon Mar 14, 2018
Re: vendor agnosticism: I think we should support GCS only as
gcs, and if the format and protocol catches on and others want to support it for S3, or "blob" or whatever, we can add that case as another to-be-namedsourceoption. I don't want to generalize this to death until there's someone asking us to.evankanderson commentedon Mar 14, 2018
If we decide to support vendor-specific extensions, I expect that the eventual API will look like this: https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes
If we're happy with that approach, then I don't have any further arguments against it. It might be worth talking to some of the Kubernetes storage-sig participants or Eric Tune as to their experience with the volumes API.