From be2a3afc4c855fa5e4cbaec27c2be5bf4c29e8ff Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Tue, 28 Jun 2016 19:17:06 -0400 Subject: [PATCH] Prepare Ocata election This change also includes a new tool to automate election preparation Change-Id: I98049db7c0b665992d408c78e62e99f4a36e3a60 --- .gitignore | 3 +- candidates/ocata/Astara/.placeholder | 0 candidates/ocata/Barbican/.placeholder | 0 candidates/ocata/Chef_OpenStack/.placeholder | 0 candidates/ocata/Cinder/.placeholder | 0 candidates/ocata/Cloudkitty/.placeholder | 0 .../ocata/Community_App_Catalog/.placeholder | 0 candidates/ocata/Congress/.placeholder | 0 candidates/ocata/Designate/.placeholder | 0 candidates/ocata/Documentation/.placeholder | 0 candidates/ocata/Dragonflow/.placeholder | 0 candidates/ocata/Ec2_Api/.placeholder | 0 candidates/ocata/Freezer/.placeholder | 0 candidates/ocata/Fuel/.placeholder | 0 candidates/ocata/Glance/.placeholder | 0 candidates/ocata/Heat/.placeholder | 0 candidates/ocata/Horizon/.placeholder | 0 candidates/ocata/I18n/.placeholder | 0 candidates/ocata/Infrastructure/.placeholder | 0 candidates/ocata/Ironic/.placeholder | 0 candidates/ocata/Keystone/.placeholder | 0 candidates/ocata/Kolla/.placeholder | 0 candidates/ocata/Kuryr/.placeholder | 0 candidates/ocata/Magnum/.placeholder | 0 candidates/ocata/Manila/.placeholder | 0 candidates/ocata/Mistral/.placeholder | 0 candidates/ocata/Monasca/.placeholder | 0 candidates/ocata/Murano/.placeholder | 0 candidates/ocata/Neutron/.placeholder | 0 candidates/ocata/Nova/.placeholder | 0 .../ocata/OpenStackAnsible/.placeholder | 0 candidates/ocata/OpenStackClient/.placeholder | 0 candidates/ocata/OpenStackSalt/.placeholder | 0 .../ocata/OpenStack_Charms/.placeholder | 0 candidates/ocata/OpenStack_UX/.placeholder | 0 candidates/ocata/Oslo/.placeholder | 0 candidates/ocata/Packaging_Deb/.placeholder | 0 candidates/ocata/Packaging_Rpm/.placeholder | 0 .../ocata/Puppet_OpenStack/.placeholder | 0 .../ocata/Quality_Assurance/.placeholder | 0 candidates/ocata/Rally/.placeholder | 0 candidates/ocata/RefStack/.placeholder | 0 .../ocata/Release_Management/.placeholder | 0 candidates/ocata/Requirements/.placeholder | 0 candidates/ocata/Sahara/.placeholder | 0 candidates/ocata/Searchlight/.placeholder | 0 candidates/ocata/Security/.placeholder | 0 candidates/ocata/Senlin/.placeholder | 0 candidates/ocata/Smaug/.placeholder | 0 candidates/ocata/Solum/.placeholder | 0 .../Stable_Branch_Maintenance/.placeholder | 0 candidates/ocata/Swift/.placeholder | 0 candidates/ocata/TC/.placeholder | 0 candidates/ocata/Tacker/.placeholder | 0 candidates/ocata/Telemetry/.placeholder | 0 candidates/ocata/Tripleo/.placeholder | 0 candidates/ocata/Trove/.placeholder | 0 candidates/ocata/Vitrage/.placeholder | 0 candidates/ocata/Watcher/.placeholder | 0 candidates/ocata/Winstackers/.placeholder | 0 candidates/ocata/Zaqar/.placeholder | 0 doc/source/_exts/candidates.py | 4 +- doc/source/index.rst | 4 +- events.yaml | 16 +++--- tools/new-election.py | 43 ++++++++++++++ tools/utils.py | 57 +++++++++++++++++++ 66 files changed, 114 insertions(+), 13 deletions(-) create mode 100644 candidates/ocata/Astara/.placeholder create mode 100644 candidates/ocata/Barbican/.placeholder create mode 100644 candidates/ocata/Chef_OpenStack/.placeholder create mode 100644 candidates/ocata/Cinder/.placeholder create mode 100644 candidates/ocata/Cloudkitty/.placeholder create mode 100644 candidates/ocata/Community_App_Catalog/.placeholder create mode 100644 candidates/ocata/Congress/.placeholder create mode 100644 candidates/ocata/Designate/.placeholder create mode 100644 candidates/ocata/Documentation/.placeholder create mode 100644 candidates/ocata/Dragonflow/.placeholder create mode 100644 candidates/ocata/Ec2_Api/.placeholder create mode 100644 candidates/ocata/Freezer/.placeholder create mode 100644 candidates/ocata/Fuel/.placeholder create mode 100644 candidates/ocata/Glance/.placeholder create mode 100644 candidates/ocata/Heat/.placeholder create mode 100644 candidates/ocata/Horizon/.placeholder create mode 100644 candidates/ocata/I18n/.placeholder create mode 100644 candidates/ocata/Infrastructure/.placeholder create mode 100644 candidates/ocata/Ironic/.placeholder create mode 100644 candidates/ocata/Keystone/.placeholder create mode 100644 candidates/ocata/Kolla/.placeholder create mode 100644 candidates/ocata/Kuryr/.placeholder create mode 100644 candidates/ocata/Magnum/.placeholder create mode 100644 candidates/ocata/Manila/.placeholder create mode 100644 candidates/ocata/Mistral/.placeholder create mode 100644 candidates/ocata/Monasca/.placeholder create mode 100644 candidates/ocata/Murano/.placeholder create mode 100644 candidates/ocata/Neutron/.placeholder create mode 100644 candidates/ocata/Nova/.placeholder create mode 100644 candidates/ocata/OpenStackAnsible/.placeholder create mode 100644 candidates/ocata/OpenStackClient/.placeholder create mode 100644 candidates/ocata/OpenStackSalt/.placeholder create mode 100644 candidates/ocata/OpenStack_Charms/.placeholder create mode 100644 candidates/ocata/OpenStack_UX/.placeholder create mode 100644 candidates/ocata/Oslo/.placeholder create mode 100644 candidates/ocata/Packaging_Deb/.placeholder create mode 100644 candidates/ocata/Packaging_Rpm/.placeholder create mode 100644 candidates/ocata/Puppet_OpenStack/.placeholder create mode 100644 candidates/ocata/Quality_Assurance/.placeholder create mode 100644 candidates/ocata/Rally/.placeholder create mode 100644 candidates/ocata/RefStack/.placeholder create mode 100644 candidates/ocata/Release_Management/.placeholder create mode 100644 candidates/ocata/Requirements/.placeholder create mode 100644 candidates/ocata/Sahara/.placeholder create mode 100644 candidates/ocata/Searchlight/.placeholder create mode 100644 candidates/ocata/Security/.placeholder create mode 100644 candidates/ocata/Senlin/.placeholder create mode 100644 candidates/ocata/Smaug/.placeholder create mode 100644 candidates/ocata/Solum/.placeholder create mode 100644 candidates/ocata/Stable_Branch_Maintenance/.placeholder create mode 100644 candidates/ocata/Swift/.placeholder create mode 100644 candidates/ocata/TC/.placeholder create mode 100644 candidates/ocata/Tacker/.placeholder create mode 100644 candidates/ocata/Telemetry/.placeholder create mode 100644 candidates/ocata/Tripleo/.placeholder create mode 100644 candidates/ocata/Trove/.placeholder create mode 100644 candidates/ocata/Vitrage/.placeholder create mode 100644 candidates/ocata/Watcher/.placeholder create mode 100644 candidates/ocata/Winstackers/.placeholder create mode 100644 candidates/ocata/Zaqar/.placeholder create mode 100755 tools/new-election.py create mode 100644 tools/utils.py diff --git a/.gitignore b/.gitignore index f8f59cab..5cba9f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ ChangeLog candidates/ptl.rst candidates/tc.rst candidates/events.rst -.projects.yaml +.projects*yaml +.projects*.pkl diff --git a/candidates/ocata/Astara/.placeholder b/candidates/ocata/Astara/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Barbican/.placeholder b/candidates/ocata/Barbican/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Chef_OpenStack/.placeholder b/candidates/ocata/Chef_OpenStack/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Cinder/.placeholder b/candidates/ocata/Cinder/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Cloudkitty/.placeholder b/candidates/ocata/Cloudkitty/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Community_App_Catalog/.placeholder b/candidates/ocata/Community_App_Catalog/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Congress/.placeholder b/candidates/ocata/Congress/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Designate/.placeholder b/candidates/ocata/Designate/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Documentation/.placeholder b/candidates/ocata/Documentation/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Dragonflow/.placeholder b/candidates/ocata/Dragonflow/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Ec2_Api/.placeholder b/candidates/ocata/Ec2_Api/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Freezer/.placeholder b/candidates/ocata/Freezer/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Fuel/.placeholder b/candidates/ocata/Fuel/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Glance/.placeholder b/candidates/ocata/Glance/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Heat/.placeholder b/candidates/ocata/Heat/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Horizon/.placeholder b/candidates/ocata/Horizon/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/I18n/.placeholder b/candidates/ocata/I18n/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Infrastructure/.placeholder b/candidates/ocata/Infrastructure/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Ironic/.placeholder b/candidates/ocata/Ironic/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Keystone/.placeholder b/candidates/ocata/Keystone/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Kolla/.placeholder b/candidates/ocata/Kolla/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Kuryr/.placeholder b/candidates/ocata/Kuryr/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Magnum/.placeholder b/candidates/ocata/Magnum/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Manila/.placeholder b/candidates/ocata/Manila/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Mistral/.placeholder b/candidates/ocata/Mistral/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Monasca/.placeholder b/candidates/ocata/Monasca/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Murano/.placeholder b/candidates/ocata/Murano/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Neutron/.placeholder b/candidates/ocata/Neutron/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Nova/.placeholder b/candidates/ocata/Nova/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/OpenStackAnsible/.placeholder b/candidates/ocata/OpenStackAnsible/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/OpenStackClient/.placeholder b/candidates/ocata/OpenStackClient/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/OpenStackSalt/.placeholder b/candidates/ocata/OpenStackSalt/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/OpenStack_Charms/.placeholder b/candidates/ocata/OpenStack_Charms/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/OpenStack_UX/.placeholder b/candidates/ocata/OpenStack_UX/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Oslo/.placeholder b/candidates/ocata/Oslo/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Packaging_Deb/.placeholder b/candidates/ocata/Packaging_Deb/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Packaging_Rpm/.placeholder b/candidates/ocata/Packaging_Rpm/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Puppet_OpenStack/.placeholder b/candidates/ocata/Puppet_OpenStack/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Quality_Assurance/.placeholder b/candidates/ocata/Quality_Assurance/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Rally/.placeholder b/candidates/ocata/Rally/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/RefStack/.placeholder b/candidates/ocata/RefStack/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Release_Management/.placeholder b/candidates/ocata/Release_Management/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Requirements/.placeholder b/candidates/ocata/Requirements/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Sahara/.placeholder b/candidates/ocata/Sahara/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Searchlight/.placeholder b/candidates/ocata/Searchlight/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Security/.placeholder b/candidates/ocata/Security/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Senlin/.placeholder b/candidates/ocata/Senlin/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Smaug/.placeholder b/candidates/ocata/Smaug/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Solum/.placeholder b/candidates/ocata/Solum/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Stable_Branch_Maintenance/.placeholder b/candidates/ocata/Stable_Branch_Maintenance/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Swift/.placeholder b/candidates/ocata/Swift/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/TC/.placeholder b/candidates/ocata/TC/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Tacker/.placeholder b/candidates/ocata/Tacker/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Telemetry/.placeholder b/candidates/ocata/Telemetry/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Tripleo/.placeholder b/candidates/ocata/Tripleo/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Trove/.placeholder b/candidates/ocata/Trove/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Vitrage/.placeholder b/candidates/ocata/Vitrage/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Watcher/.placeholder b/candidates/ocata/Watcher/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Winstackers/.placeholder b/candidates/ocata/Winstackers/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/candidates/ocata/Zaqar/.placeholder b/candidates/ocata/Zaqar/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/doc/source/_exts/candidates.py b/doc/source/_exts/candidates.py index cad9d367..1707a5e9 100644 --- a/doc/source/_exts/candidates.py +++ b/doc/source/_exts/candidates.py @@ -66,8 +66,8 @@ def render_list(list_type, candidates_list): def build_lists(app): - # TODO: make newton a parameter - election = 'newton' + # TODO: make election a parameter + election = 'ocata' candidates_list = build_candidates_list(election) render_list("ptl", candidates_list) render_list("tc", candidates_list) diff --git a/doc/source/index.rst b/doc/source/index.rst index a038433e..9a7dfdaf 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -2,7 +2,7 @@ OpenStack Election ================== -.. warning:: This is a test for Newton cycle +.. warning:: This is a test for Ocata cycle .. include:: ./candidates/events.rst @@ -10,7 +10,7 @@ See PTL_details_ and TC_details_. Below is the official list of candidates for the current round. -.. include:: ./candidates/tc.rst +.. include:: ./candidates/ptl.rst Election Officials diff --git a/events.yaml b/events.yaml index 5734e0b3..bf96bf30 100644 --- a/events.yaml +++ b/events.yaml @@ -1,8 +1,8 @@ -- {'date': '2016-03-11T00:00', 'name': 'PTL nomination starts'} -- {'date': '2016-03-17T23:59', 'name': 'PTL nomination ends'} -- {'date': '2016-03-18T00:00', 'name': 'PTL elections begins'} -- {'date': '2016-03-24T23:59', 'name': 'PTL elections ends'} -- {'date': '2016-03-25T00:00', 'name': 'TC nomination starts'} -- {'date': '2016-03-31T23:59', 'name': 'TC nomination ends'} -- {'date': '2016-04-01T00:00', 'name': 'TC elections begins'} -- {'date': '2016-04-07T23:59', 'name': 'TC elections ends'} +- {'date': '2016-09-12T00:00', 'name': 'PTL nomination starts'} +- {'date': '2016-09-18T23:45', 'name': 'PTL nomination ends'} +- {'date': '2016-09-19T00:00', 'name': 'PTL elections begins'} +- {'date': '2016-09-25T23:45', 'name': 'PTL elections ends'} +- {'date': '2016-09-26T00:00', 'name': 'TC nomination starts'} +- {'date': '2016-10-01T23:45', 'name': 'TC nomination ends'} +- {'date': '2016-10-03T00:00', 'name': 'TC elections begins'} +- {'date': '2016-10-08T23:45', 'name': 'TC elections ends'} diff --git a/tools/new-election.py b/tools/new-election.py new file mode 100755 index 00000000..feb40bb0 --- /dev/null +++ b/tools/new-election.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import argparse +import os + +from utils import get_projects, name2dir + +parser = argparse.ArgumentParser() +parser.add_argument('name', help='The release cycle name') +parser.add_argument("--root", help='Election directory', default='.') +options = parser.parse_args() + +os.chdir(options.root) +if not os.path.isdir("candidates"): + print "candidates directory not found" + exit(1) + +if os.path.exists("candidates/%s" % options.name): + print "candidates/%s: directory already exists" % options.name + exit(1) + +projects = get_projects() +project_list = projects.keys() +project_list.sort() +for project in project_list + ["TC"]: + dpath = "candidates/%s/%s" % (options.name, name2dir(project)) + os.makedirs(dpath) + open("%s/.placeholder" % dpath, "w").close() + print "[+] Created %s" % dpath + +print "Done. Now please manually update events.yaml and doc/source/index.rst substitutions" diff --git a/tools/utils.py b/tools/utils.py new file mode 100644 index 00000000..3576bb9b --- /dev/null +++ b/tools/utils.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import os +import time +import urllib +import yaml +import pickle + +BASE_URL = 'https://git.openstack.org/cgit' +PROJECTS_URL = ('%s/openstack/governance/plain/reference/projects.yaml' % + (BASE_URL)) + + +def get_projects(tag=None): + url = PROJECTS_URL + cache_file = '.projects.pkl' + + if tag: + url += '?%s' % tag + cache_file = '.projects.%s.pkl' % tag + + # Refresh the cache if it's not there or if it's older than a week + if (not os.path.isfile(cache_file) or + os.stat(cache_file).st_size < 100 or + os.stat(cache_file).st_mtime + (7*24*3600) < time.time()): + print "[+] Updating %s" % cache_file + data = yaml.safe_load(urllib.urlopen(url).read()) + pickle.dump(data, open(cache_file, "w")) + + return pickle.load(open(cache_file)) + + +def name2dir(name): + """Convert project name to directory name: only [a-zA-Z_] in camelcase""" + name = name.replace(' ', '_').replace('-', '_') + return "_".join(map(lambda x: x[0].upper()+x[1:], name.split('_'))) + + +def dir2name(name, projects): + """Convert directory name to original project name""" + name = name.replace('_', '').lower() + for project_name in projects: + pname = project_name.lower().replace(' ', '').replace('-', '').lower() + if name == pname: + return project_name