这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@michaelshobbs
Copy link
Member

as with most "simple" things, this was not as straightforward as we've been fairly lax about how $IMAGE is set.

  • add tag plugin, documentation & tests
    • tag:add
    • tag:deploy
    • tag:list
    • tag:rm
  • consolidate setting $IMAGE to verify_app_name()
  • extend verify_app_name() to accept $TAG (image tag)
  • created get_running_image_tag()
  • consolidate release/deploy calls to release_and_deploy()
  • add $TAG to appropriate pluginhook calls
    • pre-deploy
    • docker-args-deploy
    • docker-args-run
    • pre-release
    • pre-release-buildstep
    • pre-release-dockerfile
    • post-release
    • post-release-buildstep
    • post-release-dockerfile
  • make apps:destroy container/image cleanup more robust (read: actually destroy an app and all its artifcats)

@josegonzalez
Copy link
Member

Do images get tagged on deploy atm? Would be nice to do that automatically - heroku-style at least, could be optional.

@michaelshobbs
Copy link
Member Author

Tagging is not automatic at the moment. I wanted to provide the method to do it first before automating it.

I am also not sure what makes sense as far as naming and retention. Automatic tagging could definitely eat up disk space quickly.

@josegonzalez
Copy link
Member

Ah in that you'd have things to rollback to etc.

Are there new pluginhooks for when an image is tagged?

@michaelshobbs
Copy link
Member Author

No new pluginhooks here

@josegonzalez
Copy link
Member

GIVE ME PLUGINHOOKS

@josegonzalez
Copy link
Member

plz

@michaelshobbs
Copy link
Member Author

Can you be more specific about what functionality you'd like? Example use-case?

@josegonzalez
Copy link
Member

I'd like to be able to:

  • push a tag after it has been created to a docker hub
  • remove tags from docker hub if they have been removed on a server

Basically it.

@michaelshobbs
Copy link
Member Author

Done.

@michaelshobbs
Copy link
Member Author

@josegonzalez thoughts on where to communicate to plugin devs that they need to get the image name + tag from get_running_image_tag() when developing non *-build plugins that require the image name?

@josegonzalez
Copy link
Member

Uh what? I'm not sure I understand your question.

@michaelshobbs
Copy link
Member Author

Yeah sorry I was poorly multi-tasking when I wrote that.

This PR exposes to the user control over the $IMAGE variable that was previously hard-coded (in multiple places) to dokku/$APP. Currently plugins that need to modify the app image also hard-code this variable. This practice will need to change for those plugins in order to modify the correct image when tags are in use. So my question is, how should we communicate this change in behavior?

Does that make more sense?

@josegonzalez
Copy link
Member

That sounds like a breaking change, and we should make a 0.4.0 release to handle it imo.

@michaelshobbs
Copy link
Member Author

Totally agree with you there. We should probably call it out in the release notes for 0.4.0 and update the plugin dev docs to call it out specifically. I'll do the latter now and update this PR.

@josegonzalez
Copy link
Member

Anything else we want to do for 0.4.0? We may as well do that now-ish.

@michaelshobbs
Copy link
Member Author

what about buildkit and plugn?

https://github.com/progrium/dokku/wiki/Refactoring

@michaelshobbs
Copy link
Member Author

@josegonzalez this needs another code review pass given its age

Copy link
Member

Choose a reason for hiding this comment

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

Do all our built-in hooks follow this pattern?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just ones that use an image but depending on your thoughts on how $IMAGE is set we can revert this and make a new function call to get the app image name and tag.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I'd rather it be clear as to how variables are set than placing magic in random places like this ;)

dokku Outdated
Copy link
Member

Choose a reason for hiding this comment

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

The output after this is duplicated in release_and_deploy I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

@michaelshobbs $ make you holler! 💸

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

points! well played

Copy link
Member

Choose a reason for hiding this comment

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

Should this go in the deployment doc instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. moving.

josegonzalez added a commit that referenced this pull request Sep 4, 2015
allow tagging and deployment of tagged app images
@josegonzalez josegonzalez merged commit 0904c3d into master Sep 4, 2015
@josegonzalez josegonzalez deleted the mh-image-tagging branch September 4, 2015 02:22
@josegonzalez
Copy link
Member

Image tagging == crushed.

@josegonzalez
Copy link
Member

@michaelshobbs A few questions now that I'm using this (ffs I should have tested this before):

  • Why are we using $IMAGE_REPO:$IMAGE_TAG as the format for a tag?
  • Is it possible to override the $IMAGE_REPO prefix? For instance, quay.io requires that you specify your tag prefix as quay.io/username/repository.
  • What happens if we have an app with multiple containers (web, worker, cron)? Which one gets tagged? Can we specify a container type to get tagged?

@michaelshobbs
Copy link
Member Author

To close the loop here

  • $IMAGE_REPO:$IMAGE_TAG is the string used to reference an image
  • $IMAGE_REPO is hardcoded to be dokku/$APP
  • containers != images

If you want to push to a docker registry then use a plugin that implements the tags-create/tags-destroy trigger as in the documentation example. http://progrium.viewdocs.io/dokku/development/pluginhooks/#user-content-tags-create

@josegonzalez
Copy link
Member

To setup a mobius loop:

  • I am not a smart man and didn't realize how tags work...
  • I'll be creating a quay.io plugin integration for dokku (pushing/pulling image tags and deploying them to applications).

Thanks @michaelshobbs for setting me straight :)

@josegonzalez josegonzalez changed the title allow tagging and deployment of tagged app images Allow tags plugin to handle image tagging and deployment of tagged app images Sep 15, 2015
@josegonzalez josegonzalez changed the title Allow tags plugin to handle image tagging and deployment of tagged app images Add tags plugin to handle image tagging and deployment of tagged app images Sep 19, 2015
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.

4 participants