Skip to content

Commit

Permalink
Revert "Remove all example configs for deprecated registry"
Browse files Browse the repository at this point in the history
This reverts commit 2a28696.

Devstack still references a number of these files; revert until
devstack incorporates removal.

Change-Id: I1e90ceee1f87291668e447f180f37bb809763836
  • Loading branch information
ianw committed Feb 14, 2020
1 parent 2a28696 commit 0035ab2
Show file tree
Hide file tree
Showing 10 changed files with 2,039 additions and 15 deletions.
64 changes: 50 additions & 14 deletions doc/source/admin/controllingservers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ programs.
Starting a server
-----------------

There are two ways to start a Glance server:
There are two ways to start a Glance server (either the API server or the
registry server):

* Manually calling the server program

Expand Down Expand Up @@ -60,15 +61,16 @@ following directories, stopping at the first config file it finds:
* ``/etc``

The filename that is searched for depends on the server application name. So,
if you are starting up the API server, ``glance-api.conf`` is searched for.
if you are starting up the API server, ``glance-api.conf`` is searched for,
otherwise ``glance-registry.conf``.

If no configuration file is found, you will see an error, like::

$ glance-api
ERROR: Unable to locate any configuration file. Cannot load application glance-api

Here is an example showing how you can manually start the ``glance-api`` server
in a shell.::
and ``glance-registry`` in a shell.::

$ sudo glance-api --config-file glance-api.conf --debug &
jsuh@mc-ats1:~$ 2011-04-13 14:50:12 DEBUG [glance-api] ********************************************************************************
Expand All @@ -86,16 +88,46 @@ in a shell.::
2011-04-13 14:50:12 DEBUG [routes.middleware] Initialized with method overriding = True, and path info altering = True
2011-04-13 14:50:12 DEBUG [eventlet.wsgi.server] (21354) wsgi starting up on http://65.114.169.29:9292/

