Commit Graph

65 Commits

Author SHA1 Message Date
Gabriel Cocenza c29a1c7b8e Add support for HAProxy L7 checks
This change add several configuration options to enable HTTP checks
to the HAProxy configuration, instead of the default TCP connection
checks.

Closes-Bug: #1880610
Change-Id: Ie1f53d38c1c45ce3b2ddf5041eaa04a7f3139066
2023-02-23 21:07:47 -03:00
Bartlomiej Poniecki-Klotz d92cf5756e Fixed removing multiple devices
Added a confirmation flag for swift-ring-builder command when multiple devices are found to be removed.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/656
Closes-Bug: #1937289
Change-Id: Ieeb326e7d9af21a77954e95e909d6fcf20a3092c
2021-11-22 14:13:07 +01:00
Erlon R. Cruz 498d3b0f1e Fix swift port replication configuration
Port replication configs are not being set into the ring files.
When replication port configs
(account|container|object)-server-port-rep, are changed in the
swift-storage charm, swift-storage changes the related configs in
the config files, but that does not update the rings.

This patch adds a function that runs in every config-change
triggered from the swift-storage nodes and make sure any replication
config is written to the ring and distributed to all nodes.

Partial-bug: #1903762
Change-Id: I87eb23de94e3f2f5b06d44df1f8bd9d2324456a0
2021-01-26 15:53:08 -03:00
Alex Kavanagh e869f021cb Sync libraries & common files prior to freeze
* charm-helpers sync for classic charms
* charms.ceph sync for ceph charms
* rebuild for reactive charms
* sync tox.ini files as needed
* sync requirements.txt files to sync to standard

Change-Id: I452af2fa5a833c435b913571fd059282bbe0a1a6
2020-09-27 19:26:04 +01:00
Alex Kavanagh 1e8a448d0e Alter handling of identity-service relation data
This patchset changes the handling of the identity-service relation data
from "the last connected charm in the relation-list is the data to use"
to "merge non None data from all relations, with the last one winning."

This is to handle the change in how keystone now sets relation data on
the identity-service relation: only the leader actually sets the
relation data.  This means that the consuming charm only 'sees' relation
data from leader, with no keys from the non-leaders.

charms.reactive handles this by merging data from all the relations.
This change exhibits the same behaviour.

Change-Id: Ic77c0127ab9903c1596d2be882735acec3d2e2f9
Closes-Bug: #1889930
2020-08-01 08:32:01 +01:00
Frode Nordahl ed9051a9f3
s3token: Fix Keystone API configuration
Upstream removed the api_version configuration option and started
to expect the version to be encoded in the Keystone URL at Rocky.

Add S3 API functional test.

Remove invalid configuration items in the s3token section.

Remove configuration templates for OpenStack versions prior to
Mitaka.

Change-Id: Ia3306441222f7c078d460c659701a57a5944c928
Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/194
Closes-Bug: #1867373
2020-03-16 12:26:52 +01:00
tpsilva 2d8d80e47e Disable Apache port 80
Currently, Apache ports.conf file is not being configured by this
charm. This patch changes the ports.conf default file with another one
that does not open port 80 on SSL environments.

Change-Id: I63f46223c64f2561f505828491a482dea79dc39a
Closes-bug: #1845665
2020-01-29 18:23:08 +00:00
Liam Young ab8b60a21c When resuming, exclude haproxy
When resuming services exclude those managed by hacluster, in
this case haproxy. If pacemaker lacks quorum it may shut haproxy
down which will cause this charm to error.

Charmhelper sync included to bring in required
get_managed_services_and_ports method.

Change-Id: I85c380a2cffcd18031a32b6e3eb422aa5ff14994
2020-01-27 19:19:07 +00:00
Corey Bryant 1b47612f87 Drop support of swauth for Train and later
swauth is no longer maintained as of OpenStack Train [1] so we
need to stop supporting it for OpenStack Train and later.

[1] https://opendev.org/x/swauth

Closes-Bug: #1851394
Change-Id: Ic2345427951a311477d6808077fb18b248036b82
2020-01-07 15:03:08 -05:00
Zuul e31253d15b Merge "Revert "Disable Apache default ports"" 2019-12-20 09:43:38 +00:00
Tiago Pasqualini da Silva f7a3670d87 Revert "Disable Apache default ports"
This reverts commit 235ef232df.

Change-Id: Iebd50c664273ed7178e3ec590c30eee66760b9df
2019-12-20 02:05:18 +00:00
Zuul d80cb2a8ed Merge "Disable Apache default ports" 2019-12-19 12:26:36 +00:00
Tytus Kurek 44df5db97d Swift Global Cluster
This patchset adds a support for Swift Global Cluster feature as
described at:

https://docs.openstack.org/swift/latest/overview_global_cluster.html

It allows specifying affinity settings as parrt of the deployment.
Moreover, the master - slave relation is introduced for the purpose of
rings distribution across proxy nodes participating in the Swift Global
Cluster.

Change-Id: I406445493e2226aa5ae40a09c9053ac8633a46e9
Closes-Bug: 1815879
Depends-On: I11b6c7802e5bfbd61b06e4d11c65804a165781b6
2019-12-16 14:51:56 +00:00
tpsilva 235ef232df Disable Apache default ports
Openstack services don't use the default ports (80 and 443), so
change Apache to not open them.

Change-Id: Iebde91ae780ab50e61ec5ad49961214ac2a137c4
Closes-bug: #1845665
2019-11-27 12:51:57 +00:00
Corey Bryant 5f3735f884 py3: Switch packages to Python 3 for train and later
Switch package install to Python 3 for OpenStack Train and later.

When upgrading, remove any python-* packages that were explicitly
installated and then autoremove --purge any dependencies that are
no longer required.

This patch also includes the following related changes:
  * Use the common files package, swift, rather than python-swift
    as the package name when determining releases.
  * Drop the python2 shebang from manager.py in favor of specifying
    the interpreter on the subprocess call. The python interpreter
    version must match the python version of the OpenStack payload
    due to the swift library imports.
  * Enable the cPickle import in manager.py for Python 3
    (C-optimized module name is _pickle), and fix 'result'
    variable that is a set type but should be a dict type.

Change-Id: Ia3fdbf2020137bcf39039478ee3606717d3d6e20
Closes-Bug: #1841184
2019-10-10 06:51:20 +00:00
Tytus Kurek f9a02a3f58 Dispersion report
This patchset adds a template for the 'dispersion.conf' file which is
used for swift cluster health monitoring.

Change-Id: I348ded9f94f2bcb7a680b2c2280ff163cde65c46
Closes-Bug: 1328064
2019-07-01 09:24:10 +00:00
Tytus Kurek 3809df73fb Add 'set-weight' action.
This patchset adds the 'set-weight' action which can be used to set
weight of device(s) based on the search pattern.

Change-Id: I6bbc71f66d948e97d2dd6a5174dedb3212503a3f
Closes-Bug: 1821697
2019-06-18 10:43:44 +00:00
Zuul f2ba19bce3 Merge "Add 'remove-devices' action." 2019-05-22 10:49:49 +00:00
Edward Hope-Morley cc280d9dcb Add S3 SigV4 location support
Change-Id: I2ee8cb968ae2cf34558546b1be6be5273c2f52d3
Closes-Bug: #1822322
2019-05-03 11:16:25 +01:00
Tytus Kurek 1160493f3f Replicas per ring
This patchset implements 'replicas-account' and 'replicas-container'
charm options which can be used to set the desired number of replicas
per ring.

Change-Id: Ie7fa1b8c5619d0a5a278cd0eddaf1051de11f2a3
Closes-Bug: 1823696
2019-04-29 07:16:05 +00:00
Levente Tamas 20b420ac69 Add 'remove-devices' action.
This patchset adds the 'remove-devices' action which can be used remove
devices from rings based on search patterns.

Change-Id: I1380193b27cc4f385f156af8d63c5594dfea9cfa
Co-Authored-By: Tytus Kurek <tytus.kurek@canonical.com>
Closes-Bug: 1822058
2019-04-12 13:04:58 +02:00
Zuul 48ff2af248 Merge "Drop python-keystone and add python-keystonemiddleware" 2019-02-27 07:34:21 +00:00
Corey Bryant 354030638d Drop python-keystone and add python-keystonemiddleware
Python 2 support has been removed from the keystone package in
Disco (Stein), therefore there is no longer a python-keystone
binary package. python-keystone doesn't appear to be used by the
charm. python-keystonemiddleware, however, is used by the charm.

This change can safely be applied from Mitaka onwards.

Change-Id: I9aa6d66761ffa4f64a8573f3b0ab1e20b9c4f774
2019-02-26 15:43:55 +01:00
Edward Hope-Morley 0db47330bc Fix docstring format typo from commit f25d2c2
Change-Id: Ibce2d65d3e4f706afa2c3c3345074973f0b90fb3
2019-01-16 12:03:49 +00:00
James Page 8cf9dd4e1a Support deploy of Swift with internal S3 support
Swift support is in-tree for Swift since OpenStack Rocky, and
the swift-plugin-s3 package has been removed from the archive at
Cosmic so drop installation at Rocky.

Add new template for Rocky to use the in-tree s3api and s3token
middleware.

Enable cosmic test to validate changes.

Change-Id: Ie5447dc44203c1ea2ad27e6d71248ba59d7549d0
Closes-Bug: 1805597
2018-12-18 10:12:19 +00:00
Edward Hope-Morley f25d2c2d7f Cleanup ring manager storage relation settings
If local unit is no longer leader, clear rings_url on
storage relations to avoid storage units getting
rings from wrong proxy unit.

Also send broker-timestamp to storage units when providing
rings_url so that we have a means of knowing which is the most
recent. Broker timestamp is the same for peer and storage
sync so this enables identifying most recent.

Change-Id: I2c7e9028f345791bad0a736cb89979284b144e33
Closes-Bug: #1765203
2018-12-07 11:42:09 +00:00
Shane Peters 3b2efe479f Add support for Static Large Objects
Adds the necessary filter to the swift-proxy config
to support Static Large Objects (SLO).

A new config value 'static-large-object-segments' toggles
SLO support and allows the user to control the maximum object
size when set to a value >0.

Change-Id: I42a88292775badb9fd70e5b99558d084ddcdc29f
Closes-Bug: 1753811
2018-05-04 09:56:45 -04:00
Alex Kavanagh 4336b8d644 Convert charm to Python 3 only
* Needed to add a swift_manager/manager.py file which uses the payload
  software python modules to perform certain functions on behalf of the
  charm.  These were part of the main charm, which couldn't be retained
  in the charm due to the charm changing to Py3.
* Changed to absolute imports using the charm root as the root for all
  charm modules.
* The py2 target in tox.ini is used to test the swift_manager/manager.py
  file only.
* The .testr.conf file has been migrated to .stestr.conf

Change-Id: If37a393aa6ed27651b04810aa0bbf69eda37d7b4
2017-12-06 14:20:25 +00:00
James Hebden a11ff79fc7 Add statsd logging support to the swift-proxy charm
By default, statsd metrics can be sent by swift-proxy
for diagnostic and monitoring purposes, but are disabled
by default. This change exposes charm config settings
that allow it to be enabled by setting 'statsd_host'
to a non-empty value. 'statsd_port' and 'statsd_sample_rate'
are also supported for changing the destination port
and rate at which metrics are collected.

Closes-Bug: #1729771

Change-Id: I2d5cca233d48022073b5975c06c3da2b1896d8d9
2017-11-05 18:03:54 +11:00
Jenkins 727aff428b Merge "Handle holes in swift rings" 2017-09-18 13:35:03 +00:00
James Page 655d5be16a Revert "Ensure storage hooks observe disable-ring-rebalance"
This reverts commit 1cf5ea71d0 which
is not required as the should_balance function already inspects
the configuration option that enforces ring balancing via actions.

Change-Id: I79c1be12f680c446d556dc16e9dfbd60a7d9db38
2017-09-12 16:09:02 -06:00
Billy Olsen ac553419f4 Handle holes in swift rings
The Swift rings may have "holes" for devices which no longer
exist, but the code does not handle the holes in general. Holes
appear in the Swift rings as None objects in the devices list.

This change adds checks to the places in the code which are loading
the devices from the Swift ring to account for None. Generally,
this is just checking the truthy value of a device.

However, this change also removes the next device id calculation
from the add_to_ring function, deferring the device id selection
to the Swift RingBuilder. Upon examining the Swift RingBuilder
code, it was seen that the RingBuilder will automatically calculate
a device id for a new device when no id is specified. The Swift
algorithm considers factors other than a hole in the ring (e.g.
out of order devices) which were missing from the charm's code.

Change-Id: Ibb0908338ac958ebf1adf17c12f9484f6963c695
Closes-Bug: #1708310
Co-Authored-By: Drew Freiberger <drew.freiberger@canonical.com>"
2017-08-25 16:00:53 -07:00
James Page 9f2038d20a Improve support for telemetry collection
Add new amqp interface and configure ceilometermiddleware to
send telemetry notifications via RabbitMQ when swift-proxy is
related to the rabbitmq-server charm.

This change also includes some tidyup to include required
components in the swift pipelines (automagically added by swift
prior to this).

Change-Id: Ie3c5c87b31d805cb7e62fa47c322402f47dd0d33
Closes-Bug: 1321281
2017-08-08 14:10:41 +01:00
Alex Kavanagh bbd51fe884 Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: I71690d9a33a141e04e527c72d89fb79a26d10bd3
Related-Bug: #1659575
2017-04-27 12:13:59 +01:00
James Page 1cf5ea71d0 Ensure storage hooks observe disable-ring-rebalance
When adding new storage capacity, its desirable to disable ring
rebalancing until all new storage has been added, allowing the
end-user to determing when all new capacity has been added and its
OK to rebalance the rings and re-distribute.

