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

fixes #13479, 13483, 13504, 13508, 13509, 13524, 13505, 13550 - docker v2 - model/controller/routes/ui updates #5745

Merged
merged 8 commits into from
Feb 5, 2016

Conversation

bbuckingham
Copy link
Member

NOTE: This PR requires Pulp 2.8

This PR contains several commits containing initial changes support docker v2. Please see commit list for details.

With docker v2, the docker 'image' will no longer be needed; however, removal of it will be handled separately.

@bbuckingham bbuckingham changed the title fixes #13479 - docker v2 - add model for manifests and update model for tags fixes #13479, 13483 - docker v2 - model/controller/routes updates for manifests and tags Jan 31, 2016
image_counts = repositories.archived.docker_type.map do |repo|
repo.docker_manifests.count
end
image_counts.sum
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe replace image_counts with manifest_counts

@bbuckingham bbuckingham force-pushed the issue-13479 branch 4 times, most recently from f6a89ac to 054517d Compare February 2, 2016 14:24
@bbuckingham bbuckingham changed the title fixes #13479, 13483 - docker v2 - model/controller/routes updates for manifests and tags fixes #13479, 13483, 13504, 13508, 13509 - docker v2 - model/controller/routes/ui updates Feb 2, 2016
@bbuckingham
Copy link
Member Author

[test]

