Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Pluggable architecture #353

Merged
merged 102 commits into from
May 20, 2014
Merged

Pluggable architecture #353

merged 102 commits into from
May 20, 2014

Conversation

dmp42
Copy link
Contributor

@dmp42 dmp42 commented May 12, 2014

This is not to be merged right now.

It's an overview (and a call for comments) of the new plugin architecture.

A few facts:

  • right now, the plugins are expressed as git submodules in the depends subfolder, and the git repos are under my nick
  • the idea is to use namespaces - unfortunately, using docker_registry as a ns turned out to be more difficult than expected - hence the (slight) delay on this PR
  • docker-registry-core (https://github.com/dmp42/docker-registry-core) is to contain (few) common utilities that are of interest to plugins and registry, its purpose being to minimize the work for plugins developers and to let us express our storage API and centrally update tests
  • docker-registry-driver-file (https://github.com/dmp42/docker-registry-driver-file) (and swift) are first expressions of these new plugins
  • these are not used yet in docker_registry and generally its broken and unusable

What I would love to have for now is opinions:

  • take a look into core: are you happy with what is there?
  • take a look into a driver (say: file): are you happy with the way it's done?
  • are we ok with git submodules? or do we prefer straight folders in the main repo?
  • any other remarks about the architecture

I'll push more commit as soon as I'm building successfully again.

cc @samalba @shin-

@dmp42
Copy link
Contributor Author

dmp42 commented May 12, 2014

@@ -1,66 +1,7 @@
# -*- coding: utf-8 -*-
# flake8: noqa
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes in init here are meant for the namespace to be used - thus, this have been moved to the run file below.

@dmp42
Copy link
Contributor Author

dmp42 commented May 15, 2014

We are almost there.

  • Elliptics and swift have been adopted externally now (the packages are squeaky clean, including travis int., running tests and pip readyness)
  • we still have boto inside core, and file and s3 as bundled drivers in registry itself.
  • we are now testing against python26 as well, and the tests pass (there is a number of fellows running 2.6 apparently)
  • we now support coverage threshold (40%) that breaks the build
  • the build is back green on travis
  • build time on travis dropped from 10 minutes to 3
  • the behavior on remove and dir_list have been largely harmonized (when the dir is empty, or doesn't exists)
  • we are now using nose for tests and coverage
  • we support a simpler call for the tests through python setup.py nosetests

Still todo for tomorrow, before we can merge:

  • fix up gcs and glance so that tests pass
  • plug the unicode patch and unicode breaking tests
  • merge config through env vars #350
  • update the documentation

Mangled Deutz added 5 commits May 19, 2014 16:20
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
@samalba
Copy link
Contributor

samalba commented May 19, 2014

LGTM

@dmp42
Copy link
Contributor Author

dmp42 commented May 19, 2014

Ok. We are trying staging right now.

Mangled Deutz added 3 commits May 19, 2014 18:13
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
@dmp42
Copy link
Contributor Author

dmp42 commented May 20, 2014

@shin- ok for you?

self._config = config
self._root_path = self._config.storage_path
self._root_path = config.get('storage_path', '/test')
# logger.info("WHATDFUCK %s" % self._root_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
@@ -0,0 +1,35 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if this slipped through or if it was intentionally put in. Don't think we want editor-related files in the repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, let's remove it.

Mangled Deutz added 3 commits May 20, 2014 15:08
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
@dmp42 dmp42 added this to the 0.7 milestone May 20, 2014
@shin-
Copy link
Contributor

shin- commented May 20, 2014

lgtm!

@dmp42
Copy link
Contributor Author

dmp42 commented May 20, 2014

Let's drop young, then.

dmp42 added a commit that referenced this pull request May 20, 2014
@dmp42 dmp42 merged commit f105885 into master May 20, 2014
@dmp42 dmp42 deleted the plugins branch May 20, 2014 13:24
@paulczar
Copy link

This breaks the nova-docker driver from easily using the registry with a glance backend.

'Traceback (most recent call last):
  File "/usr/local/bin/docker-registry", line 9, in <module>
    load_entry_point('docker-registry==0.7.0', 'console_scripts', 'docker-registry')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/run.py", line 16, in <module>
    from .tags import *  # noqa
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/tags.py", line 21, in <module>
    store = storage.load()
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/storage/__init__.py", line 36, in load
    _storage[kind] = engine.fetch(kind)(None, config=cfg)
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/core/driver.py", line 241, in fetch
    % (name, name, available())
docker_registry.core.exceptions.NotImplementedError: You requested storage driver docker_registry.drivers.glance
which is not installed. Try `pip install docker_registry-drivers-glance`
or check your configuration. The following are currently
available on your system: ['dumb', 'file', 's3']

it would be good for the default Dockerfile in the repo to include the glance and swift storage drivers.

@dmp42
Copy link
Contributor Author

dmp42 commented May 20, 2014

@paulczar:

Glance is work in progress and will get fixed before the release.

Any help in setting up glance for tests is welcome in https://github.com/dmp42/docker-registry-driver-glance/blob/master/.travis.yml

About wether to (re)include swift and glance as a default, this is not my call to make, but the whole idea is to make it as simple as pip install docker-registry-driver-glance to have an additional driver.

@shin-
Copy link
Contributor

shin- commented May 20, 2014

Would releasing a nova-registry image with glance and swift baked in be a viable solution?

@dmp42
Copy link
Contributor Author

dmp42 commented May 20, 2014

@shin- the docker-registry-driver-glance repo can easily provide a Dockerfile as well extending the registry image with glance crammed in (makes sense to maintain it there?).

@paulczar
Copy link

@shin- @dmp42 that sounds like a good viable option ... would be good to get a trusted build out of in the root namespace on index.docker.io

@wking wking mentioned this pull request May 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants