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 configurable layers in manifest events #2639

Merged
merged 3 commits into from
Aug 28, 2018

Conversation

andrew-leung
Copy link
Contributor

Adds a configurable option to include layer info in manifest notification events. When we receive manifest notification events we often want to know which layers were accessed and/or compose the image. Rather than re-querying the registry, it is convenient to have that information in the manifest event itself.

With the change the default behavior of not including layer information in manifest events is not changed. An explicit configuration is needed to include the info.

@andrew-leung
Copy link
Contributor Author

Hi @dmcgowan , could you take a look please or refer the PR to who should take a look? Thanks!

request RequestRecord
sink Sink
ub URLBuilder
manfiestLayers bool

Choose a reason for hiding this comment

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

typo: s/manfiestLayers/manifestLayers/

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "manifesteventlayers" [email protected]:andrew-leung/distribution.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354382608
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@codecov
Copy link

codecov bot commented Jul 29, 2018

Codecov Report

Merging #2639 into master will decrease coverage by 9.87%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2639      +/-   ##
==========================================
- Coverage   61.03%   51.16%   -9.88%     
==========================================
  Files         132      129       -3     
  Lines       12122    11904     -218     
==========================================
- Hits         7399     6091    -1308     
- Misses       3803     5052    +1249     
+ Partials      920      761     -159
Impacted Files Coverage Δ
manifest/schema2/manifest.go 81.57% <ø> (-6.23%) ⬇️
configuration/configuration.go 68.33% <ø> (ø) ⬆️
notifications/bridge.go 74.1% <100%> (+0.71%) ⬆️
registry/handlers/app.go 47.71% <100%> (ø) ⬆️
registry/storage/driver/gcs/gcs.go 0.39% <0%> (-68.67%) ⬇️
registry/storage/driver/oss/oss.go 0.56% <0%> (-56.91%) ⬇️
registry/storage/driver/s3-goamz/s3.go 0.5% <0%> (-51.64%) ⬇️
registry/storage/driver/s3-aws/s3.go 4.15% <0%> (-50.98%) ⬇️
registry/client/transport/transport.go 69.69% <0%> (-9.1%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dae095...5e4b81a. Read the comment docs.

@andrew-leung
Copy link
Contributor Author

PTAL @dmp42 @dmcgowan @caervs, thanks!

@dmcgowan dmcgowan added this to the Registry/2.7 milestone Aug 17, 2018
Copy link
Contributor

@manishtomar manishtomar left a comment

Choose a reason for hiding this comment

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

This is great. I also have a need for this exact functionality. My only thought if it should be called References instead of Layers since that closely resembles the term used by registry. Also container config json returned by References() is not really a layer. Would live @dmcgowan opinion on this.

@dmcgowan
Copy link
Collaborator

@manishtomar I agree ManifestLayers/Layers -> References is more consistent with the terminology we are trying to use in the registry and especially any newly exposed interface.

@andrew-leung
Copy link
Contributor Author

@manishtomar @dmcgowan , good suggestion. I've updated the terminology to use References over Layers / ManifestLayers.

@andrew-leung
Copy link
Contributor Author

@manishtomar & @dmcgowan , please let me know if there is anything else needed prior to merging.

@dmcgowan
Copy link
Collaborator

LGTM

@manishtomar
Copy link
Contributor

@andrew-leung Sorry lost track of this. This looks good from my side. @dmcgowan @dmp42 Please take another look and if looks good please merge it.

Copy link
Contributor

@davidswu davidswu left a comment

Choose a reason for hiding this comment

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

lgtm

@dmcgowan dmcgowan merged commit b12bd40 into distribution:master Aug 28, 2018
@stevvooe
Copy link
Collaborator

stevvooe commented Sep 7, 2018

This change isn't great. It breaks the abstraction and pulls format specific items up to the event, which makes migration impossible. This will also making adding new formats much more challenging.

Applications that need this information should just pull the manifest to get the references.

Also, this should have incremented the version for the event mediatype.

In the future, let's make sure we've exhausted all client-side options before adding new, format-specific functionality to the registry.

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

Successfully merging this pull request may close these issues.

7 participants