@bbuckingham bbuckingham changed the title fixes #13479, 13483, 13504, 13508, 13509 - docker v2 - model/controller/routes/ui updates fixes #13479, 13483, 13504, 13508, 13509, 13524 - docker v2 - model/controller/routes/ui updates Feb 2, 2016
@@ -4,7 +4,7 @@ module Repository
class CloneDockerContent < Actions::Base
def plan(source_repo, target_repo)
sequence do
plan_action(Pulp::Repository::CopyDockerImage,
plan_action(Pulp::Repository::CopyDockerManifest,
Copy link
Contributor

Choose a reason for hiding this comment

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

just confirming, copying manifests will copy blobs too?

Copy link
Member Author

Choose a reason for hiding this comment

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

@beav, good question! They are. I did check the output of the target repo after the copies completed to ensure that the counts for blob/manifest/tag match that of the source repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

🍹

@beav
Copy link
Contributor

beav commented Feb 2, 2016

@bbuckingham this looks good so far. I'm not clear on what index_db_docker_manifests does but it's just because I'm not familiar with that area of the code.

@bbuckingham
Copy link
Member Author

@beav, Thanks for the review and comments. Regarding index_db_docker_manifests, it is a method that is intended to retrieve the units (manifests & tags) from the repository and then create corresponding records in the Katello database. This is used to support searching for content. The logic for this indexing is similar to the units on other repository types; however, for docker it was modified to address the changes that have come with pulp 2.8 and docker v2 (i.e. manifest as new content unit and the movement of tag from metadata to an actual content unit).

@bbuckingham bbuckingham changed the title fixes #13479, 13483, 13504, 13508, 13509, 13524 - docker v2 - model/controller/routes/ui updates fixes #13479, 13483, 13504, 13508, 13509, 13524, 13505 - docker v2 - model/controller/routes/ui updates Feb 3, 2016
@bbuckingham bbuckingham changed the title fixes #13479, 13483, 13504, 13508, 13509, 13524, 13505 - docker v2 - model/controller/routes/ui updates fixes #13479, 13483, 13504, 13508, 13509, 13524, 13505, 13550 - docker v2 - model/controller/routes/ui updates Feb 4, 2016
@@ -31,7 +31,7 @@ def humanized_details

if content_started?(download_details)
if items_total(download_details) > 0
ret << (_("New images: %{count}.") % {:count => count_summary})
ret << (_("New manifests: %{count}.") % {:count => count_summary})
Copy link
Contributor

Choose a reason for hiding this comment

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

The pulp code appears to key the download count off of blobs instead of manifests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @beav! Updated to reference blobs.

@beav
Copy link
Contributor

beav commented Feb 4, 2016

My main concern is making sure the rake task runs OK since I'm not sure of the ordering of the DB migration and the migration rake tasks.

APJ aside from that, the blob vs manifest thing on sync status can be addressed as its own issue if needed.

@beav
Copy link
Contributor

beav commented Feb 5, 2016

Code changes look good, and tests are 💚!

ACK from me

add_foreign_key :katello_repository_docker_manifests, :katello_repositories,
:column => :repository_id

add_foreign_key :katello_docker_tags, :katello_docker_manifests,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the down portion also account for these added indices and foreign keys? Or would those be removed since they're associated with the affected tables?

Copy link
Member Author

Choose a reason for hiding this comment

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

@komidore64, the deletion of the tables appears to also drop the foreign keys and indexes associated with them.

@jlsherrill
Copy link
Member

As discussed on IRC, i'm not positive if this is handling the situation where pulp may either delete a tag or move it to a different manifest that I think may occur. example:

  • You sync a docker repo
  • Tag 'latest' is assigned to manifest A
  • Later you sync the docker repo again
  • Tag 'latest' is now assigned to manifest B

I believe pulp will either remove the old tag or 'move it' to the new manifest B. it looks like when we index we aren't handling this situation (assuming this actually is a situation).

I'm okay with it being handled as a followup PR (if it is indeed a problem). If so, please file an issue for it.

@beav
Copy link
Contributor

beav commented Feb 5, 2016

@jlsherrill that seems like a valid situation, like 'latest' may point to Fedora 79 and then Fedora 80 in six months.

I'll create a redmine for it to set up the test scenario with a local registry and see what happens.

@beav
Copy link
Contributor

beav commented Feb 5, 2016

@bbuckingham bbuckingham force-pushed the issue-13479 branch 2 times, most recently from 1bb6de6 to 895bec1 Compare February 5, 2016 16:43
@komidore64
Copy link
Contributor

ACK from me.

looks good. 👍 🍻

@jlsherrill
Copy link
Member

APJ for me

@beav
Copy link
Contributor

beav commented Feb 5, 2016

[test]

…or tags

This commit contains some initial changes to support the docker v2 model.

This includes the introduction of a new model (manifests) and modifications
to the existing docker tags model.

With docker v2, the docker image model will no longer be needed; however,
removal of it and any associations will be done separately from this commit.
…e for tags

This commit contains some initial changes to support the docker v2 api
controllers.

This includes the introduction of a new controller (manifests) and modifications
to the existing docker tags controller.

With docker v2, the docker image APIs will no longer be needed; however,
removal of them and any associations will be done separately from this commit.
…counts

Small change to replace image with manifest counts in the Content -> Product UI.
…fest counts

Small change to replace image with manifest counts in the Content -> Content Views UI.
This commit contains minor changes to support publishing and promoting
content views using Pulp 2.8 with Docker v2.
…t v2 Manifests

Update the UI to support manifests and remove images.
…ge Manifests

This commit contains changes to convert the current 'Manage Images' functionality
to support 'Manage Manifests' for docker v2.

This includes the UI, model and action changes.
This commit contains several changes related to removing docker v1
image support.  The changes are primarily to schema, model,
controllers...etc; however, it includes any image code that
remained after migrating katello to docker v2 (pulp2.8).
@beav
Copy link
Contributor

beav commented Feb 5, 2016

🏈 🏈 🏈 🏈

bbuckingham added a commit that referenced this pull request Feb 5, 2016
fixes #13479, 13483, 13504, 13508, 13509, 13524, 13505, 13550 - docker v2 - model/controller/routes/ui updates
@bbuckingham bbuckingham merged commit f8509ae into Katello:master Feb 5, 2016
@bbuckingham bbuckingham deleted the issue-13479 branch February 5, 2016 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants