Commit Graph

421 Commits

Author SHA1 Message Date
Ghanshyam Mann 1001769dfb Update python classifier in setup.cfg
As per the current release tested runtime, we test
till python 3.11 so updating the same in python
classifier in setup.cfg

Change-Id: Id0f37bebfb5298c5a84aa8f46f9b2d161b1f81ca
2024-01-03 19:22:50 -08:00
Amit Uniyal 972dfd4825 Bugtracker link update
As discussed in the upstream meeting, update the placement bug tracker,
link from storyboard to launchpad, so new bugs should be reported in
launchpad instead storyboad.

Whats not updated:
- all links of storyboard which do not point to bugs
- links of existing stories, features, docs etc

Change-Id: I64b9d6feb4fb35f36c5a290b8b79d9b78736efd2
2023-03-30 05:36:29 +00:00
Takashi Kajinami d013b37066 Update python testing as per zed cycle testing runtime
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Add release notes and update the python
classifier for the same.

[1] https://governance.openstack.org/tc/reference/runtimes/zed.html

Co-Authored-By: Ghanshyam Mann <gmann@ghanshyammann.com>
Change-Id: I998b34f884a2869d46ff05a179708a7f775e1615
2022-06-08 08:14:53 +09:00
Stephen Finucane 079e55fd1b setup: Replace dashes with underscores
Resolves the following class of warnings issued when building the
package sdist:

  UserWarning: Usage of dash-separated 'python-requires' will not be
  supported in future versions. Please use the underscore name
  'python_requires' instead

Change-Id: Ie4f6c7b17ace67669cdeec84ce4f163aededa8e4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-02-06 02:00:06 +09:00
Ghanshyam Mann 1141597b5a Updating python testing as per Yoga testing runtime
Yoga testing runtime[1] has been updated to add py39
testing as voting. Unit tests update are
handled by the job template change in openstack-zuul-job

- https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/820286

this commit makes other required changes in zuul.yaml and
update the classifier in setup.cfg file.

[1] https://governance.openstack.org/tc/reference/runtimes/yoga.html

Change-Id: I50c125df4ee03377caf16da5824e2ed492d4b7da
2021-12-14 02:24:04 +00:00
Ghanshyam Mann fa95ef8772 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ia7365cc3ae09e2ff916ab9f9ff0ba4fef0dc446b
2021-01-15 20:34:51 +00:00
songwenping 11fa34f5af Add py38 package metadata
Change-Id: I2050af0549f8a3ffa69646c8ede94566b7a3554c
2020-04-30 17:54:00 +08:00
Andreas Jaeger 0f90d197e1 Cleanup py27 support
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg:
  * Wheel is not needed for python 3 only repo
  * Some other sections are obsolete
- Update classifiers

Change-Id: I6f458fb60b5a33b5aa2ce3ab292862ab98eb4670
2020-04-07 17:30:34 +00:00
Chris Dent 8436f45d01 Drop support for python 2
This is modelled on the similar change in nova [1] but is
simpler because Placement was already using python3 for
"integration" style tests.

The 'train' python3 template is replaced with corresponding 'ussuri'.

The python template is removed (it is 2.7) and the pep8 job that was
included in that template is now listed in check and gate jobs.

.zuul.yaml is updated to not do a generic 'funtional' test,
instead versioned tests only.

setup.cfg removes indications of support for python 2.

A reno is added.

tox.ini is changed to make the functional environment a
base environment for specific functional jobs.

[1] Ie1a0cbd82a617dbcc15729647218ac3e9cd0e5a9

Change-Id: Ifce3b0c0ff11553f32b2d02df07fde81efc34100
2019-10-18 12:58:36 +00:00
Chris Dent 3eb8627374 Update setup.cfg to include project_urls
The content is based on what pbr does [1] and packaging docs [2].
The links chosen and the names used are whatever we like.

project_urls are used when displaying packages on pypi, the links
show up in the left sidebar under a project links section.
pbr's example [3].

[1] https://docs.openstack.org/pbr/latest/user/using.html#setup-cfg
[2] https://packaging.python.org/guides/distributing-packages-using-setuptools/#project-urls
[3] https://pypi.org/project/pbr/

