172 Commits

Author SHA1 Message Date
Radosław Piliszek
be26306b4a Support extras in Glance Store install
Recent change to devstack dropped installing test-requirements [1]
However, this caused gate failures due to lack of glance-store
deps for cinder and swift support.

This patch makes devstack install relevant extras depending on
enabled features.

Additionally, relevant functions are added/fixed to make this
possible.

glance-store = glance_store (for gerrit search match)

[1] https://review.opendev.org/715469

Change-Id: I0bf5792a6058b52936115b515ea8360f6264a7c9
2020-03-30 19:53:32 +02:00
Abhishek Kekane
6f91da9a2d Glance: Add support to configure multiple file stores
From Train release Glance has added support [0][1] to configure multiple stores
of same or different types. This patch enables developers to configure
multiple file stores for glance. In order to configure multiple file stores
user need to set below options in local.conf

GLANCE_ENABLE_MULTIPLE_STORES=True/False
To enable multiple stores of glance.

GLANCE_MULTIPLE_FILE_STORES=veryfast,fast,cheap,verycheap,slow,veryslow
Comma separated list of store identifiers.

GLANCE_DEFAULT_BACKEND=fast
Default glance store in which image should be stored if store identifier not
specified explicilty. Should be one of the store identifier from
GLANCE_MULTIPLE_FILE_STORES config option.

NOTE: This support is added so that we can start adding tempest/CI tests for
glance multiple stores.

[0] 515412b59f5b3af07a1787b9f8e85a4d656d3e1c
[1] https://docs.openstack.org/glance/train/admin/multistores.html

Change-Id: I494f77555cfe9115356ce0ee75c7d7f192141447
2020-02-26 10:34:47 +00:00
Radosław Piliszek
09e860fc2c Run Glance initialization when Glance is enabled, not just registry (v2)
Per [1] Glance registry should not be required to run since Queens.

v2 improves on v1 [2] (now reverted [3]) by applying minor comments
from reviews so far and ensuring nova-live-migration job does not see
a change in behavior and hence does not break [4].
[5] tried to fix the issue but it did only partially, regarding
the database but not the image upload [6].
This patch ensures double cirros image upload does not happen as well.

[1] https://specs.openstack.org/openstack/glance-specs/specs/queens/approved/glance/deprecate-registry.html
[2] https://review.opendev.org/702707
[3] https://review.opendev.org/703131
[4] https://bugs.launchpad.net/devstack/+bug/1860021
[5] https://review.opendev.org/702960
[6] https://bugs.launchpad.net/devstack/+bug/1860021/comments/16

Change-Id: I61538acd6bd4c7b3da26c4084225b220d7d1aa2c
Closes-bug: #1859847
Related-bug: #1860021
2020-01-22 13:43:06 +00:00
Radosław Piliszek
ec3543a028 Init Glance database only on the node with the database backend
Since [1] Glance init depends on either g-api or g-reg being
enabled.
This broke multinode g-api deployments with singlenode database
backend.
This commit aligns Glance with other services w.r.t when to
apply database init.

[1] d8dec362baa2bf7f6ffe1c47352fdbe032eaf20a

Change-Id: Idc07764d6ba3a828f19691f56c73cbe9179c2673
Closes-bug: #1860021
2020-01-16 19:58:37 +01:00
Zane Bitter
0e02e7fd55 Don't install glance default policy
With Glance defining default policies in code, it's no longer necessary
to install policy.json from the repo.

Change-Id: I9f9160f5a2bf9fd77fb3807e12de219b7a49952d
Depends-On: https://review.opendev.org/693129
2019-11-14 14:01:27 -05:00
Dirk Mueller
8ab64b3236 Drop signing_dir option from configure_auth_token_middleware
This is no longer being used due to Keystone PKI tokens no longer
being implemented.

In order to not break backward compatibility we create a new function
that is to be used instead and deprecate the old one. Modify the old
function to ignore the 3rd argument and display a deprecation warning.
Adjust callers to no longer create and set that directory, calling the
new function instead.

Change-Id: Id0dec1ba72467cce5cacfcfdb2bc0af2bd3a3610
2019-06-28 16:28:03 +00:00
ZhongShengping
5fe60c1a34 Option "lock_path" from group "DEFAULT" is deprecated
Option "lock_path" from group "DEFAULT" is deprecated. Use option
"lock_path" from group "oslo_concurrency".

Change-Id: I7c7501a4a351155eeba77bb7cd43c8d6f5ea73bc
2019-04-30 10:13:27 +08:00
Zuul
59206372ee Merge "Change config-file to config-dir for g-api start" 2019-02-14 11:23:25 +00:00
Brian Rosmaita
b43810a366 Glance should not reference Cinder v1
Cinder v1 was removed over a year ago.  Change the cinder template
URLs devstack defines in the glance-api.conf to use cinder v3
instead.

Change-Id: I4a68dc0b53631be0708e7411c37619dd6dfd4fa6
2019-02-07 16:46:49 -05:00
Brian Rosmaita
96269d8e75 Change config-file to config-dir for g-api start
The glance-api service may use multiple config files, so
tell oslo.config about the config dir instead of a specific
config file when the service is started.

Change-Id: Iad3602d209cbb31e10683c67e1fd6b465d19f560
Partial-bug: #1805765
2019-01-28 09:19:45 -05:00
Zuul
5da7e4a22e Merge "Fix running with SERVICE_IP_VERSION=6" 2018-07-10 06:10:28 +00:00
Matt Riedemann
0f4af398a9 Set workers=$API_WORKERS in glance-registry.conf
We use $API_WORKERS to throttle the number of workers
in other services but were not doing it for g-reg for
some reason, which by default will run ncpu workers
up to a limit of 8.

Change-Id: Idc81ce05546e6d625c10e2229256eafbe7c057a5
Closes-Bug: #1774781
2018-06-02 09:34:20 -04:00
Zuul
24fa317234 Merge "Clean up Glance config files" 2018-04-24 15:13:37 +00:00
Jens Harbott
dc7b429463 Fix running with SERVICE_IP_VERSION=6
- There are some locations where we need the raw IPv6 address instead of the
  url-quoted version enclosed in brackets.
- Make nova-api-metadata service listen on IPv6 when we need that.
- Use SERVICE_HOST instead of HOST_IP for TLS_IP.

Change-Id: Id074be38ee95754e88b7219de7d9beb06f796fad
Partial-Bug: 1656329
2018-03-11 08:53:41 +00:00
bhagyashris
6a25fb96c1 Initialize newly added glance-image-import config file
This patch creates a new config file glance-image-import.conf
at /etc/glance path. Also, each config option is initialized
with default values.

Need these changes to implement specs [1]:

[1]: https://blueprints.launchpad.net/glance/+spec/inject-automatic-metadata

Related-Change-Id: If14c7dc4f38360006f9cb350fbba54fa2f33be61
Change-Id: I665507db1838a50e344d3be909d7490f1f52040c
2017-12-21 09:33:55 +05:30
Brian Rosmaita
44a19b4fdc Clean up Glance config files
The current Glance config files are a combination of copied and
generated files.  This patch makes all the files generated and
removes now unnecssary ini(un)comment statements.  It additionally
removes some ini(un)comment statements that weren't having any
effect on the previously generated files.

Change-Id: I6e4b7694e8bebb7fe6661ead034ee257c768e342
2017-12-11 18:18:04 -05:00
Clark Boylan
56131eb11f Move glance auth cache creation to configure_glance
We install the glance api on all nodes in multinode testing. This has
been failing because we don't configure the glance auth cache dirs if
we only install the glance api service. This was done as part of
init_glance which is only run when installing g-reg.

Fix this by moving the auth cache dir creation step into
configure_glance which is run for the glance api.

Change-Id: Ie669827507df0f524e6e53fe4ab3dff848dd4bd7
2017-10-04 16:06:27 -07:00
Ian Wienand
1f82f43016 Revert "Remove cache dirs from the services"
This reverts commit ef5ebed6c9ca3d9d47fd2a732a1542555a0f65ba.

The problem here is a backwards-incompatible change to
configure_auth_token_middleware.  Plugins are still passing a
"signing_dir" which is interpreted now as the "section" argument
... this leads to an interesting red-herring issue; because "v" is a
gnu sed command for checking the version, a signing_dir of "/var/..."
(as done in most plugins) gives the weird error:

 sed: -e expression #1, char 32: expected newer version of sed

