diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3064df --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +*.a +*.egg +*.egg-info +*.o +*.py[co] +*.pyc +*.so +*.sqlite +.*.swp +.coverage +.installed.cfg +.testrepository +.tox +.venv +AUTHORS +ChangeLog +_build +build +cover +develop-eggs +dist +eggs +sdist + +# Sphinx documentation +doc/build + +# Release Notes documentation +releasenotes/build + +# docker registry token server vendor(dependencies) +kubernetes/registry-token-server/src/vendor/ diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..96c6067 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.opendev.org +port=29418 +project=starlingx/virt.git diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..c8bbc93 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + # 160 chars should be enough, but don't fail if a line is longer + line-length: + max: 160 + level: warning diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..1164319 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,264 @@ +--- +- project: + templates: + - publish-stx-docs + - stx-release-notes-jobs + check: + jobs: + - openstack-tox-pep8 + - openstack-tox-linters + - stx-virt-pylint + gate: + jobs: + - openstack-tox-pep8 + - openstack-tox-linters + - stx-virt-pylint + post: + jobs: + - stx-virt-upload-git-mirror + +# This is the common base job definition for StarlingX flock services +- job: + name: flock-devstack-base + parent: devstack + description: | + Base job for StarlingX Flock components DevStack tests + nodeset: openstack-single-node-bionic + roles: + - zuul: openstack/devstack + timeout: 9000 + required-projects: + - name: openstack/devstack + - name: openstack/keystone + - name: openstack/requirements + vars: + devstack_services: + ceilometer-acentral: false + ceilometer-acompute: false + ceilometer-alarm-evaluator: false + ceilometer-alarm-notifier: false + ceilometer-anotification: false + ceilometer-api: false + ceilometer-collector: false + horizon: false + # Swift services + s-account: false + s-container: false + s-object: false + s-proxy: false + tempest: false + # Database + mysql: false + postgresql: true + devstack_localrc: + # LIBS_FROM_GIT: keystone + FORCE: yes + +# A minimal base job that eliminates most OpenStack services +# Leave Celiometer, Horizon and Swift in the base since none +# of our jobs need them. +- job: + name: flock-devstack-base-min + parent: flock-devstack-base + timeout: 7800 + vars: + devstack_services: + # Cinder services + c-api: false + c-bak: false + c-sch: false + c-vol: false + cinder: false + # Glance services + g-api: false + g-reg: false + # Nova services + n-api: false + n-api-meta: false + n-cauth: false + n-cond: false + n-cpu: false + n-novnc: false + n-obj: false + n-sch: false + placement-api: false + # Neutron services + q-agt: true + q-dhcp: false + q-l3: false + q-meta: false + q-metering: false + q-svc: false + +# An equivalent tox-based functional test job to flock-devstack-base +- job: + name: flock-devstack-tox-base + parent: devstack-tox-functional + description: | + Base job for StarlingX Flock components DevStack tests that use tox + nodeset: openstack-single-node-bionic + roles: + - zuul: openstack/devstack + timeout: 9000 + required-projects: + - name: openstack/devstack + - name: openstack/keystone + - name: openstack/requirements + vars: + devstack_services: + ceilometer-acentral: false + ceilometer-acompute: false + ceilometer-alarm-evaluator: false + ceilometer-alarm-notifier: false + ceilometer-anotification: false + ceilometer-api: false + ceilometer-collector: false + horizon: false + # Swift services + s-account: false + s-container: false + s-object: false + s-proxy: false + tempest: false + # Database + mysql: false + postgresql: true + devstack_localrc: + # LIBS_FROM_GIT: keystone + FORCE: yes + +# And the tox version of the base-min job +- job: + name: flock-devstack-tox-base-min + parent: flock-devstack-tox-base + timeout: 7800 + vars: + devstack_services: + # Cinder services + c-api: false + c-bak: false + c-sch: false + c-vol: false + cinder: false + # Glance services + g-api: false + g-reg: false + # Nova services + n-api: false + n-api-meta: false + n-cauth: false + n-cond: false + n-cpu: false + n-novnc: false + n-obj: false + n-sch: false + placement-api: false + # Neutron services + q-agt: true + q-dhcp: false + q-l3: false + q-meta: false + q-metering: false + q-svc: false + +# Try this as a tox-based job with a minimal functional target in tox.ini +- job: + name: stx-virt-pylint + parent: tox + required-projects: + - starlingx/config + vars: + tox_envlist: pylint + tox_extra_args: -c tox.ini + +- job: + name: stx-virt-upload-git-mirror + parent: upload-git-mirror + description: > + Mirrors opendev.org/starlingx/virt to + github.com/starlingx/virt + vars: + git_mirror_repository: starlingx/virt + secrets: + - name: git_mirror_credentials + secret: stx-virt-github-secret + pass-to-parent: true + +- secret: + name: stx-virt-github-secret + data: + user: git + host: github.com + # yamllint disable-line rule:line-length + host_key: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== + ssh_key: !encrypted/pkcs1-oaep + - Eto97VMRX6py5MwewXqOtIlHxSDZJZb6MnO2Vj5H6iDOYUpejAYoy53y2C2nwyewYd6ME + KL3kqr5zTKQDzSvwxhwNBnGMyyzhEcE1h8UezrABBN59iB4PZqC0+MizP6pnyc2n42WUh + MHIk7xb3+bY+LIzxKDPkwmK9iHASoVEil8PqgCIqohWAhVhgTh3z2mzeyf1l9ft05c6qw + AUE9pRvi51HCh2hzdvqzna3VnhdQdA70VxeUiqXVmj8lsx8k4u3PrajYw/fWf7n3Dvrnt + 33smjojRQ7d5/E23VXG7tKCLmeHko/RhhMqrqGCeg3RxSaCfeVUI2tct/j/CWgPsnV2+B + YE2XaWTM/WaGh5JL+9l7SVCg3NCuoP+kd8Iu8+k1f0Og+eiXOiaAJPG88jPi0cvlRcexR + Ufhj5AlUm+mrRp5i13U/8RSNalxZ+4059Ism/qF+HU9VJxIabv9Y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Pc/YGt8ynXp147oRh/KwEm6KUMCltXFKapB4D6tA + WbWDcUnVokKXCCF4g1xOrXMP01LqGixm2HkQggEsMdFFDexuNTEVM2oQt/uxRE= diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..e5efca7 --- /dev/null +++ b/README.rst @@ -0,0 +1,5 @@ +===== +virt +===== + +StarlingX Virtualization diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..00bc2d2 --- /dev/null +++ b/tox.ini @@ -0,0 +1,134 @@ +[tox] +envlist = linters,pylint +minversion = 2.3 +skipsdist = True +stxdir = {toxinidir}/.. + +[testenv] +install_command = pip install -U \ + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ + {opts} {packages} +setenv = VIRTUAL_ENV={envdir} + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 +deps = -r{toxinidir}/test-requirements.txt + +[testenv:linters] +basepython = python3 +allowlist_externals = bash +# Ignore errors in included vendor code that we don't control. +#bashate ignore +#E006 Line too long +#E041 Arithmetic expansion using $[ is deprecated for $(( +#E042 local declaration hides errors +#E043 Arithmetic compound has inconsistent return semantics +#E044 Use [[ for non-POSIX comparisions +commands = + bash -c "find {toxinidir} \ + -path {toxinidir}/kubernetes/plugins/isolcpus-device-plugin/files/vendor -prune -o \ + -path {toxinidir}/tools/kexec-tools/files -prune -o \ + -not \( -type d -name .?\* -prune \) \ + -type f \ + -not -name \*~ \ + -not -name \*.md \ + -name \*.sh \ + -print0 | xargs -n 1 -0 bashate -v \ + -i E006,E041,E042,E043,E044 -e E*" + bash -c "find {toxinidir} \ + \( -path {toxinidir}/.tox \) -a -prune \ + -o -type f -name '*.yaml' \ + -print0 | xargs -0 yamllint" + +[flake8] +# E series are pep8 +# E265 block comment should start with '# ' +# E266 too many leading '#' for block comment +# E402 module level import not at top of file +# E501 line too long > 80 +# E722 do not use bare except' +# E741 ambiguous variable name +# F series +# F504 '...' % ... has unused named argument(s): +# F509 '...' % ... has unsupported format character ',' +# F841 local variable 'e' is assigned to but never used +# H series are hacking +# H101: Use TODO(NAME) +# H102 is apache license +# H104: File contains nothing but comments +# H201: no 'except:' at least use 'except Exception:' +# H238: old style class declaration, use new style +# H306: imports not in alphabetical order +# W series +# W291 trailing whitespace +# W391 blank line at end of file +# W503 line break before binary operator +# W504 line break after binary operator +# B series are from bugbear +# B001 Do not use bare `except: +# B007 Loop control variable 'cpu' not used within the loop body. +# B009 Do not call getattr with a constant attribute value +# B010 Do not call setattr with a constant attribute value +# F series +# F401 'module' imported but unused +ignore = E265,E266,E402,E501,E722,E741 + F504,F509,F841, + H101,H102,H104,H201,H238,H306, + W291,W391,W503,W504 + B001,B007,B009,B010, + F401 + +[testenv:pep8] +basepython = python3 +usedevelop = False +skip_install = True +deps = + hacking + flake8-bugbear<=19.3.0 + flake8<3.8.3 +commands = + flake8 + +[testenv:pylint] +basepython = python3 +deps = -r{toxinidir}/test-requirements.txt + -e{[tox]stxdir}/config/sysinv/cgts-client/cgts-client + pylint + +# Currently only one python module with a setup.py file +commands = pylint --rcfile=./pylint.rc \ + tools/storage-topology/storage-topology/storage_topology + +[testenv:venv] +basepython = python3 +commands = {posargs} + +[testenv:docs] +basepython = python3 +deps = -r{toxinidir}/doc/requirements.txt +commands = + rm -rf doc/build + sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html +allowlist_externals = rm + +[testenv:releasenotes] +basepython = python3 +deps = -r{toxinidir}/doc/requirements.txt +commands = + rm -rf releasenotes/build + sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html +allowlist_externals = + rm + reno + +[testenv:newnote] +basepython = python3 +# Re-use the releasenotes venv +envdir = {toxworkdir}/releasenotes +deps = -r{toxinidir}/doc/requirements.txt +commands = reno new {posargs} + +[testenv:functional] +basepython = python3 +allowlist_externals = cat +commands = cat /etc/group