This repo is not used anymore, retire it following https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project Depends-On: https://review.openstack.org/602574 Change-Id: I4f7c5a189d894270c7cdd76d62b060169031a35achanges/25/604525/1
parent
8e720cfed8
commit
0f5bfeb879
@ -1,63 +0,0 @@
|
||||
*.py[cod]
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Packages
|
||||
*.egg*
|
||||
dist
|
||||
build
|
||||
eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
develop-eggs
|
||||
lib
|
||||
lib64
|
||||
cover
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
nosetests.xml
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
# Complexity
|
||||
output/*.html
|
||||
output/*/index.html
|
||||
|
||||
# Sphinx
|
||||
doc/build
|
||||
|
||||
# pbr generates these
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
|
||||
# Editors
|
||||
*~
|
||||
*.sw?
|
||||
|
||||
# Hidden directories
|
||||
/.*
|
||||
!/.coveragerc
|
||||
!/.gitignore
|
||||
!/.gitreview
|
||||
!/.mailmap
|
||||
!/.pylintrc
|
||||
!/.testr.conf
|
||||
|
||||
contrib/vagrant/.vagrant
|
||||
|
||||
# Configuration files
|
||||
etc/fuxi.conf
|
||||
etc/fuxi.conf.sample
|
||||
|
||||
# Ignore user specific local.conf settings for vagrant
|
||||
contrib/vagrant/user_local.conf
|
||||
|
||||
# Files created by releasenotes build
|
||||
releasenotes/build
|
@ -1,4 +0,0 @@
|
||||
[DEFAULT]
|
||||
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./fuxi/tests/unit} $LISTOPT $IDOPTION | cat
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
@ -1,17 +0,0 @@
|
||||
If you would like to contribute to the development of OpenStack, you must
|
||||
follow the steps in this page:
|
||||
|
||||
https://docs.openstack.org/infra/manual/developers.html
|
||||
|
||||
If you already have a good understanding of how the system works and your
|
||||
OpenStack accounts are set up, you can skip to the development workflow
|
||||
section of this documentation to learn how changes to OpenStack should be
|
||||
submitted for review via the Gerrit tool:
|
||||
|
||||
https://docs.openstack.org/infra/manual/developers.html#development-workflow
|
||||
|
||||
Pull requests submitted through GitHub will be ignored.
|
||||
|
||||
Bugs should be filed on Launchpad, not GitHub:
|
||||
|
||||
https://bugs.launchpad.net/fuxi
|
@ -1,4 +0,0 @@
|
||||
fuxi Style Commandments
|
||||
===============================================
|
||||
|
||||
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/
|
@ -1,176 +0,0 @@
|
||||
|
||||
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.
|
||||
|
@ -1,6 +0,0 @@
|
||||
include AUTHORS
|
||||
include ChangeLog
|
||||
exclude .gitignore
|
||||
exclude .gitreview
|
||||
|
||||
global-exclude *.pyc
|
@ -1,31 +1,10 @@
|
||||
========================
|
||||
Team and repository tags
|
||||
========================
|
||||
This project is no longer maintained.
|
||||
|
||||
.. image:: https://governance.openstack.org/badges/fuxi.svg
|
||||
:target: https://governance.openstack.org/reference/tags/index.html
|
||||
The contents of this repository are still available in the Git
|
||||
source code management system. To see the contents of this
|
||||
repository before it reached its end of life, please check out the
|
||||
previous commit with "git checkout HEAD^1".
|
||||
|
||||
.. Change things from this point on
|
||||
|
||||
===============================
|
||||
fuxi
|
||||
===============================
|
||||
|
||||
Enable Docker container to use Cinder volume and Manila share
|
||||
|
||||
Fuxi focuses on enabling Docker container to use Cinder volume and Manila
|
||||
share, thus Docker volume can reuse the advance features and numerous vendor
|
||||
drivers in Cinder and Manila. With Fuxi, Cinder and Manila can be used as
|
||||
the unified persistence storage provider for virtual machine, baremetal
|
||||
and Docker container.
|
||||
|
||||
* Free software: Apache license
|
||||
* Documentation: https://docs.openstack.org/fuxi/latest/
|
||||
* Source: https://git.openstack.org/cgit/openstack/fuxi
|
||||
* Bugs: https://bugs.launchpad.net/fuxi
|
||||
* Blueprints: https://blueprints.launchpad.net/fuxi
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* TODO
|
||||
For any further questions, please email
|
||||
openstack-dev@lists.openstack.org or join #openstack-dev on
|
||||
Freenode.
|
||||
|
@ -1,24 +0,0 @@
|
||||
[[local|localrc]]
|
||||
|
||||
LOGFILE=stack.sh.log
|
||||
LOG_COLOR=False
|
||||
|
||||
DATABASE_PASSWORD=pass
|
||||
RABBIT_PASSWORD=pass
|
||||
SERVICE_PASSWORD=pass
|
||||
SERVICE_TOKEN=pass
|
||||
ADMIN_PASSWORD=pass
|
||||
|
||||
# Install kuryr git master source code by default.
|
||||
# If you want to use stable kuryr lib, please comment out this line.
|
||||
LIBS_FROM_GIT=kuryr
|
||||
|
||||
# Manila provider options
|
||||
MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=True create_share_from_snapshot_support=True revert_to_snapshot_support=True mount_snapshot_support=True'
|
||||
SHARE_DRIVER=manila.share.drivers.lvm.LVMShareDriver
|
||||
MANILA_OPTGROUP_generic1_driver_handles_share_servers=False
|
||||
|
||||
FUXI_VOLUME_PROVIDERS=cinder,manila
|
||||
enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container
|
||||
enable_plugin fuxi https://git.openstack.org/openstack/fuxi
|
||||
enable_plugin manila https://git.openstack.org/openstack/manila
|
@ -1,111 +0,0 @@
|
||||
#!/bin/bash
|
||||
# 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.
|
||||
|
||||
# Save trace setting
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
function check_docker {
|
||||
if is_ubuntu; then
|
||||
dpkg -s docker-engine > /dev/null 2>&1
|
||||
else
|
||||
rpm -q docker-engine > /dev/null 2>&1 || rpm -q docker > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
function create_fuxi_account {
|
||||
if is_service_enabled fuxi; then
|
||||
create_service_user "fuxi" "admin"
|
||||
get_or_create_service "fuxi" "fuxi" "Fuxi Service"
|
||||
fi
|
||||
}
|
||||
|
||||
function configure_fuxi {
|
||||
sudo install -d -o $STACK_USER $FUXI_CONFIG_DIR
|
||||
|
||||
(cd $FUXI_HOME && exec ./tools/generate_config_file_samples.sh)
|
||||
|
||||
cp $FUXI_HOME/etc/fuxi.conf.sample $FUXI_CONFIG
|
||||
|
||||
if is_service_enabled fuxi; then
|
||||
configure_auth_token_middleware $FUXI_CONFIG fuxi \
|
||||
$FUXI_AUTH_CACHE_DIR cinder
|
||||
configure_auth_token_middleware $FUXI_CONFIG fuxi \
|
||||
$FUXI_AUTH_CACHE_DIR manila
|
||||
|
||||
iniset $FUXI_CONFIG DEFAULT fuxi_port 7879
|
||||
iniset $FUXI_CONFIG DEFAULT my_ip $HOST_IP
|
||||
iniset $FUXI_CONFIG DEFAULT volume_providers $FUXI_VOLUME_PROVIDERS
|
||||
iniset $FUXI_CONFIG DEFAULT volume_from fuxi
|
||||
iniset $FUXI_CONFIG DEFAULT default_volume_size 1
|
||||
iniset $FUXI_CONFIG DEFAULT volume_dir /fuxi/data
|
||||
iniset $FUXI_CONFIG DEFAULT threaded true
|
||||
iniset $FUXI_CONFIG DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||
|
||||
iniset $FUXI_CONFIG cinder volume_connector osbrick
|
||||
iniset $FUXI_CONFIG cinder multiattach false
|
||||
iniset $FUXI_CONFIG cinder fstype ext4
|
||||
fi
|
||||
|
||||
write_uwsgi_config "$FUXI_UWSGI_CONF" "$FUXI_UWSGI" "" ":7879"
|
||||
}
|
||||
|
||||
|
||||
# main loop
|
||||
if is_service_enabled fuxi; then
|
||||
|
||||
if [[ "$1" == "stack" && "$2" == "install" ]]; then
|
||||
if use_library_from_git "kuryr"; then
|
||||
git_clone_by_name "kuryr"
|
||||
setup_dev_lib "kuryr"
|
||||
fi
|
||||
setup_develop $FUXI_HOME
|
||||
|
||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||
|
||||
if [[ ! -d "${FUXI_ACTIVATOR_DIR}" ]]; then
|
||||
echo -n "${FUXI_ACTIVATOR_DIR} directory is missing. Creating it... "
|
||||
sudo mkdir -p ${FUXI_ACTIVATOR_DIR}
|
||||
echo "Done"
|
||||
fi
|
||||
|
||||
if [[ ! -f "${FUXI_ACTIVATOR}" ]]; then
|
||||
echo -n "${FUXI_ACTIVATOR} is missing. Copying the default one... "
|
||||
sudo cp ${FUXI_DEFAULT_ACTIVATOR} ${FUXI_ACTIVATOR}
|
||||
echo "Done"
|
||||
fi
|
||||
|
||||
create_fuxi_account
|
||||
configure_fuxi
|
||||
|
||||
# In case iSCSI client is used
|
||||
sudo ln -s /lib/udev/scsi_id /usr/local/bin || true
|
||||
|
||||
if [[ "$USE_PYTHON3" = "True" ]]; then
|
||||
# Switch off glance->swift communication as swift fails under py3.x
|
||||
iniset /etc/glance/glance-api.conf glance_store default_store file
|
||||
fi
|
||||
|
||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||
run_process fuxi "$FUXI_BIN_DIR/uwsgi --ini $FUXI_UWSGI_CONF" "" "root"
|
||||
|
||||
fi
|
||||
|
||||
if [[ "$1" == "unstack" ]]; then
|
||||
stop_process fuxi
|
||||
remove_uwsgi_config "$FUXI_UWSGI_CONF" "$FUXI_UWSGI"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
@ -1,29 +0,0 @@
|
||||
FUXI_HOME=${FUXI_HOME:-$DEST/fuxi}
|
||||
FUXI_ACTIVATOR_FILENAME=fuxi.spec
|
||||
FUXI_DEFAULT_ACTIVATOR=${FUXI_HOME}/etc/${FUXI_ACTIVATOR_FILENAME}
|
||||
|
||||
# See libnetwork's plugin discovery mechanism:
|
||||
# https://github.com/docker/docker/blob/c4d45b6a29a91f2fb5d7a51ac36572f2a9b295c6/docs/extend/plugin_api.md#plugin-discovery
|
||||
FUXI_ACTIVATOR_DIR=${FUXI_ACTIVATOR_DIR:-/usr/lib/docker/plugins/fuxi}
|
||||
FUXI_ACTIVATOR=${FUXI_ACTIVATOR_DIR}/${FUXI_ACTIVATOR_FILENAME}
|
||||
|
||||
FUXI_CONFIG_FILENAME=fuxi.conf
|
||||
FUXI_DEFAULT_CONFIG=${FUXI_HOME}/etc/${FUXI_CONFIG_FILENAME}
|
||||
FUXI_CONFIG_DIR=${FUXI_CONFIG_DIR:-/etc/fuxi}
|
||||
FUXI_CONFIG=${FUXI_CONFIG_DIR}/${FUXI_CONFIG_FILENAME}
|
||||
FUXI_AUTH_CACHE_DIR=${FUXI_AUTH_CACHE_DIR:-/var/cache/fuxi}
|
||||
|
||||
FUXI_DOCKER_ENGINE_PORT=${FUXI_DOCKER_ENGINE_PORT:-2375}
|
||||
FUXI_VOLUME_PROVIDERS=${FUXI_VOLUME_PROVIDERS:-cinder,manila}
|
||||
|
||||
FUXI_BIN_DIR=$(get_python_exec_prefix)
|
||||
FUXI_UWSGI=$FUXI_BIN_DIR/fuxi-server-wsgi
|
||||
FUXI_UWSGI_CONF=$FUXI_CONFIG_DIR/fuxi-server-uwsgi.ini
|
||||
|
||||
DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-etcd://$SERVICE_HOST:$ETCD_PORT}
|
||||
|
||||
GITREPO["kuryr"]=${KURYR_REPO:-${GIT_BASE}/openstack/kuryr.git}
|
||||
GITBRANCH["kuryr"]=${KURYR_BRANCH:-master}
|
||||
GITDIR["kuryr"]=$DEST/kuryr
|
||||
|
||||
enable_service fuxi etcd3 docker-engine
|
@ -1,73 +0,0 @@
|
||||
# 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 sys
|
||||
|
||||
sys.path.insert(0, os.path.abspath('../..'))
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'oslosphinx'
|
||||
]
|
||||
|
||||
# autodoc generation is a bit aggressive and a nuisance when doing heavy
|
||||
# text edit cycles.
|
||||
# execute "export SPHINX_DEBUG=1" in your terminal to disable
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'fuxi'
|
||||
copyright = u'2013, OpenStack Foundation'
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
add_module_names = True
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# -- Options for HTML output --------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. Major themes that come with
|
||||
# Sphinx are currently 'default' and 'sphinxdoc'.
|
||||
# html_theme_path = ["."]
|
||||
# html_theme = '_theme'
|
||||
# html_static_path = ['static']
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = '%sdoc' % project
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass
|
||||
# [howto/manual]).
|
||||
latex_documents = [
|
||||
('index',
|
||||
'%s.tex' % project,
|
||||
u'%s Documentation' % project,
|
||||
u'OpenStack Foundation', 'manual'),
|
||||
]
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
# intersphinx_mapping = {'http://docs.python.org/': None}
|
@ -1,4 +0,0 @@
|
||||
============
|
||||
Contributing
|
||||
============
|
||||
.. include:: ../../CONTRIBUTING.rst
|
@ -1,92 +0,0 @@
|
||||
..
|
||||
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.
|
||||
|
||||
|
||||
Cinder provider
|
||||
===============
|
||||
|
||||
Cinder volume provider enables Fuxi create volume from OpenStack Cinder and
|
||||
provides them to Docker containers.
|
||||
|
||||
Cinder provider configuration setttings
|
||||
---------------------------------------
|
||||
|
||||
The following parameters in `cinder` group need to be set:
|
||||
|
||||
- `region_name` = <used to pick the URL from the service catalog>
|
||||
- `volume_connector` = <the way to connect or disconect volume. default
|
||||
`osbrick`, only could chose from [osbrick, openstack]>
|
||||
- `fstype` = <the filesystem type for formatting connected block device.
|
||||
default `ext4`>
|
||||
- `multiattach` = <the volume is enabled to attached to multi-host.
|
||||
deafult `False`>
|
||||
|
||||
.. note::
|
||||
|
||||
* If want to use keystone v3, please set authtoken configuration in group
|
||||
`cinder` or other group with `auth_section` marking it.
|
||||
|
||||
* `multiattach` must be setting properly according to the enabled volume
|
||||
driver backends in Cinder.
|
||||
|
||||
|
||||
Supported connectors
|
||||
--------------------
|
||||
- osbrick: fuxi.connector.osbrickconnector.CinderConnector
|
||||
- openstack: fuxi.connector.cloudconnector.openstack.CinderConnector
|
||||
|
||||
Connector osbrick
|
||||
-----------------
|
||||
osbrick connector uses OpenStack library package `os-brick`_ to manage the
|
||||
connection with Cinder volume.
|
||||
With this connector, `fuxi-server` could run in baremetal or VM normally.
|
||||
|
||||
Requirements
|
||||
~~~~~~~~~~~~
|
||||
- Install related client for connecting Cinder volume.
|
||||
eg: open-iscsi, nfs-common.
|
||||
- When iSCSI client used and `fuxi-server` is running in root user, must make
|
||||
a link for executable file `/lib/udev/scsi_id`
|
||||
::
|
||||
|
||||
ln -s /lib/udev/scsi_id /usr/local/bin
|
||||
|
||||
|
||||
Connector openstack
|
||||
-------------------
|
||||
|
||||
This connector is only supported when running the containers inside OpenStack
|
||||
Nova instances due to its usage of OpenStack Nova API 'connect' and 'disconnet'
|
||||
verbs.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
The example for creating volume from Cinder with Docker volume command:
|
||||
|
||||
::
|
||||
|
||||
docker volume create --driver fuxi --name <vol_name> \
|
||||
--opt size=1 \
|
||||
--opt fstype=ext4 \
|
||||
--opt multiattach=true
|
||||
|
||||
Use existing Cinder volume:
|
||||
|
||||
::
|
||||
|
||||
docker volume create --driver fuxi --name test_vol \
|
||||
--opt size=1 \
|
||||
--opt volume_id=<volume_id>
|
||||
|
||||
.. _os-brick: https://github.com/openstack/os-brick
|
@ -1,28 +0,0 @@
|
||||
..
|
||||
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.
|
||||
|
||||
|
||||
|
||||
Developer Guide
|
||||
===============
|
||||
|
||||
Volume providers
|
||||
----------------
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
cinder_provider
|
||||
manila_provider
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`search`
|
@ -1,101 +0,0 @@
|
||||
..
|
||||
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.
|
||||
|
||||
Manila provider
|
||||
===============
|
||||
|
||||
Manila volume provider enables Fuxi create share from OpenStack Manila and
|
||||
provides them to Docker containers.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
- Install the related client according the driver backends that Manila
|
||||
used for mounting the remote filesystem.
|
||||
|
||||
|
||||
Manila provider configuration settings
|
||||
--------------------------------------
|
||||
|
||||
The following parameters in `manila` group need to be set:
|
||||
|
||||
- `region_name` = <used to pick the URL from the service catalog>
|
||||
|
||||
The following configuration parameters are options:
|
||||
|
||||
- `volume_connector` = osbrick
|
||||
- `share_proto` = <default share protocol used to grant access>
|
||||
- `proto_access_type_map` = <the mapping of protocol access
|
||||
that manila enabled>
|
||||
- `access_to_for_cert` = <the value of key `access_to` when Manila use
|
||||
`access_type` `CERT` to allow access for visitors>
|
||||
|
||||
.. note::
|
||||
|
||||
If want to use keystone v3, please set authtoken configuration in group
|
||||
`manila` or other group with `auth_section` marking it.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Set `volume_providers = manila` in group `DEFAULT` to use Manila volume
|
||||
provider.
|
||||
|
||||
For different backends that manila enabled, we need to provide different
|
||||
parameter to create volume(share) from Manila.
|
||||
|
||||
The following are some examples.
|
||||
|
||||
- If using `generic` driver in Manila, `share_network` should be provided;
|
||||
|
||||
::
|
||||
|
||||
docker volume create --driver fuxi --name <vol_name> \
|
||||
--opt share_network=<share_network_id>
|
||||
|
||||
- If using `glusterfs` driver in Manila, `share_type` should be provided;
|
||||
|
||||
::
|
||||
|
||||
docker volume create --driver fuxi --name <volume_name> \
|
||||
--opt share_type=<share_type_id>
|
||||
|
||||
- If using `glusterfs_native` driver in Manila, `share_type` and `share_proto`
|
||||
need be provided;
|
||||
|
||||
::
|
||||
|
||||
docker volume create --driver fuxi --name <vol_name> \
|
||||
--opt share_type=<share_type_id> \
|
||||
--opt share_proto=glusterfs
|
||||
|
||||
|
||||
Using existing Manila share:
|
||||
|
||||
::
|
||||
|
||||
docker volume create --driver fuxi --name <vol_name> \
|
||||
--opt volume_id=<share_id>
|
||||
|
||||
.. note::
|
||||
|
||||
The parameter `--opt volume_provider=manila` is needed, if you want
|
||||
use Manila volume provider when multi volume providers are enabled and
|
||||
`manila` is not the first one.
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
* `Manila share features support mapping`_
|
||||
|
||||
.. _Manila share features support mapping: https://docs.openstack.org/manila/latest/devref/share_back_ends_feature_support_mapping.html
|
@ -1,50 +0,0 @@
|
||||
==========================
|
||||
Run fullstack test locally
|
||||
==========================
|
||||
|
||||
This is a guide for developers who want to run fullstack tests in their local
|
||||
machine.
|
||||
|
||||
Prerequisite
|
||||
============
|
||||
|
||||
You need to deploy Fuxi in a devstack environment.
|
||||
|
||||
Clone devstack::
|
||||
|
||||
# Create a root directory for devstack if needed
|
||||
sudo mkdir -p /opt/stack
|
||||
sudo chown $USER /opt/stack
|
||||
|
||||
git clone https://git.openstack.org/openstack-dev/devstack /opt/stack/devstack
|
||||
|
||||
We will run devstack with minimal local.conf settings required. You can use the
|
||||
sample local.conf as a quick-start::
|
||||
|
||||
git clone https://git.openstack.org/openstack/fuxi /opt/stack/fuxi
|
||||
cp /opt/stack/fuxi/devstack/local.conf.sample /opt/stack/devstack/local.conf
|
||||
|
||||
Run devstack::
|
||||
|
||||
cd /opt/stack/devstack
|
||||
./stack.sh
|
||||
|
||||
**NOTE:** This will take a while to setup the dev environment.
|
||||
|
||||
Preparation
|
||||
===========
|
||||
|
||||
Navigate to fuxi directory::
|
||||
|
||||
cd /opt/stack/fuxi
|
||||
|
||||
Source the credential of 'fuxi' user::
|
||||
|
||||
source /opt/stack/devstack/openrc fuxi service
|
||||
|
||||
Run the test
|
||||
============
|
||||
|
||||
Run this command::
|
||||
|
||||
tox -efullstack
|
@ -1,34 +0,0 @@
|
||||
.. fuxi documentation master file, created by
|
||||
sphinx-quickstart on Tue Jul 9 22:26:36 2013.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to fuxi's documentation!
|
||||
================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
readme
|
||||
installation
|
||||
usage
|
||||
contributing
|
||||
reno
|
||||
fullstack-test
|
||||
|
||||
Developer Docs
|
||||
==============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
devref/index
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`search`
|
||||
|
@ -1,133 +0,0 @@
|
||||
============
|
||||
Installation
|
||||
============
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
* Install possibly required package for deploying Fuxi or running `fuxi-server`.
|
||||
|
||||
Ubuntu
|
||||
|
||||
::
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install python-dev git libffi-dev libssl-dev gcc
|
||||
$ sudo apt-get install open-iscsi # Install when using iSCSI client to connect remote volume
|
||||
$ sudo apt-get install sysfsutils # Install when os_brick package and iSCSI client used
|
||||
|
||||
CentOS
|
||||
|
||||
::
|
||||
|
||||
$ sudo yum -y install python-devel git gcc openssl-devel
|
||||
$ sudo yum install iscsi-initiator-utils # Install when using iSCSI client to connect remote volume
|
||||
$ sudo yum install sysfsutils # Install when os_brick package and iSCSI client used
|
||||
|
||||
* Install requirements.
|
||||
|
||||
::
|
||||
|
||||
$ curl https://bootstrap.pypa.io/get-pip.py | sudo python
|
||||
$ git clone https://github.com/openstack/fuxi.git
|
||||
$ cd fuxi
|
||||
$ sudo pip install -r requirements.txt
|
||||
|
||||
|
||||
If `fuxi-server` run with non-root user, it is expected to enable `fuxi-server` to execute some Linux command without password interact.
|
||||
|
||||
Installing Fuxi
|
||||
---------------
|
||||
|
||||
::
|
||||
|
||||
$ sudo python setup.py install
|
||||
|
||||
Configuring Fuxi
|
||||
----------------
|
||||
|
||||
After installing Fuxi, generate sample config, etc/fuxi.conf.sample, running the following:
|
||||
|
||||
::
|
||||
|
||||
$ ./tools/generate_config_file_samples.sh
|
||||
|
||||
Rename and copy config file at required path:
|
||||
|
||||
::
|
||||
|
||||
$ sudo cp etc/fuxi.conf.sample /etc/fuxi/fuxi.conf
|
||||
|
||||
Then edit it.
|
||||
|
||||
* Default section
|
||||
|
||||
::
|
||||
|
||||
[DEFAULT]
|
||||
my_ip = MY_IP # The IP of host that Fuxi deployed on
|
||||
volume_providers = cinder # The enable volume provider for Fuxi
|
||||
|
||||
* Cinder section
|
||||
|
||||
::
|
||||
|
||||
[cinder]
|
||||
region_name = REGION_NAME # Region name of this node. This is used when picking the URL in the service catalog.
|
||||
auth_url = AUTH_URL # For example, it can be http://127.0.0.1:35357/v3/
|
||||
username = ADMIN_USER
|
||||
user_domain_name = Default
|
||||
password = ADMIN_PASSWORD
|
||||
project_name = service
|
||||
project_domain_name = Default
|
||||
auth_type = password
|
||||
volume_connector = VOLUME_CONNECTOR # The way to connect to volume. For Cinder, this could chose from `[openstack, osbrick]`
|
||||
fstype = ext4 # Default filesystem type to format, if not provided from request
|
||||
|
||||
* Nova section
|
||||
|
||||
::
|
||||
|
||||
[nova]
|
||||
region_name = REGION_NAME # Region name of this node. This is used when picking the URL in the service catalog.
|
||||
auth_url = AUTH_URL # For example, it can be http://127.0.0.1:35357/v3/
|
||||
username = ADMIN_USER
|
||||
user_domain_name = Default
|
||||
password = ADMIN_PASSWORD
|
||||
project_name = service
|
||||
project_domain_name = Default
|
||||
auth_type = password
|
||||
|
||||
Running Fuxi
|
||||
------------
|
||||
Fuxi could run with root user permission or non-root use permission. In order to make `fuxi-server` working normally, some extra config is inevitable.
|
||||
|
||||
For root user, when iSCSI client is used
|
||||
|
||||
::
|
||||
|
||||
$ ln -s /lib/udev/scsi_id /usr/local/bin
|
||||
|
||||
For non-root user
|
||||
|
||||
::
|
||||
|
||||
$ echo "fuxi ALL=(root) NOPASSWD: /usr/local/bin/fuxi-rootwrap /etc/fuxi/rootwrap.conf *" | sudo tee /etc/sudoers.d/fuxi-rootwrap
|
||||
|
||||
Here user `fuxi` should be changed to the user run `fuxi-server` on your host.
|
||||
|
||||
Start `fuxi-server`
|
||||
::
|
||||
|
||||
$ fuxi-server --config-file /etc/fuxi/fuxi.conf
|
||||
|
||||
Testing Fuxi
|
||||
------------
|
||||
|
||||
::
|
||||
|
||||
$ docker volume create --driver fuxi --name test_vol -o size=1 -o fstype=ext4 -o multiattach=true
|
||||
test_vol
|
||||
$ docker volume ls
|
||||
DRIVER VOLUME NAME
|
||||
fuxi test_vol
|
@ -1 +0,0 @@
|
||||
.. include:: ../../README.rst
|
@ -1,59 +0,0 @@
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
What is reno ?
|
||||
--------------
|
||||
|
||||
Fuxi uses `reno <https://docs.openstack.org/reno/latest/user/usage.html>`_ for
|
||||
providing release notes in-tree. That means that a patch can include a *reno
|
||||
file* or a series can have a follow-on change containing that file explaining
|
||||
what the impact is.
|
||||
|
||||
A *reno file* is a YAML file written in the releasenotes/notes tree which is
|
||||
generated using the reno tool this way:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ tox -e venv -- reno new <name-your-file>
|
||||
|
||||
where usually ``<name-your-file>`` can be ``bp-<blueprint_name>`` for a
|
||||
blueprint or ``bug-XXXXXX`` for a bugfix.
|
||||
|
||||
Refer to the `reno documentation <https://docs.openstack.org/reno/latest/user/usage.html#editing-a-release-note>`_
|
||||
for the full list of sections.
|
||||
|
||||
|
||||
When a release note is needed
|
||||
-----------------------------
|
||||
|
||||
A release note is required anytime a reno section is needed. Below are some
|
||||
examples for each section. Any sections that would be blank should be left out
|
||||
of the note file entirely. If no section is needed, then you know you don't
|
||||
need to provide a release note :-)
|
||||
|
||||
* ``upgrade``
|
||||
* The patch has an `UpgradeImpact <http://docs.openstack.org/infra/manual/developers.html#peer-review>`_ tag
|
||||
* A DB change needs some deployer modification (like a migration)
|
||||
* A configuration option change (deprecation, removal or modified default)
|
||||
* some specific changes that have a `DocImpact <http://docs.openstack.org/infra/manual/developers.html#peer-review>`_ tag
|
||||
but require further action from an deployer perspective
|
||||
* any patch that requires an action from the deployer in general
|
||||
|
||||
* ``security``
|
||||
* If the patch fixes a known vulnerability
|
||||
|
||||
* ``features``
|
||||
* If the patch has an `APIImpact <http://docs.openstack.org/infra/manual/developers.html#peer-review>`_ tag
|
||||
|
||||
* ``critical``
|
||||
* Bugfixes categorized as Critical in Launchpad *impacting users*
|
||||
|
||||
* ``fixes``
|
||||
* No clear definition of such bugfixes. Hairy long-standing bugs with high
|
||||
importance that have been fixed are good candidates though.
|
||||
|
||||
|
||||
Three sections are left intentionally unexplained (``prelude``, ``issues`` and
|
||||
``other``). Those are targeted to be filled in close to the release time for
|
||||
providing details about the soon-ish release. Don't use them unless you know
|
||||
exactly what you are doing.
|
@ -1,7 +0,0 @@
|
||||
========
|
||||
Usage
|
||||
========
|
||||
|
||||
To use fuxi in a project::
|
||||
|
||||
import fuxi
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"Name": "fuxi",
|
||||
"Addr": "http://127.0.0.1:7879"
|
||||
}
|
@ -1 +0,0 @@
|
||||
http://127.0.0.1:7879
|
@ -1,4 +0,0 @@
|
||||
[DEFAULT]
|
||||
output_file = etc/fuxi.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = fuxi
|
@ -1,27 +0,0 @@
|
||||
# Configuration for fuxi-rootwrap
|
||||
# This file should be owned by (and only-writable by) the root user
|
||||
|
||||
[DEFAULT]
|
||||
# List of directories to load filter definitions from (separated by ',').
|
||||
# These directories MUST all be only writable by root !
|
||||
filters_path=/etc/fuxi/rootwrap.d
|
||||
|
||||
# List of directories to search executables in, in case filters do not
|
||||
# explicitely specify a full path (separated by ',')
|
||||
# If not specified, defaults to system PATH environment variable.
|
||||
# These directories MUST all be only writable by root !
|
||||
exec_dirs=/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin
|
||||
|
||||
# Enable logging to syslog
|
||||
# Default value is False
|
||||
use_syslog=False
|
||||
|
||||
# Which syslog facility to use.
|
||||
# Valid values include auth, authpriv, syslog, local0, local1...
|
||||
# Default value is 'syslog'
|
||||
syslog_log_facility=syslog
|
||||
|
||||
# Which messages to log.
|
||||
# INFO means log all usage
|
||||
# ERROR means only log unsuccessful attempts
|
||||
syslog_log_level=ERROR
|
@ -1,31 +0,0 @@
|
||||
# fuxi-rootwrap command filters
|
||||
# This file should be owned by (and only-writeable by) the root user
|
||||
|
||||
[Filters]
|
||||
# os-brick library commands
|
||||
# os_brick.privileged.run_as_root oslo.privsep context
|
||||
# This line ties the superuser privs with the config files, context name,
|
||||
# and (implicitly) the actual python code invoked.
|
||||
privsep-rootwrap: RegExpFilter, privsep-helper, root, privsep-helper, --config-file, /etc/(?!\.\.).*, --privsep_context, os_brick.privileged.default, --privsep_sock_path, /tmp/.*
|
||||
# The following and any cinder/brick/* entries should all be obsoleted
|
||||
# by privsep, and may be removed once the os-brick version requirement
|
||||
# is updated appropriately.
|
||||
scsi_id: CommandFilter, /lib/udev/scsi_id, root
|
||||
drbdadm: CommandFilter, drbdadm, root
|
||||
iscsiadm: CommandFilter, iscsiadm, root
|
||||
sg_scan: CommandFilter, sg_scan, root
|
||||
systool: CommandFilter, systool, root
|
||||
cat: CommandFilter, cat, root
|
||||
|
||||
# fuxi/connector/cloudconnector/openstack.py
|
||||
ln: CommandFilter, ln, root
|
||||
|
||||
# fuxi/blockdevice.py
|
||||
mount: CommandFilter, mount, root
|
||||
umount: CommandFilter, umount, root
|
||||
mkfs: CommandFilter, mkfs, root
|
||||
|
||||
mkdir: CommandFilter, mkdir, root
|
||||
tee: CommandFilter, tee, root
|
||||
ls: CommandFilter, ls, root
|
||||
rm: CommandFilter, rm, root
|
@ -1,15 +0,0 @@
|
||||
# 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.
|
||||
|
||||
from fuxi import utils
|
||||
|
||||
app = utils.make_json_app(__name__)
|
@ -1,35 +0,0 @@
|
||||
# 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 glob
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import units
|
||||
|
||||
from fuxi import exceptions
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BlockerDeviceManager(object):
|
||||
def device_scan(self):
|
||||
return glob.glob('/sys/block/*')
|
||||
|
||||
def get_device_size(self, device):
|
||||
try:
|
||||
nr_sectors = open(device + '/size').read().rstrip('\n')
|
||||
sect_size = open(device + '/queue/hw_sector_size')\
|
||||
.read().rstrip('\n')
|
||||
return (float(nr_sectors) * float(sect_size)) / units.Gi
|
||||
except IOError as e:
|
||||
LOG.error("Failed to read device size. %s", str(e))
|
||||
raise exceptions.FuxiException(str(e))
|
@ -1,187 +0,0 @@
|
||||
# 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
|
||||
|
||||
from kuryr.lib import config as kuryr_config
|
||||
from kuryr.lib import opts as kuryr_opts
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from fuxi.i18n import _
|
||||
from fuxi.version import version_info
|
||||
|
||||
default_opts = [
|
||||
cfg.HostAddressOpt('my_ip',
|
||||
help=_('IP address of this machine.')),
|
||||
cfg.IntOpt('fuxi_port',
|
||||
default=7879,
|
||||
help=_('Port for fuxi volume driver server.')),
|
||||
cfg.StrOpt('volume_dir',
|
||||
default='/fuxi/data',
|
||||
help=_('At which the docker volume will create.')),
|
||||
cfg.ListOpt('volume_providers',
|
||||
help=_('Volume storage backends that provide volume for '
|
||||
'Docker')),
|
||||
cfg.StrOpt('volume_from',
|
||||
default='fuxi',
|
||||
help=_('Setting label for volume.')),
|
||||
cfg.IntOpt('default_volume_size',
|
||||
default=1,
|
||||
help=_('Default size for volume.')),
|
||||
cfg.BoolOpt('threaded',
|
||||
default=True,
|
||||
help=_('Make this volume plugin run in multi-thread.')),
|
||||
cfg.StrOpt('rootwrap_config',
|
||||
default='/etc/fuxi/rootwrap.conf',
|
||||
help=_('Path to the rootwrap configuration file to use for '
|
||||
'running commands as root.')),
|
||||
]
|
||||
|
||||
keystone_group = cfg.OptGroup(
|
||||
'keystone',
|
||||
title='Keystone Options',
|
||||
help=_('Configuration options for OpenStack Keystone'))
|
||||
|
||||
legacy_keystone_opts = [
|
||||
cfg.StrOpt('region',
|
||||
default=os.environ.get('REGION'),
|
||||
help=_('The region that this machine belongs to.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('auth_url',
|
||||
default=os.environ.get('IDENTITY_URL'),
|
||||
help=_('The URL for accessing the identity service.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('admin_user',
|
||||
default=os.environ.get('SERVICE_USER'),
|
||||
help=_('The username to auth with the identity service.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('admin_tenant_name',
|
||||
default=os.environ.get('SERVICE_TENANT_NAME'),
|
||||
help=_('The tenant name to auth with the identity service.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('admin_password',
|
||||
default=os.environ.get('SERVICE_PASSWORD'),
|
||||
help=_('The password to auth with the identity service.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('admin_token',
|
||||
default=os.environ.get('SERVICE_TOKEN'),
|
||||
help=_('The admin token.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('auth_ca_cert',
|
||||
default=os.environ.get('SERVICE_CA_CERT'),
|
||||
help=_('The CA certification file.'),
|
||||
deprecated_for_removal=True),
|
||||
cfg.BoolOpt('auth_insecure',
|
||||
default=True,
|
||||
help=_("Turn off verification of the certificate for ssl."),
|
||||
deprecated_for_removal=True),
|
||||
]
|
||||
|
||||
cinder_group = cfg.OptGroup(
|
||||
'cinder',
|
||||
title='Cinder Options',
|
||||
help=_('Configuration options for OpenStack Cinder'))
|
||||
|
||||
cinder_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
default=os.environ.get('REGION'),
|
||||
help=_('Region name of this node. This is used when picking'
|
||||
' the URL in the service catalog.')),
|
||||
cfg.StrOpt('volume_connector',
|
||||
default='osbrick',
|
||||
help=_('Volume connector for attach volume to this server, '
|
||||
'or detach volume from this server.')),
|
||||
cfg.StrOpt('availability_zone',
|
||||
default=None,
|
||||
help=_('AZ in which the current machine creates, '
|
||||
'and volume is going to create.')),
|
||||
cfg.StrOpt('volume_type',
|
||||
default=None,
|
||||
help=_('Volume type to create volume.')),
|
||||
cfg.StrOpt('fstype',
|
||||
default='ext4',
|
||||
help=_('Default filesystem type for volume.')),
|
||||
cfg.BoolOpt('multiattach',
|
||||
default=False,
|
||||
help=_('Allow the volume to be attached to more than '
|
||||
'one instance.')),
|
||||
cfg.BoolOpt('all_tenants',
|
||||
default=True,
|
||||
help=_('Allow access over all tenants by provided auth'))
|
||||
]
|
||||
|
||||
nova_group = cfg.OptGroup(
|
||||
'nova',
|
||||
title='Nova Options',
|
||||
help=_('Configuration options for OpenStack Nova'))
|
||||
|
||||
nova_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
default=os.environ.get('REGION'),
|
||||
help=_('Region name of this node. This is used when picking'
|
||||
' the URL in the service catalog.'))
|
||||
]
|
||||
|
||||
manila_group = cfg.OptGroup(
|
||||
'manila',
|
||||
title='Manila Options',
|
||||
help=_('Configuration options for OpenStack Manila'))
|
||||
|
||||
manila_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
default=os.environ.get('REGION'),
|
||||
help=_('Region name of this node. This is used when picking'
|
||||
' the URL in the service catalog.')),
|
||||
cfg.StrOpt('volume_connector',
|
||||
default='osbrick',
|
||||
help=_('Volume connector for attach share to this server, '
|
||||
'or detach share from this server.')),
|
||||
cfg.StrOpt('share_proto',
|
||||
default='NFS',
|
||||
help=_('Default protocol for manila share.')),
|
||||
cfg.DictOpt('proto_access_type_map',
|
||||
default={},
|
||||
help=_('Set the access type for client to access share.')),
|
||||
cfg.StrOpt('availability_zone',
|
||||
default=None,
|
||||
help=_('AZ in which the share is going to create.')),
|
||||
cfg.StrOpt('access_to_for_cert',
|
||||
default='',
|
||||
help=_('The value to access share for access_type cert.'))
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(default_opts)
|
||||
CONF.register_opts(legacy_keystone_opts, group=keystone_group.name)
|
||||
CONF.register_opts(cinder_opts, group=cinder_group.name)
|
||||
CONF.register_opts(nova_opts, group=nova_group.name)
|
||||
|
||||
CONF.register_group(manila_group)
|
||||
CONF.register_opts(manila_opts, group=manila_group)
|
||||
kuryr_config.register_keystoneauth_opts(CONF, manila_group.name)
|
||||
|
||||
# Settting options for Keystone.
|
||||
kuryr_config.register_keystoneauth_opts(CONF, cinder_group.name)
|
||||
CONF.set_default('auth_type', default='password', group=cinder_group.name)
|
||||
|
||||
kuryr_config.register_keystoneauth_opts(CONF, nova_group.name)
|
||||
|
||||
keystone_auth_opts = kuryr_opts.get_keystoneauth_conf_options()
|
||||
|
||||
# Setting oslo.log options for logging.
|
||||
logging.register_options(CONF)
|
||||
|
||||
|
||||
def init(args, **kwargs):
|
||||
cfg.CONF(args=args, project='fuxi',
|
||||
version=version_info.release_string(), **kwargs)
|
@ -1,63 +0,0 @@
|
||||
# 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.
|
||||
|
||||
VOLUME_FROM = 'volume_from'
|
||||
DOCKER_VOLUME_NAME = 'docker_volume_name'
|
||||
|
||||
# Volume states
|
||||
UNKNOWN = 'unknown'
|
||||
NOT_ATTACH = 'not_attach'
|
||||
ATTACH_TO_THIS = 'attach_to_this'
|
||||
ATTACH_TO_OTHER = 'attach_to_other'
|
||||
|
||||
# If volume_provider is cinder, and if cinder volume is attached to this server
|
||||
# by Nova, a link file will create under this directory to match attached
|
||||
# volume. Of course, creating link file will decrease interact time
|
||||
# with backend providers in some cases.
|
||||
VOLUME_LINK_DIR = '/dev/disk/by-id/'
|
||||
|
||||
# General scanning interval for some operation.
|
||||
SCAN_INTERVAL = 0.3
|
||||
|
||||
# Volume scanning interval
|
||||
VOLUME_SCAN_TIME_DELAY = 0.3
|
||||
|
||||
# Timeout for destroying volume from backend provider
|
||||
DESTROY_VOLUME_TIMEOUT = 300
|
||||
|
||||
# Timeout for monitoring volume status
|
||||
MONITOR_STATE_TIMEOUT = 600
|
||||
|
||||
# Device scan interval
|
||||
DEVICE_SCAN_TIME_DELAY = 0.3
|
||||
|
||||
# Timeout for scanning device
|
||||
DEVICE_SCAN_TIMEOUT = 10
|
||||
|
||||
# Timeout for querying meta-data from localhost
|
||||
CURL_MD_TIMEOUT = 10
|
||||
|
||||
# Manila
|
||||
# Manila share scanning interval
|
||||
SHARE_SCAN_INTERVAL = 0.3
|
||||
|
||||
# Manila share network scanning interval
|
||||
SHARE_NETWORK_SCAN_INTERVAL = 0.3
|
||||
|
||||
# TIMEOUT for destroying share from Manila
|
||||
DESTROY_SHARE_TIMEOUT = 300
|
||||
|
||||
# TIMEOUT for destroying share network from Manila
|
||||
DESTROY_SHARE_NETWORK_TIMEOUT = 300
|
||||
|
||||
# Timeout for revoke access to Manila share for host
|
||||
ACCSS_DENY_TIMEOUT = 300
|
@ -1,152 +0,0 @@
|
||||
# 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.
|
||||
|
||||
from fuxi import exceptions
|
||||
from fuxi.i18n import _
|
||||
from fuxi import utils
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
proc_mounts_path = '/proc/mounts'
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MountInfo(object):
|
||||
def __init__(self, device, mountpoint, fstype, opts):
|
||||
self.device = device
|
||||
self.mountpoint = mountpoint
|
||||
self.fstype = fstype
|
||||
self.opts = opts
|
||||
|
||||
def __repr__(self, *args, **kwargs):
|
||||
return str(self.__dict__)
|
||||
|
||||
|
||||
class Mounter(object):
|
||||
def make_filesystem(self, devpath, fstype):
|
||||
try:
|
||||
utils.execute('mkfs', '-t', fstype, '-F', devpath,
|
||||
run_as_root=True)
|
||||
except processutils.ProcessExecutionError as e:
|
||||
msg = _("Unexpected error while make filesystem. "
|
||||
"Devpath: {0}, "
|
||||
"Fstype: {1}"
|
||||
"Error: {2}").format(devpath, fstype, e)
|
||||
raise exceptions.MakeFileSystemException(msg)
|
||||
|
||||
def mount(self, devpath, mountpoint, fstype=None):
|
||||
try:
|
||||
if fstype:
|
||||
utils.execute('mount', '-t', fstype, devpath, mountpoint,
|
||||
run_as_root=True)
|
||||
else:
|
||||
utils.execute('mount', devpath, mountpoint,
|
||||
run_as_root=True)
|
||||
except processutils.ProcessExecutionError as e:
|
||||
msg = _("Unexpected error while mount block device. "
|
||||
"Devpath: {0}, "
|
||||
"Mountpoint: {1} "
|
||||
"Error: {2}").format(devpath, mountpoint, e)
|
||||
raise exceptions.MountException(msg)
|
||||
|
||||
def unmount(self, mountpoint):
|
||||
try:
|
||||
utils.execute('umount', mountpoint, run_as_root=True)
|
||||
except processutils.ProcessExecutionError as e:
|
||||
msg = _("Unexpected err while unmount block device. "
|
||||
"Mountpoint: {0}, "
|
||||
"Error: {1}").format(mountpoint, e)
|
||||
raise exceptions.UnmountException(msg)
|
||||
|
||||
def read_mounts(self, filter_device=(), filter_fstype=()):
|
||||
"""Read all mounted filesystems.
|
||||
|
||||
Read all mounted filesystems except filtered option.
|
||||
|
||||
:param filter_device: Filter for device, the result will not contain
|
||||
the mounts whose device argument in it.
|
||||
:param filter_fstype: Filter for mount point.
|
||||
:return: All mounts.
|
||||
"""
|
||||
try:
|
||||
(out, err) = processutils.execute('cat', proc_mounts_path,
|
||||
check_exit_code=0)
|
||||
except processutils.ProcessExecutionError:
|
||||
msg = _("Failed to read mounts.")
|
||||
raise exceptions.FileNotFound(msg)
|
||||
|
||||
lines = out.split('\n')
|
||||
mounts = []
|
||||
for line in lines:
|
||||
if not line:
|
||||
continue
|
||||
tokens = line.split()
|
||||
if len(tokens) < 4:
|
||||
continue
|
||||
if tokens[0] in filter_device or tokens[1] in filter_fstype:
|
||||
continue
|
||||
mounts.append(MountInfo(device=tokens[0], mountpoint=tokens[1],
|
||||
fstype=tokens[2], opts=tokens[3]))
|
||||
return mounts
|
||||
|
||||
def get_mps_by_device(self, devpath):
|
||||
"""Get all mountpoints that device mounted on.
|
||||
|
||||
:param devpath: The path of mount device.
|
||||
:return: All mountpoints.
|
||||
:rtype: list
|
||||
"""
|
||||
mps = []
|
||||
mounts = self.read_mounts()
|
||||
for m in mounts:
|
||||
if devpath == m.device:
|
||||
mps.append(m.mountpoint)
|
||||
return mps
|
||||
|
||||
|
||||
def check_already_mounted(devpath, mountpoint):
|
||||
"""Check that the mount device is mounted on the specific mount point.
|