Ensure that storage hook events from swift-storage observe the
'disable-ring-rebalance' configuration option, enabling end users
to perform this type of orchestration storage expansion.

Change-Id: I95727e663b369d5feb28147b19edcc6cab36b905
Closes-Bug: 1638981
2017-02-02 11:01:13 +00:00
Frode Nordahl 7c24ae8128 Fix Keystone v3 auth for swift-proxy
No need for refresh of proxy-server.conf template for Mitaka. Update
template for Kilo and later to make use of domain_name and project_name
parameters instead of domain_id and project_id parameters.

The current template sets up auth to user in default domain
but project in service domain. This does not work with service
domain layout.

Do not request configured operator_roles roles from Keystone. From
which roles swift-proxy should accept requests are still configured
in proxy-server.conf, but requesting and setting up these roles for
the s3_swift user in Keystone is incorrect behaviour.

Register required relation data for identity-service immediatelly when
relation to 'identity-service' exists. Do not postpone registration
until context is complete which may cause the swift-proxy unit marking
itself ready while still being in a unconfigured state.

Add tests to verify configuration and operation of swift-proxy when
using Keystone v3 auth.

Change-Id: I8bf182a9256f96af50e4cc37505d9c0ca3d62e47
Closes-Bug: 1646765
2016-12-08 07:17:26 +01:00
Chris MacNaughton ce3f15310e Implement swauth
This change implements the alternative authentication system,
swauth in addition to adding an action to add users to swauth

Change-Id: Ib752cd3a2a58f6c8cb06119c6be595cfc07ddc9f
2016-09-23 09:12:43 -04:00
James Page 2a3b0857b6 Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the os_application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv and contrib.openstack support for this
feature.

Change-Id: I81013c7ced18a5d21dc151b023c0656f7300f58f
2016-09-20 12:45:17 +01:00
Liam Young 5b8b04a213 Fix support for Keystone v3 API
Swift proxy is currently rejecting valid v3 tokens because it is
failing to validate them due to its credentials being in the v2
format and missing domain information. This change examines the
version of the API keystone has advertised down the identity-service
relation and configures the proxy conf appropriately

Change-Id: Id2215168ffbad1caf0e7203ded26c41913181306
Closes-Bug: 1624304
2016-09-16 13:58:26 +00:00
James Page 0fa129873b Use JUJU_MODEL_UUID for Juju 2.0
Juju 2.0 renames the environment variable JUJU_ENV_UUID
to JUJU_MODEL_UUID; use this environment variable as a
fallback if JUJU_ENV_UUID is not set to support Juju 2.0,
whilst continuing to provide support for Juju < 2.0.

Change-Id: I26ae366c84d3cd9a9c2471385effd2a6202e9314
Closes-Bug: 1572575
2016-05-23 10:08:57 +01:00
Edward Hope-Morley aba195e46b Allow min-part-hours to be set back to zero
Charm is currently accidentally ignoring
min-hours=0. This patch fixes that.

Closes-Bug: 1570314
Change-Id: I1a71a881009e6ead5d00a72084ce4dea6714bcf2
2016-04-14 12:03:32 +01:00
Alex Kavanagh d009a254f1 Enhanced pause/resume for maintenance mode
The existing pause/resume has been enhanced by adding more robust service
checks and hooking into the pause/resume functionality in the charmhelpers
library.

Change-Id: Ia487499ec4d8e4f41ec985eac02d97e085a06e2c
2016-04-11 16:28:51 +00:00
Edward Hope-Morley ccaeae4706 Refactor of ring management code
Make the ring sync code clearer and improve logic around leader
switching during or after a sync. Also add more debug logs to
make it easier to debug when things go wrong.

Closes-Bug: 1448884
Change-Id: I10d51c74001710b6b7a2502e14370996b15ffb40
2016-03-30 10:40:43 +01:00
Edward Hope-Morley 85e326e17d add status set to blocked for no v6 addr rxed from storage rel 2015-11-06 18:33:58 +00:00
David Ames fe0c45116d Return if ipv6 not correct 2015-11-06 08:54:27 -08:00
David Ames c1ff7bc4ce Keep ipv6 addr check in assess_status 2015-11-06 08:48:47 -08:00
Corey Bryant d41382cace [james-pages,r=corey.bryant] Add tox support for lint and unit tests. 2015-11-03 17:02:35 +00:00
Edward Hope-Morley dbd24017c0 more 2015-10-28 14:51:20 +00:00
Edward Hope-Morley 77c8b763de [hopem,r=]
Ensure ipv6 addresses correctly formatted.
Closes-Bug: 1510958
2015-10-28 14:33:55 +00:00
David Ames 2c6f53066a Fix bug when swift-storage-relation-joined is run before ring files are available 2015-10-22 11:39:44 -07:00