I think we'll either need a new function, or dummy arguments to get
this back in.

Change-Id: I2098d4eb2747282622cf486fa7dbf216f932f58b
2017-10-04 09:54:43 +11:00
Jamie Lennox
ef5ebed6c9 Remove cache dirs from the services
PKI tokens have been actively deprecated from keystone and there are
deprecations being emitted from keystonemiddleware. Because of this we
no longer need an auth cache directory in the services where the PKI
certifcates used to be stored.

Remove the creation and use of all these AUTH_CACHE directories.

Change-Id: I5680376e70e74882e9fdb87ee1b95d5f40570ad7
2017-09-26 10:10:11 +10:00
Jenkins
86bdfffbe0 Merge "clean up screen and tail_log references" 2017-09-19 13:23:02 +00:00
Sean Dague
0eebeb415a clean up screen and tail_log references
Change-Id: I6bcfa09931ed1f70e071ccb16688c15c7ef2898f
2017-09-01 15:08:17 -04:00
Davanum Srinivas
aceb27e858 Add procname for uwsgi based services
Code in grenade and elsewhere rely on the process/service name
when one runs "ps auxw" and they grep for example "grep -e glance-api"
to check if the service is running. with uwsgi, let us make sure
we use process name prefix so it is easier to spot the services
and be compatible with code elsewhere that relies on this.

Change-Id: I4d1cd223ed9904fcb19b26fc9362b676e0b4f9b3
2017-08-17 10:33:14 -04:00
Jeremy Liu
2f7df51cfa Correct 'uswgi' to 'uwsgi'
Change-Id: I22026e5640a626f45b7508b60f492dbdb30631af
2017-07-12 10:09:48 +08:00
Matthew Treinish
1fa6536357 Revert "Revert "Use uwsgi for glance-api""
This reverts commit 3410e3e01bdbdbfd360d9baebeac081c33ee0821.

Change-Id: Ic58711311eb8534cb3c4b25c333197c412ffdce5
2017-06-23 22:32:37 +00:00
Ian Wienand
3410e3e01b Revert "Use uwsgi for glance-api"
This reverts commit e6217a9719b88b550ccbbce7c9bc064cb746c1a3.

Unfortunately it seems to break glance; for examples see some of the
nodepool dib jobs which have all failed to upload images into glance.

Note this has a revert for 43304849cfde41fa86a6fdd334ab6e703598ef8d as
well, since that uses GLANCE_URL defined here.

[1] http://logs.openstack.org/51/475051/2/gate/gate-dsvm-nodepool-redhat-src/e1bdb34/
[2] http://logs.openstack.org/51/475051/2/gate/gate-dsvm-nodepool-ubuntu-src/6a7665b/
[3] http://logs.openstack.org/51/475051/2/gate/gate-dsvm-nodepool-opensuse-src/b357de1/

Change-Id: I2aea120e733b05e806801121ec994f4e31a337d9
2017-06-22 13:48:06 +10:00
Monty Taylor
43304849cf
Set public_endpoint to GLANCE_URL for glance-api
We run glance behind uwsgi. This means that the URL glance knows about
itself is wrong, and version discovery fails. Set the public endpoint to
the value of GLANCE_URL which should always be correct.

Change-Id: Ia7c69024a0ef6cc0fdc284ffcd06eee5678a1007
2017-06-21 21:45:14 +01:00
Jenkins
7fef90aff9 Merge "Use uwsgi for glance-api" 2017-06-21 08:34:52 +00:00
Clark Boylan
633dbc3d8e Track db sync command time useage
We are trying to keep better track of what pieces of devstack consume
the most time. Add the db sync commands to the time tracking as they run
the database migrations which can take more time than expected.

Change-Id: Ib92f2b8304ccf703712d45fd7207444de3599e2d
2017-06-14 12:09:21 -07:00
Clark Boylan
902158bb8f Don't treat service as enabled if in disabled list
The old implementation for is_$service_enabled simply checked if any of
the subservices were enabled and if so the service was considered to be
enabled. This makes disabling services complicated as it means you have
to list every single subservice which can and do change over time.

Instead also check if the generic service name is in the disabled
services list and if so don't treat the service as enabled.