Change-Id: I0c8663b1ed495f141350fd023c78a6ff38bca29f
Story: 2005170
Task: 30915
2019-09-10 17:15:43 +00:00
Corey Bryant 7858375439 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I2ef60794a2606a7d7abfd413c6ba50689c52e67b
Story: #2005924
Task: #34236
2019-07-10 21:09:52 +00:00
Chris Dent c62ed6ccba Package db migration scripts in placement pypi dist
Having the db migration scripts within the openstack-placement pypi
distribution is desirable for deployment tools, such as
openstack-ansible. It provides a known good location for the script,
available with a pip install.

There are several ways to distribute files with a python package. The
method used here was chosen because it works both with tarballs and
wheels (the files are already in the tarball, as a result of the way pbr
works, but not in the wheel).

Here's what's done:

* The db migrate scripts are put in their own direcory,
  placement_db_tools, so that only they are packaged, not the other
  tools.
* To preserve how grenade interacts with these files as well as not
  disrupt the docs, symlinks from tools to placement_db_tools have been
  created.
* placement_db_tools is added to the list of packages included in the
  openstack-placement distro. This means that when 'pip install
  openstack-placement' happens, the python environment will then include
  placement and placement_db_tools directories.

The end result is that the true path to the script can be found with:

  pkg_resources.resource_filename('placement_db_tools', 'mysql-migrate-db.sh')

This has been noted in the to-stein.rst document.

A different package was chosen to not muddy the waters of what is
"actually placement".

Similarly, the 'data_files' functionality provided by pbr was not used,
because that requires the file be written to a location on the local
filesystem, relative to the install prefix. Dirtying the filesystem
outside the python lib with this sort of thing is inappropriate.

Change-Id: Ie326ce8a2a0692d20793bc18be606e034fa94a44
Story: 2005535
Task: 30671
2019-05-07 00:08:39 +00:00
Ghanshyam Mann da3e8795f3 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I5e4a9148c0e0649ff0e4657ea4c87e50c1b3fd2d
2019-04-22 23:12:02 +00:00
Chris Dent da1a588b8d Remove use of oslo.i18n and translation
Nothing is being translated in placement so, for the sake of being clean
and tidy, this patch removes the framework for translation and the
import of oslo.i18n.

Originally the hope was we could remove the dependency on oslo.i18n and
Babel entirely to save some disk space but many other oslo-related libs
depend on oslo.i18n so they are present anyway. [1]

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-March/004220.html

Change-Id: Ia965d028b6f7c9f04d1f29beb12f4862585631d5
2019-03-25 16:59:21 +00:00
Takashi NATSUME f22a812278 Update author-email in setup.cfg
The openstack-dev mailing list has been replaced with
the openstack-discuss mailing list (*).
So replace the openstack-dev mailing list with
the openstack-discuss mailing list in setup.cfg.

*: http://lists.openstack.org/pipermail/openstack-dev/2018-September/134911.html

Change-Id: I1138d32462a7f1531588a7c4321086c9abb22d49
2018-12-04 04:21:17 +00:00
Matt Riedemann 3ff9d0a5a0 Add placement-status upgrade check command
This adds the basic framework for the
placement-status upgrade check command which
is a community-wide goal for the Stein release.

A simple placeholder check is added which should
be replaced later when we have a real upgrade
check.

Change-Id: I9291386fe7fcbfc035c104ea9fdbe5eb875c4776
Story: 2003657
Task: 27518
2018-11-20 13:53:07 -05:00
Chris Dent 7b5218d8e3 Add a placement-manage CLI
This change adds a rudimentary command line tool, 'placement-manage'
that can do three things:

* placement-manage --version: report the current version of the software
* placement-manage db sync: sync the db to the 'head' alembic version
* placement-manage db version: report the current version of the db

It is written following the examples set by both nova and ironic for
using oslo config driven command line parsing. It is not as full
featured as the nova version (with decorators for argument handling and
help text etc) because we don't need that yet. There's plenty of room
for improvement, but the intention here is to keep things simple until
we need them to be otherwise.

The provided unit tests cover that the arg parsing behaves as expected
and that the right commands are connected the right args. The actual
functionality of the 'db sync' command (a migration.upgrade) is tested
in runs that use devstack as well as the test_migrations functional
test.

Errors during the migration simply raise exceptions which will output
noisily to the console. At this stage this is desirable and suitable.

A new doc for the cli is added, with basic information for
placement-manage. Note that at this time the deployment documentation
has not been updated. That will be done in a later change.