$ sudo glance-registry --config-file glance-registry.conf &
jsuh@mc-ats1:~$ 2011-04-13 14:51:16 INFO [sqlalchemy.engine.base.Engine.0x...feac] PRAGMA table_info("images")
2011-04-13 14:51:16 INFO [sqlalchemy.engine.base.Engine.0x...feac] ()
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Col ('cid', 'name', 'type', 'notnull', 'dflt_value', 'pk')
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (0, u'created_at', u'DATETIME', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (1, u'updated_at', u'DATETIME', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (2, u'deleted_at', u'DATETIME', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (3, u'deleted', u'BOOLEAN', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (4, u'id', u'INTEGER', 1, None, 1)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (5, u'name', u'VARCHAR(255)', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (6, u'disk_format', u'VARCHAR(20)', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (7, u'container_format', u'VARCHAR(20)', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (8, u'size', u'INTEGER', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (9, u'status', u'VARCHAR(30)', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (10, u'is_public', u'BOOLEAN', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (11, u'location', u'TEXT', 0, None, 0)
2011-04-13 14:51:16 INFO [sqlalchemy.engine.base.Engine.0x...feac] PRAGMA table_info("image_properties")
2011-04-13 14:51:16 INFO [sqlalchemy.engine.base.Engine.0x...feac] ()
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Col ('cid', 'name', 'type', 'notnull', 'dflt_value', 'pk')
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (0, u'created_at', u'DATETIME', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (1, u'updated_at', u'DATETIME', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (2, u'deleted_at', u'DATETIME', 0, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (3, u'deleted', u'BOOLEAN', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (4, u'id', u'INTEGER', 1, None, 1)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (5, u'image_id', u'INTEGER', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (6, u'key', u'VARCHAR(255)', 1, None, 0)
2011-04-13 14:51:16 DEBUG [sqlalchemy.engine.base.Engine.0x...feac] Row (7, u'value', u'TEXT', 0, None, 0)

$ ps aux | grep glance
root 20009 0.7 0.1 12744 9148 pts/1 S 12:47 0:00 /usr/bin/python /usr/bin/glance-api glance-api.conf --debug
root 20012 2.0 0.1 25188 13356 pts/1 S 12:47 0:00 /usr/bin/python /usr/bin/glance-registry glance-registry.conf
jsuh 20017 0.0 0.0 3368 744 pts/1 S+ 12:47 0:00 grep glance

Simply supply the configuration file as the parameter to the ``--config-file``
option (the ``etc/glance-api.conf`` sample configuration file was used in the
above example) and then any other options you want to use. (``--debug`` was
used above to show some of the debugging output that the server shows when
starting up. Call the server program with ``--help`` to see all available
options you can specify on the command line.)
option (the ``etc/glance-api.conf`` and ``etc/glance-registry.conf`` sample
configuration files were used in the above example) and then any other options
you want to use. (``--debug`` was used above to show some of the debugging
output that the server shows when starting up. Call the server program
with ``--help`` to see all available options you can specify on the
command line.)

For more information on configuring the server via the ``paste.deploy``
configuration files, see the section entitled
Expand Down Expand Up @@ -130,15 +162,19 @@ with ``glance-control`` in the following way::
You must use the ``sudo`` program to run ``glance-control`` currently, as the
pid files for the server programs are written to /var/run/glance/

Here is an example that shows how to start the ``glance-api`` server
Here is an example that shows how to start the ``glance-registry`` server
with the ``glance-control`` wrapper script. ::


$ sudo glance-control api start glance-api.conf
Starting glance-api with /home/jsuh/glance.conf

$ sudo glance-control registry start glance-registry.conf
Starting glance-registry with /home/jsuh/glance.conf

$ ps aux | grep glance
root 20038 4.0 0.1 12728 9116 ? Ss 12:51 0:00 /usr/bin/python /usr/bin/glance-api /home/jsuh/glance-api.conf
root 20039 6.0 0.1 25188 13356 ? Ss 12:51 0:00 /usr/bin/python /usr/bin/glance-registry /home/jsuh/glance-registry.conf
jsuh 20042 0.0 0.0 3368 744 pts/1 S+ 12:51 0:00 grep glance


Expand Down Expand Up @@ -182,18 +218,18 @@ use the ``glance-control`` program to stop it. Simply do the following::

as this example shows::

$ sudo glance-control api stop
Stopping glance-api pid: 17602 signal: 15
$ sudo glance-control registry stop
Stopping glance-registry pid: 17602 signal: 15

Restarting a server
-------------------

You can restart a server with the ``glance-control`` program, as demonstrated
here::

$ sudo glance-control api restart etc/glance-api.conf
Stopping glance-api pid: 17611 signal: 15
Starting glance-api with /home/jpipes/repos/glance/trunk/etc/glance-api.conf
$ sudo glance-control registry restart etc/glance-registry.conf
Stopping glance-registry pid: 17611 signal: 15
Starting glance-registry with /home/jpipes/repos/glance/trunk/etc/glance-registry.conf

Reloading a server
------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/cli/glancemanage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ following order:
* ``/etc``

All options set in ``glance-manage.conf`` override those set in
``glance-api.conf``.
``glance-registry.conf`` and ``glance-api.conf``.
40 changes: 40 additions & 0 deletions doc/source/cli/glanceregistry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
===============
glance-registry
===============

--------------------------------------
Server for the Glance Registry Service
--------------------------------------

.. include:: header.txt

.. include:: ../deprecate-registry.inc


SYNOPSIS
========

::

glance-registry [options]

DESCRIPTION
===========

glance-registry is a server daemon that serves image metadata through a
REST-like API.

OPTIONS
=======

**General options**

.. include:: general_options.txt

FILES
=====

**/etc/glance/glance-registry.conf**
Default configuration file for Glance Registry

.. include:: footer.txt
4 changes: 4 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
'_static/glance-cache'),
('../../etc/oslo-config-generator/glance-manage.conf',
'_static/glance-manage'),
('../../etc/oslo-config-generator/glance-registry.conf',
'_static/glance-registry'),
('../../etc/oslo-config-generator/glance-scrubber.conf',
'_static/glance-scrubber'),
]
Expand Down Expand Up @@ -161,6 +163,8 @@
[u'OpenStack'], 1),
('cli/glancemanage', 'glance-manage', u'Glance Management Utility',
[u'OpenStack'], 1),
('cli/glanceregistry', 'glance-registry', u'Glance Registry Server',
[u'OpenStack'], 1),
('cli/glancereplicator', 'glance-replicator', u'Glance Replicator',
[u'OpenStack'], 1),
('cli/glancescrubber', 'glance-scrubber', u'Glance Scrubber Service',
Expand Down
13 changes: 13 additions & 0 deletions doc/source/configuration/glance_registry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _glance-registry.conf:

--------------------
glance-registry.conf
--------------------

.. include:: ../deprecate-registry.inc

This configuration file controls how the register server operates. More
information can be found in :ref:`configuring-the-glance-registry`.

.. show-options::
:config-file: etc/oslo-config-generator/glance-registry.conf
9 changes: 9 additions & 0 deletions doc/source/configuration/sample-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ This sample configuration can also be viewed in `glance-api.conf.sample
.. literalinclude:: ../_static/glance-api.conf.sample


Sample configuration for Glance Registry
----------------------------------------

This sample configuration can also be viewed in `glance-registry.conf.sample
<../_static/glance-registry.conf.sample>`_.

.. literalinclude:: ../_static/glance-registry.conf.sample


Sample configuration for Glance Scrubber
----------------------------------------

Expand Down
35 changes: 35 additions & 0 deletions etc/glance-registry-paste.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use this pipeline for no auth - DEFAULT
[pipeline:glance-registry]
pipeline = healthcheck osprofiler unauthenticated-context registryapp

# Use this pipeline for keystone auth
[pipeline:glance-registry-keystone]
pipeline = healthcheck osprofiler authtoken context registryapp

# Use this pipeline for authZ only. This means that the registry will treat a
# user as authenticated without making requests to keystone to reauthenticate
# the user.
[pipeline:glance-registry-trusted-auth]
pipeline = healthcheck osprofiler context registryapp

[app:registryapp]
paste.app_factory = glance.registry.api:API.factory

[filter:healthcheck]
paste.filter_factory = oslo_middleware:Healthcheck.factory
backends = disable_by_file
disable_by_file_path = /etc/glance/healthcheck_disable

[filter:context]
paste.filter_factory = glance.api.middleware.context:ContextMiddleware.factory

[filter:unauthenticated-context]
paste.filter_factory = glance.api.middleware.context:UnauthenticatedContextMiddleware.factory

[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory

[filter:osprofiler]
paste.filter_factory = osprofiler.web:WsgiMiddleware.factory
hmac_keys = SECRET_KEY #DEPRECATED
enabled = yes #DEPRECATED
Loading

0 comments on commit 0035ab2

Please sign in to comment.