Change-Id: I7fe4dfca2cd9c15069d50a04161a29c5638291cb
2017-06-07 17:23:38 +00:00
Matthew Treinish
e6217a9719 Use uwsgi for glance-api
This commit adds support for deploying glance as a wsgi script under
uwsgi. To get around limitations in the uwsgi protocol when using
python3 for chunked encoding we have to setup uwsgi in http mode on a
random port listening on localhost and use mod_proxy to forward the
incoming requests. The alternative approach of having apache buffer the
requests locally with the send_cl option with mod_proxy_uwsgi only
worked on python2 and also has the limitation that apache is buffering
the entire chunked object, which could be several gigabytes in size.

Depends-On: I089a22a4be4227a551c32442dba27c426f54c87d
Change-Id: Ie98fb7da5e8ecfa49cd680b88139cb7034d5f88f
2017-05-28 14:36:36 +00:00
Sean Dague
c13b8a1f33 try to use unversioned keystone endpoints everywhere
Change-Id: Iad2a3654d8ba181a7ad452d8aba872a8313d4ece
2017-05-01 09:12:20 -04:00
Matthew Treinish
fa898f5174 Add external lock dir to glance api config
As we move to enabling glance-api to use a wsgi script that might be run
as multiple processes, there are a couple places where external
synchronization is necessary. To use this we need to set the lock_path
config option from oslo.concurrency so external locks will work.

Change-Id: I9a66a8636d12037ff9aa4fb73cc3f9b9343dd7e9
2017-04-28 10:29:38 -04:00
Sean Dague
f3b2f4c853 Remove USE_SSL support
tls-proxy is the way we're now doing a standard install using https
between services. There is a lot more work to make services directly
handle https, and having python daemons do that directly is a bit of
an anti pattern. Nothing currently tests this in project-config from
my recent grepping, so in the interest of long term maintenance,
delete it all.

Change-Id: I910df4ceab6f24f3d9c484e0433c93b06f17d6e1
2017-04-17 07:27:32 -04:00
wangxiyuan
b763dbda73 Remove glare from glance
glare has been removed from glance already. Now error will be raised
if enable g-glare in local.conf.

Remove the glare support by glance.

Change-Id: I9a389af194dd2b8aed75d3c921293d800f8c591b
2017-03-13 22:51:18 +08:00
Jenkins
21fcb028ec Merge "Disable glance v1 by default" 2017-03-13 12:56:28 +00:00
Matt Riedemann
45da777d25 Change to messagingv2 for oslo_messaging_notifications.driver
The oslo.messaging docs on the notification messaging driver
says that "messaging" (1.0) is a legacy format and you should
use messagingv2 unless otherwise required for that old format.

By default we should be testing with messagingv2.

Change-Id: I3031afe7551a0c8dde46e1ccfacff445fb68e122
2017-03-05 13:09:39 -05:00
Matt Riedemann
80e82eac4c Disable glance v1 by default
Nova has been supporting glance v2 since Newton and removed
support for glance v1 in Ocata:

97e7b97210139a7f7888f0d6901e499664de02a3

We should disable glance v1 by default because there are several
test paths in Tempest which don't get run when glance v1 is
available because it uses glance v1 rather than v2.

Depends-On: I54db379f6fbe859fd9f1b0cdd5b74102539ab265

Change-Id: I7f962a07317cdad917ee896d79e49ee18938d074
2017-03-03 17:11:56 -05:00
Sean Dague
11eb2017ef simplify endpoints used in devstack
The proliferation of internal/admin endpoints is mostly legacy and
based on some specific deployment patterns. These are not used by
everyone, and for the devstack case aren't really that useful. We
should simplify our service catalog down to the minimum we need for
development.

Change-Id: Ided7a65c81b3a0b56f0184847fc82e17c29a771e
2017-02-13 16:16:59 -05:00
Sean Dague
9751be66fa unify logging setup on all services
This provides a single setup_logging function which builds consistent
colorization if the config supports it, otherwise builds the identity
strings that we need to actually keep track of requests.