Future changes may include (if we can't avoid it) tools for initiating
online migrations from the command line.

Needed-By: https://review.openstack.org/600162/
Change-Id: I1ff472106610150a587f5286f26a6bd7c1aa84f4
2018-11-20 15:00:32 +00:00
Chris Dent 8595096c82 Set the name of the package to openstack-placement
This change was made based on discussion [1] on the dev ML shortly before
the PTG.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-September/134212.html

Change-Id: I7bdcf8ebaf0bf8ce7a184e5483028f1ad8d04868
2018-09-12 16:26:39 -06:00
Chris Dent eaeeea1cfe Inspect and correct tox.ini, .stestr.conf and setup.cfg
Begin the process of getting placement tests running, by getting the
test harness opertional.

Before we can expect the tests to be able to run the configuration for
the placement package and its test harness needs to be adjusted for
"nova" -> "placement". These changes are made by inspection and based
on previous iterations of doing these kinds of cleanups, it won't be
until later in this stack of change that actually passing tests will
show up. However, the logs for attempted tests runs should be getting
a little bit further than the parent.

setup.cfg changes quite a bit because there are many things in it that
are not relevant. placement (thus far) really only has one entry point.
As noted, by a TODO, a placement-manage and placement-status will be
desired in the near future.

Change-Id: Iaa385c6e8653a9646a21bb65203deaa05ec43217
2018-09-04 10:31:25 -05:00
EdLeafe 1dca56f58e Remove the import pathing for the old structure
This commit is the result of running the following search and replace
across the project.
    s/nova\.api\.openstack\.?//g

Change-Id: I4974a28de541aace043504f788cf0d100f778cae
2018-09-04 10:31:24 -05:00
zhangyangyang a59e7dda5d Remove ChanceScheduler
ChanceScheduler is deprecated in Pike [1] and will be removed in a
subsequent release.

[1] https://review.openstack.org/#/c/492210/

Change-Id: I44f9c1cabf9fc64b1a6903236bc88f5ed8619e9e
2018-08-20 15:56:13 +01:00
Matt Riedemann 519e5a22d1 Implement granular policy rules for placement
This adds a granular policy checking framework for
placement based on nova.policy but with a lot of
the legacy cruft removed, like the is_admin and
context_is_admin rules.

A new PlacementPolicyFixture is added along with
a new configuration option, [placement]/policy_file,
which is needed because the default policy file
that gets used in config is from [oslo_policy]/policy_file
which is being used as the nova policy file. As
far as I can tell, oslo.policy doesn't allow for
multiple policy files with different names unless
I'm misunderstanding how the policy_dirs option works.

With these changes, we can have something like:

  /etc/nova/policy.json - for nova policy rules
  /etc/nova/placement-policy.yaml - for placement rules

The docs are also updated to include the placement
policy sample along with a tox builder for the sample.

This starts by adding granular rules for CRUD operations
on the /resource_providers and /resource_providers/{uuid}
routes which use the same descriptions from the placement
API reference. Subsequent patches will add new granular
rules for the other routes.

Part of blueprint granular-placement-policy

Change-Id: I17573f5210314341c332fdcb1ce462a989c21940
2018-05-17 11:12:16 -04:00
Matt Riedemann 11ed47c9e0 Remove [scheduler]/host_manager config option
While this option itself was not technically deprecated,
the option only had two choices and the "ironic_host_manager"
choice has been deprecated since Queens:

  Iebc74a09990dcda8cf0ee2a41f9ae1058d2a182a

And was removed in Rocky:

  I695b250c82c8dcedcd8e2bee00c56bb2df19212c

Since the host_manager option only had one choice, which
is also the default, it's not really an option anymore and
we can simply remove it. Setting it will have no effect
so there should be no upgrade impact for its removal.

Change-Id: Ic61ae3a4f563aa54a3a2956667c702a81e610fc3
2018-05-03 09:39:26 -04:00
Matt Riedemann 43bae270fd Remove IronicHostManager and baremetal scheduling options
The use_baremetal_filters and baremetal_enabled_filters were
deprecated in Pike: I843353427c90142a366ae9ca63ee4298b4f3ecd4

The IronicHostManager was deprecated in Queens:
Iebc74a09990dcda8cf0ee2a41f9ae1058d2a182a

Note that the NUMATopologyFilter should be OK in a mixed
VM/BM deployment because ironic compute nodes will not
report 'numa_topology' so those "hosts" will be filtered
out from requests for a specific NUMA topology or CPU
policy.

This change drops the deprecated baremetal scheduling options
and since the IronicHostManager is really only useful when
using those scheduling options, it is also removed.

Baremetal scheduling is now required to go through resource
classes.

Change-Id: I695b250c82c8dcedcd8e2bee00c56bb2df19212c
2018-05-02 11:35:18 -04:00
Stephen Finucane 7b01024591 Follow the new PTI for document build
The Project Testing Interface [1] asks that we list requirements in
'doc/requirements.txt' and build docs by calling 'sphinx-build' directly
instead of via the 'build_sphinx' setuptool/distutils wrapper. Start
doing this.

[1] https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: If9342c8ea757b1735f2488db751008984fb33baf
2018-03-16 14:39:36 +00:00
Zuul b98c119a6d Merge "setup.cfg: Explicitly set [build_sphinx] builder" 2018-03-12 22:59:03 +00:00
Stephen Finucane bd59761804 setup.cfg: Explicitly set [build_sphinx] builder
An recent change in pbr changed the default behavior of pbr's variants
of the 'sphinx_build' setuptools plugin [1]. Previously, pbr defaulted
to building both HTML and man page output, but it now builds only the
former. nova happens to be one of the rare projects that _does_ care
about man pages so mitigate the impact of this change by explicitly
setting the 'builder' configuration option to build HTML and man page
output.

While we're at it, the 'build_apiguide' section is removed as this
doesn't actually do anything and is a remnant of a broken cookiecutter
file [2].

[1] https://review.openstack.org/#/c/456157/
[2] https://review.openstack.org/#/c/448164/

Change-Id: I79efedd44b11c9832ae8cb36e54c2567f85fcf50
2017-12-27 13:53:10 +00:00
Matt Riedemann aa19ae204c Deprecate the IronicHostManager
The use_baremetal_filters and baremetal_enabled_filters options
along with the ExactRamFilter, ExactCoreFilter and ExactDiskFilter
filters were all deprecated in Pike:

  I843353427c90142a366ae9ca63ee4298b4f3ecd4

The IronicHostManager is configurable and relies on those options,
so if those options are deprecated then the IronicHostManager should
also be deprecated.

The sticky part with this is going to be filters that don't work with
ironic nodes today, like the NUMATopologyFilter, so a note is left
in the use_baremetal_filters option code to remind us that we can't
likely remove any of this until all filters work with ironic nodes.

Change-Id: Iebc74a09990dcda8cf0ee2a41f9ae1058d2a182a
2017-11-28 15:23:48 -05:00
Stephen Finucane 6304938327 trivial: Rename 'policy_check' -> 'policy'
The executable is 'nova-policy' - not 'nova-policy-check'.

Change-Id: I3e875a3284935cbb9607f01c7139982da0e11945
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2017-10-25 17:56:40 +01:00
Michael Still adbf397164 Move the idmapshift binary into privsep.
I can't see any evidence that anyone else uses our nova-idmapshift
binary, and it adds a lot of complexity (flags we never call for
example). Move the code we do actually use into the privsep
directory and simplify our calls to it. Remove the extra binary
from our install and documentation.

Change-Id: Ibce28d20d166da154833376cf51f1877b829925e
blueprint: hurrah-for-privsep
2017-10-24 18:50:23 +11:00
Jesse Pretorius 171f6a033c Add default configuration files to data_files
In order to make it simpler to use the default
configuration files when deploying services
from source, the files are added to pbr's
data_files section so that the files are
included in the built wheels and therefore
deployed with the code. Packaging and deployment
tools can then more easily use the default files
if they wish to.

This pattern is already established with similar
files for neutron and the glance metadefs as has
been mentioned in the related bug report.

Change-Id: I66e6525338e06f289a20ff2cdc2d108ffd6d30b2
Closes-Bug: #1718356
2017-09-22 11:36:56 +00:00
He Jie Xu 0df4107ffa Using plain routes for the microversions test
Few microversions unittest still depend on the stevedore to load few
fake controller. This patch uses the plain routes to instead of stevedore.

For the unittest can injects routes which are used for test, the `custom_routes`
parameter is added to the APIRouterV21.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I1a7c653ab21be41b1a41f748a35ec9a57dd8b15d
2017-07-23 22:43:53 +08:00
He Jie Xu 4c01c1f584 Remove the unittest for plugin framework
The extension/plugin mechanism is removed from the Nova API. This
patch removed related unittest.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I1c5a1dccb08bd0b869cb206b247d6cb744e76163
2017-07-21 17:39:46 +08:00
He Jie Xu f7e86c290b Use plain routes list for versions instead of stevedore
This patch adds versions related routes by a plain list,
instead of using stevedore.

After all the Nova API endpoints moves to the plain routes list,
the usage of stevedore for API loading will be removed from Nova

To support the redirection from '' to '/', this patch also
enables to put a target patch instead of a dict with supported
methods in the ROUTE_LIST.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: Iba340c5dd66cf9d006e2e8d3d0674b2140915014
2017-07-21 17:39:46 +08:00
Jenkins e208fe7989 Merge "Use plain routes list for extension_info instead of stevedore" 2017-07-21 06:35:48 +00:00
Jenkins 3ca8443190 Merge "Use plain routes list for os-snapshots instead of stevedore" 2017-07-21 06:20:27 +00:00
Jenkins f774a511c1 Merge "Update URL home-page in documents according to document migration" 2017-07-19 17:31:51 +00:00
Jenkins 6600cc554c Merge "Use plain routes list for os-baremetal-nodes endpoint instead of stevedore" 2017-07-19 11:45:07 +00:00
Luong Anh Tuan 6ec456cc6e Update URL home-page in documents according to document migration
Change-Id: I48c04fdd693cfbe1c279fd26a181d65d84494aa2
2017-07-19 08:47:27 +00:00
Jenkins 7c2f8ca87e Merge "Use plain routes list for os-security-group-default-rules instead of stevedore" 2017-07-19 08:45:26 +00:00
Jenkins 08fc5b77f2 Merge "Use plain routes list for os-security-group-rules instead of stevedore" 2017-07-19 06:01:56 +00:00
He Jie Xu ddab36dcac Use plain routes list for extension_info instead of stevedore
This patch adds extension_info related routes by a plain list,
instead of using stevedore.

After all the Nova API endpoints moves to the plain routes list,
the usage of stevedore for API loading will be removed from Nova.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I07c5e0dc34042d4f3cea8b1b933b11a624ec9512
2017-07-18 22:57:00 +08:00
He Jie Xu dd1d3f0b92 Use plain routes list for os-snapshots instead of stevedore
This patch adds os-snapshots related routes by a plain list,
instead of using stevedore.

After all the Nova API endpoints moves to the plain routes list,
the usage of stevedore for API loading will be removed from Nova.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: If2f073066fc4df533138409eec6c8ac0dd44d00a
2017-07-18 22:46:59 +08:00
Jenkins 670673bbff Merge "Use plain routes list for image-metadata instead of stevedore" 2017-07-18 09:34:29 +00:00
Jenkins edbffe5131 Merge "Use plain routes list for images instead of stevedore" 2017-07-18 09:23:43 +00:00
Jenkins 7ee82bfdd5 Merge "Use plain routes list for os-networks instead of stevedore" 2017-07-18 03:27:22 +00:00
Jenkins 34b275863b Merge "Use plain routes list for os-cells endpoint instead of stevedore" 2017-07-14 03:00:45 +00:00
ghanshyam 3e10dd5c5b Use plain routes list for os-baremetal-nodes endpoint instead of stevedore
This patch adds os-baremetal-nodes related routes
by a plain list, instead of using stevedore. After all the Nova
API endpoints moves to the plain routes list, the usage of stevedore
for API loading will be removed from Nova.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I2df8f897cf2d53d01e5e9156efbcddd7aa988473
2017-07-12 20:58:55 +08:00
He Jie Xu 5988f99052 Use plain routes list for os-security-group-default-rules instead of stevedore
This patch adds os-security-group-default-rules related routes by a plain list,
instead of using stevedore.

After all the Nova API endpoints moves to the plain routes list,
the usage of stevedore for API loading will be removed from Nova.

Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: Ifd7c8fc508c0afdb3ce14a4514862805a1569a8b
2017-07-12 20:58:40 +08:00
He Jie Xu 90105b926d Use plain routes list for os-security-group-rules instead of stevedore
This patch adds os-security-group-rules related routes by a plain list,
instead of using stevedore.

After all the Nova API endpoints moves to the plain routes list,
the usage of stevedore for API loading will be removed from Nova.

The API sample tests are missed for os-security-group-rules API,
this patch adds them to ensure the route working correctly.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I2d3ac79fdb0314014f4b8b69a9c5f27a922d9046
2017-07-12 20:58:26 +08:00