Change-Id: Iffe30326a5b974ad141aed6288f61e0d6fd18ca9
2017-01-20 10:48:29 -05:00
Sean Dague
b6753cea8c simplify colorized logging setup
This makes setup_colorized_logging be a thing which takes a single
parameter and doesn't let projects do things differently. It also
changes the order of values from user / project to project / user to
represent the hierachy more clearly.

Change-Id: I8c0ba7da54be588e3e068734feb4f78ed7c5a14a
2017-01-20 10:48:20 -05:00
Davanum Srinivas
80f3635521 Run Swift services under py35
* iniuncomment followed by iniset for reseller_prefix just adds a
  duplicate line in the config file that configparser does not like
  so just remove the uncomment
* fall back to http:// url for glance->swift keystone authentication
* insecure flag to talk to swift

Depends-On: I51d56d16a5b175bd45dee09edc0b2748d72a5d06
Change-Id: I02ed01e20f8dce195c51273e8384130af53384ce
2017-01-05 09:10:35 -05:00
Paulo Ewerton
75bf972239 Move default Keystone API version to v3
This patch sets Keystone v3 as default in services
configuration files and in the openrc and stackrc scripts.

Change-Id: I24546f02067ea23d088d383b85e3a78d7b43f166
Partially-Implements: bp keystonev3
2016-11-02 20:28:41 +01:00
Jenkins
ced511c593 Merge "Work around issue in glance_store swift driver" 2016-09-27 21:37:14 +00:00
Jens Rosenboom
890342ed87 Work around issue in glance_store swift driver
With [1] glance_store introduced default settings for user_domain_id and
project_domain_id. Sadly since these are always passed to the keystone
client, they override any settings to user_domain_name and
project_domain_name that are made in the config, leading to authentication
failures.

So as a workaround until [2] is fixed, we explicitly place the corresponding
domain_ids into the config.

[1] https://review.openstack.org/297665
[2] https://bugs.launchpad.net/tempest/+bug/1620999

Change-Id: Ica81a1a176614392291f2db4cc6398ed30663aed
2016-09-26 15:16:04 +02:00
Gregory Haynes
4b49e409f8 Use apache for tls-proxy ssl termination
Stud is now abandonware (see https://github.com/bumptech/stud) and is
not packaged in xenial. Lets use Apache for SSL termination since its
there already.

Change-Id: Ifcba410f5969521e8b3d30f02795541c1661f83a
2016-09-20 08:14:11 -07:00
Jenkins
db340e54b0 Merge "Support Glance CORS options in devstack configuration" 2016-06-15 23:57:35 +00:00
Jenkins
ca3a857d35 Merge "Have a way to disable Glance v1 in devstack" 2016-06-14 19:50:38 +00:00
Timur Sufiev
a44dd9a741 Support Glance CORS options in devstack configuration
To properly test the integration between Glance CORS feature and
Horizon Javascript environment uploading image files directly to Glance
(using this feature), we need to enable CORS support for Glance in
integration tests. Adding corresponding Devstack variable to configure
Glance in such a way that it accepts direct requests from Horizon
Javascript is the prerequisite step for the integration testing of this
feature.

By default Horizon and Glance are located on the same host, hence
default value cors.allowed_origin = http://$SERVICE_HOST should work.
If a more complicated setup is desired, where Horizon is located on a
different host, GLANCE_CORS_ALLOWED_ORIGIN environment variable should
be exported to Devstack.

Partially implements blueprint: horizon-glance-large-image-upload
Change-Id: I4881fb6631c2daa2ad8946210eff4bb021957374
2016-06-07 13:28:01 +00:00
Flavio Percoco
22c695f08a Have a way to disable Glance v1 in devstack
As part of the process of deprecating Glance's V1, the glance team would
like to start testing V2-only environments. Therefore, this change
provides a way to force other services to use V2.

Change-Id: I87e77d07964eac01e9a796817cbc88bd6e59c721
2016-06-03 14:55:26 -04:00
Einst Crazy
4f55c2d5c3 Set config file to db sync and other manage operation
Currently, the db sync operation does not specify the config dir or
config file.
If there is a config file in the home path, it will use this one,
but not the right one devstack write.

Set config file to these operations.

Change-Id: Id1fbc3d85280c19596f5ebd301c46bcf018fa2f6
Closes-Bug: #1578098
2016-05-09 01:43:32 +00:00