chore: Move skyline_apiserver out of libs

1. move skyline_apiserver out of libs
2. remove libs folder
3. remove old skyline folder
4. adjust zull, devstack and dockerfile

Change-Id: I27a4babd3df077d1dfc7555f67a6ea618d4b2966
This commit is contained in:
zhu.boxiang 2022-05-18 11:15:04 +08:00
parent 6949568886
commit 8cb60f0833
123 changed files with 1831 additions and 4540 deletions

1
.gitignore vendored
View File

@ -70,7 +70,6 @@ venv.bak/
.vscode/ .vscode/
/log/ /log/
tmp/ tmp/
libs/skyline-apiserver/log/
test_results.html test_results.html
# MAC OS # MAC OS

View File

@ -1,6 +1,5 @@
PYTHON ?= python3 PYTHON ?= python3
LIBS := $(shell \ls libs) PY_FILES := $(shell git ls-files -- *.py | xargs)
LIB_PATHS := $(addprefix libs/,$(LIBS))
ROOT_DIR ?= $(shell git rev-parse --show-toplevel) ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
# Color # Color
@ -78,50 +77,41 @@ venv:
poetry env use $(PYTHON) poetry env use $(PYTHON)
.PHONY: install $(INSTALL_LIBS) .PHONY: install
INSTALL_LIBS := $(addsuffix .install,$(LIB_PATHS)) install: venv
install: venv $(INSTALL_LIBS)
poetry run pip install -U pip setuptools'<58.0.0' poetry run pip install -U pip setuptools'<58.0.0'
poetry install -vvv poetry install -vvv
$(INSTALL_LIBS): tools/post_install.sh
$(MAKE) -C $(basename $@) install
.PHONY: package $(PACKAGE_LIBS) .PHONY: package
PACKAGE_LIBS := $(addsuffix .package,$(LIB_PATHS)) package:
package: $(PACKAGE_LIBS)
poetry build poetry build
$(PACKAGE_LIBS):
$(MAKE) -C $(basename $@) package
.PHONY: fmt $(FMT_LIBS) .PHONY: fmt
FMT_LIBS := $(addsuffix .fmt,$(LIB_PATHS)) fmt:
fmt: $(FMT_LIBS) poetry run isort $(PY_FILES)
$(FMT_LIBS): poetry run black --config pyproject.toml $(PY_FILES)
$(MAKE) -C $(basename $@) fmt poetry run add-trailing-comma --py36-plus --exit-zero-even-if-changed $(PY_FILES)
.PHONY: lint $(LINT_LIBS) .PHONY: lint
LINT_LIBS := $(addsuffix .lint,$(LIB_PATHS)) lint:
lint: $(LINT_LIBS) # poetry run mypy --strict --config-file=mypy.ini $(PY_FILES)
$(LINT_LIBS): poetry run isort --check-only --diff $(PY_FILES)
$(MAKE) -C $(basename $@) lint poetry run black --check --diff --color --config pyproject.toml $(PY_FILES)
poetry run flake8 --config .flake8 $(PY_FILES)
.PHONY: test $(TEST_LIBS) .PHONY: test
TEST_LIBS := $(addsuffix .test,$(LIB_PATHS)) test:
test: $(TEST_LIBS) poetry run pytest
$(TEST_LIBS):
$(MAKE) -C $(basename $@) test
.PHONY: clean $(CLEAN_LIBS) .PHONY: clean
CLEAN_LIBS := $(addsuffix .clean,$(LIB_PATHS)) clean:
clean: $(CLEAN_LIBS) rm -rf .venv dist htmlcov .coverage log test_results.html
rm -rf .venv dist .tox
$(CLEAN_LIBS):
$(MAKE) -C $(basename $@) clean
.PHONY: build .PHONY: build
@ -151,6 +141,20 @@ genconfig:
poetry run config-sample-generator -o $(ROOT_DIR)/etc/skyline.yaml.sample poetry run config-sample-generator -o $(ROOT_DIR)/etc/skyline.yaml.sample
.PHONY: db_revision
HEAD_REV ?= $(shell poetry run alembic -c skyline_apiserver/db/alembic/alembic.ini heads | awk '{print $$1}')
NEW_REV ?= $(shell python3 -c 'import sys; print(f"{int(sys.argv[1])+1:03}")' $(HEAD_REV))
REV_MEG ?=
db_revision:
$(shell [ -z "$(REV_MEG)" ] && printf '$(red)Missing required message, use "make db_revision REV_MEG=<some message>"$(no_color)')
poetry run alembic -c skyline_apiserver/db/alembic/alembic.ini revision --autogenerate --rev-id $(NEW_REV) -m '$(REV_MEG)'
.PHONY: db_sync
db_sync:
poetry run alembic -c skyline_apiserver/db/alembic/alembic.ini upgrade head
# Find python files without "type annotations" # Find python files without "type annotations"
future_check: future_check:
@find src ! -size 0 -type f -name *.py -exec grep -L 'from __future__ import annotations' {} \; @find skyline_apiserver ! -size 0 -type f -name *.py -exec grep -L 'from __future__ import annotations' {} \;

View File

@ -10,7 +10,7 @@ Skyline 的吉祥物是九色鹿。九色鹿源自于敦煌壁画《九色鹿本
**目录** **目录**
- [Skyline](#skyline) - [Skyline API Server](#skyline-api-server)
- [资源](#资源) - [资源](#资源)
- [快速开始](#快速开始) - [快速开始](#快速开始)
- [先决条件](#先决条件) - [先决条件](#先决条件)
@ -190,15 +190,13 @@ Skyline 的吉祥物是九色鹿。九色鹿源自于敦煌壁画《九色鹿本
3. 初始化 skyline 数据库 3. 初始化 skyline 数据库
```bash ```bash
pushd libs/skyline-apiserver/
make db_sync make db_sync
popd
``` ```
4. 运行 skyline-apiserver 4. 运行 skyline-apiserver
```bash ```bash
$ poetry run uvicorn --reload --reload-dir libs/skyline-apiserver/skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app $ poetry run uvicorn --reload --reload-dir skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app
INFO: Uvicorn running on http://127.0.0.1:28000 (Press CTRL+C to quit) INFO: Uvicorn running on http://127.0.0.1:28000 (Press CTRL+C to quit)
INFO: Started reloader process [154033] using statreload INFO: Started reloader process [154033] using statreload

View File

@ -10,7 +10,7 @@ Skyline's mascot is the nine-color deer. The nine-color deer comes from Dunhuang
**Table of contents** **Table of contents**
- [Skyline API](#skyline-api) - [Skyline API Server](#skyline-api-server)
- [Resources](#resources) - [Resources](#resources)
- [Quick Start](#quick-start) - [Quick Start](#quick-start)
- [Prerequisites](#prerequisites) - [Prerequisites](#prerequisites)
@ -190,15 +190,13 @@ You can now access the dashboard: `https://<ip_address>:9999`
3. Init skyline database 3. Init skyline database
```bash ```bash
pushd libs/skyline-apiserver/
make db_sync make db_sync
popd
``` ```
4. Run skyline-apiserver 4. Run skyline-apiserver
```bash ```bash
$ poetry run uvicorn --reload --reload-dir libs/skyline-apiserver/skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app $ poetry run uvicorn --reload --reload-dir skyline_apiserver --port 28000 --log-level debug skyline_apiserver.main:app
INFO: Uvicorn running on http://127.0.0.1:28000 (Press CTRL+C to quit) INFO: Uvicorn running on http://127.0.0.1:28000 (Press CTRL+C to quit)
INFO: Started reloader process [154033] using statreload INFO: Started reloader process [154033] using statreload

View File

@ -12,7 +12,7 @@ LABEL skyline.build_branch=${GIT_BRANCH}\
ENV LANG C.UTF-8 ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8 ENV LC_ALL C.UTF-8
COPY ./ /skyline/ COPY ./ /skyline-apiserver/
COPY ./container/start_service.sh /usr/local/bin/start_service.sh COPY ./container/start_service.sh /usr/local/bin/start_service.sh
COPY ./etc/skyline.yaml.sample /etc/skyline/skyline.yaml COPY ./etc/skyline.yaml.sample /etc/skyline/skyline.yaml
COPY ./etc/gunicorn.py /etc/skyline/gunicorn.py COPY ./etc/gunicorn.py /etc/skyline/gunicorn.py
@ -29,7 +29,7 @@ RUN export LANG=C.UTF-8 \
&& pip install poetry!=1.1.8 \ && pip install poetry!=1.1.8 \
&& poetry config virtualenvs.create false \ && poetry config virtualenvs.create false \
&& mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline \ && mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline \
&& cd /skyline \ && cd /skyline-apiserver \
&& poetry install \ && poetry install \
&& pip install -U ${SKYLINE_CONSOLE_PACKAGE_URL} \ && pip install -U ${SKYLINE_CONSOLE_PACKAGE_URL} \
&& apt-get clean \ && apt-get clean \

View File

@ -8,7 +8,7 @@ mapfile -t CMD < <(tail /run_command | xargs -n 1)
# kolla_extend_start # kolla_extend_start
if [[ "${!KOLLA_BOOTSTRAP[*]}" ]]; then if [[ "${!KOLLA_BOOTSTRAP[*]}" ]]; then
cd /skyline/libs/skyline-apiserver/ cd /skyline-apiserver/
make db_sync make db_sync
exit 0 exit 0
fi fi

View File

@ -40,9 +40,11 @@ function _install_skyline_console {
install_package nginx install_package nginx
# build static # build static
if [[ ! -d "$DEST/skyline-console" ]]; then
export ERROR_ON_CLONE=False export ERROR_ON_CLONE=False
git_clone_by_name "skyline-console" git_clone_by_name "skyline-console"
unset ERROR_ON_CLONE unset ERROR_ON_CLONE
fi
pushd $DEST/skyline-console pushd $DEST/skyline-console
make package make package
source $DEST/skyline-apiserver/.venv/bin/activate source $DEST/skyline-apiserver/.venv/bin/activate
@ -76,8 +78,11 @@ function _install_dependent_tools {
contrib_pip_install poetry!=1.1.8 contrib_pip_install poetry!=1.1.8
# nvm # nvm
wget -P $HOME --tries=10 --retry-connrefused --waitretry=60 --no-dns-cache --no-cache https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh NVM_INSTALL_FILE_NAME=nvm-install.sh
bash $HOME/install.sh if [[ ! -f "$HOME/$NVM_INSTALL_FILE_NAME" ]]; then
wget -O $HOME/$NVM_INSTALL_FILE_NAME --tries=10 --retry-connrefused --waitretry=60 --no-dns-cache --no-cache https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh
fi
bash $HOME/$NVM_INSTALL_FILE_NAME
. $HOME/.nvm/nvm.sh . $HOME/.nvm/nvm.sh
# nodejs # nodejs
@ -105,9 +110,6 @@ function cleanup_skyline {
# remove all .venv under skyline # remove all .venv under skyline
sudo find $SKYLINE_APISERVER_DIR -name '.venv'|xargs rm -rf sudo find $SKYLINE_APISERVER_DIR -name '.venv'|xargs rm -rf
# remove static
sudo rm -rf $SKYLINE_APISERVER_DIR/libs/skyline-console/skyline_console/static
# uninstall nginx # uninstall nginx
uninstall_package nginx uninstall_package nginx
} }
@ -147,7 +149,7 @@ function create_skyline_accounts {
function init_skyline { function init_skyline {
recreate_database skyline recreate_database skyline
pushd $SKYLINE_APISERVER_DIR/libs/skyline-apiserver pushd $SKYLINE_APISERVER_DIR
make db_sync make db_sync
popd popd
} }

View File

@ -1,78 +0,0 @@
PYTHON ?= python3
PY_FILES := $(shell git ls-files -- *.py | xargs)
# Color
no_color = \033[0m
black = \033[0;30m
red = \033[0;31m
green = \033[0;32m
yellow = \033[0;33m
blue = \033[0;34m
purple = \033[0;35m
cyan = \033[0;36m
white = \033[0;37m
.PHONY: all
all: install fmt lint test package
.PHONY: venv
venv:
poetry env use $(PYTHON)
.PHONY: install
install: venv
poetry run pip install -U pip setuptools'<58.0.0'
poetry install -vvv
tools/post_install.sh
.PHONY: package
package:
poetry build
.PHONY: fmt
fmt:
poetry run isort $(PY_FILES)
poetry run black --config ../../pyproject.toml $(PY_FILES)
poetry run add-trailing-comma --py36-plus --exit-zero-even-if-changed $(PY_FILES)
.PHONY: lint
lint:
# poetry run mypy --strict --config-file=../../mypy.ini $(PY_FILES)
poetry run isort --check-only --diff $(PY_FILES)
poetry run black --check --diff --color --config ../../pyproject.toml $(PY_FILES)
poetry run flake8 --config ../../.flake8 $(PY_FILES)
.PHONY: test
test:
poetry run pytest
.PHONY: clean
clean:
rm -rf .venv dist htmlcov .coverage log test_results.html
.PHONY: db_revision
HEAD_REV ?= $(shell poetry run alembic -c skyline_apiserver/db/alembic/alembic.ini heads | awk '{print $$1}')
NEW_REV ?= $(shell python3 -c 'import sys; print(f"{int(sys.argv[1])+1:03}")' $(HEAD_REV))
REV_MEG ?=
db_revision:
$(shell [ -z "$(REV_MEG)" ] && printf '$(red)Missing required message, use "make db_revision REV_MEG=<some message>"$(no_color)')
poetry run alembic -c skyline_apiserver/db/alembic/alembic.ini revision --autogenerate --rev-id $(NEW_REV) -m '$(REV_MEG)'
.PHONY: db_sync
db_sync:
poetry run alembic -c skyline_apiserver/db/alembic/alembic.ini upgrade head
# Find python files without "type annotations"
future_check:
@find skyline_apiserver ! -size 0 -type f -name *.py -exec grep -L 'from __future__ import annotations' {} \;

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
[virtualenvs]
in-project = true

View File

@ -1,78 +0,0 @@
[tool.poetry]
name = "skyline-apiserver"
version = "0.1.0"
description = ""
license = "Apache-2.0"
authors = ["OpenStack <openstack-discuss@lists.openstack.org>"]
include = ["skyline_apiserver/db/alembic/alembic.ini"]
[tool.poetry.dependencies]
python = "^3.8"
fastapi = {extras = ["all"], version = "0.58.1"}
pydantic = "1.8.2"
PyYAML = "5.4.1"
immutables = "0.16"
uvicorn = {extras = ["standard"], version = "0.12.3"}
gunicorn = "20.1.0"
python-jose = "3.3.0"
alembic = "1.7.5"
httpx = "0.16.1"
sqlalchemy = "1.3.24"
databases = "0.4.3"
aiomysql = "0.0.21"
pymysql = "0.9.3"
aiosqlite = "0.17.0"
dnspython = "2.1.0"
loguru = "0.5.3"
click = "7.1.2"
jinja2 = "2.11.3"
markupsafe = "2.0.1"
python-keystoneclient = "3.21.0"
python-cinderclient = "5.0.2"
python-glanceclient = "2.17.1"
python-heatclient = "1.18.1"
python-neutronclient = "6.14.1"
python-novaclient = "15.1.1"
python-octaviaclient = "1.10.1"
osc-placement = "1.7.0"
keystoneauth1 = "3.17.4"
"oslo.policy" = "3.8.2"
skyline-console = "*"
[tool.poetry.dev-dependencies]
isort = "5.9.3"
black = "21.9b0"
add-trailing-comma = "2.1.0"
flake8 = "3.9.2"
mypy = "0.910"
pytest = "6.2.5"
pytest-xdist = "2.4.0"
pytest-asyncio = "0.15.1"
pytest-cov = "2.12.1"
pytest-html = "3.1.1"
mimesis = "4.1.3"
asgi-lifespan = "1.0.1"
types-PyYAML = "5.4.10"
"oslo.log" = "4.8.0"
neutron-lib = "2.15.0"
skyline-console = "*"
[tool.poetry.scripts]
swagger-generator = 'skyline_apiserver.cmd.generate_swagger:main'
config-sample-generator = 'skyline_apiserver.cmd.generate_sample_config:main'
skyline-nginx-generator = 'skyline_apiserver.cmd.generate_nginx:main'
skyline-policy-manager = "skyline_apiserver.cmd.policy_manager:main"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-v -s -p no:cacheprovider -n auto --cov=skyline_apiserver --cov-append --cov-report=term-missing --cov-report=html --html=test_results.html --self-contained-html"
testpaths = [
"skyline_apiserver/tests",
]
markers = [
"ddt(*args: TestData): Mark the test as a data-driven test."
]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

View File

@ -1,20 +1,9 @@
- hosts: all - hosts: all
tasks: tasks:
- name: Install tox, nvm, nodejs and yarn - name: Install tox
shell: shell:
executable: /bin/bash executable: /bin/bash
cmd: | cmd: |
# nvm
wget -P $HOME --tries=10 --retry-connrefused --waitretry=60 --no-dns-cache --no-cache https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh
bash $HOME/install.sh
. $HOME/.nvm/nvm.sh
# nodejs
NODE_VERSION=erbium
nvm install --lts=$NODE_VERSION
nvm alias default lts/$NODE_VERSION
nvm use default
# yarn
npm install -g yarn
# tox # tox
pip3 install tox pip3 install tox
@ -22,27 +11,10 @@
shell: shell:
executable: /bin/bash executable: /bin/bash
cmd: | cmd: |
git submodule update --init
. $HOME/.nvm/nvm.sh
$HOME/.local/bin/tox -e package $HOME/.local/bin/tox -e package
args: args:
chdir: "src/{{ zuul.project.canonical_name }}" chdir: "src/{{ zuul.project.canonical_name }}"
- name: Remove the invalid tar.gz and whl packages
shell:
executable: /bin/bash
cmd: |
rm -rf *
args:
chdir: "src/{{ zuul.project.canonical_name }}/dist"
- name: Move all tar.gz and whl packages into dist
shell: "mv libs/{{ item }}/dist/* dist/"
args:
chdir: "src/{{ zuul.project.canonical_name }}"
with_items:
- "skyline-apiserver"
- name: Rename whl files to branch specific name - name: Rename whl files to branch specific name
shell: "mv {{ item }}*.whl {{ item }}-{{ zuul.branch | replace('/', '-') }}.whl" shell: "mv {{ item }}*.whl {{ item }}-{{ zuul.branch | replace('/', '-') }}.whl"
args: args:

1639
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,80 @@
[tool.poetry] [tool.poetry]
name = "skyline" name = "skyline-apiserver"
version = "0.1.0" version = "0.1.0"
description = "" description = ""
license = "Apache-2.0" license = "Apache-2.0"
authors = ["OpenStack <openstack-discuss@lists.openstack.org>"] authors = ["OpenStack <openstack-discuss@lists.openstack.org>"]
include = ["skyline_apiserver/db/alembic/alembic.ini"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.8" python = "^3.8"
skyline-apiserver = "*" fastapi = {extras = ["all"], version = "0.58.1"}
pydantic = "1.8.2"
PyYAML = "5.4.1"
immutables = "0.16"
uvicorn = {extras = ["standard"], version = "0.12.3"}
gunicorn = "20.1.0"
python-jose = "3.3.0"
alembic = "1.7.5"
httpx = "0.16.1"
sqlalchemy = "1.3.24"
databases = "0.4.3"
aiomysql = "0.0.21"
pymysql = "0.9.3"
aiosqlite = "0.17.0"
dnspython = "2.1.0"
loguru = "0.5.3"
click = "7.1.2"
jinja2 = "2.11.3"
markupsafe = "2.0.1"
python-keystoneclient = "3.21.0"
python-cinderclient = "5.0.2"
python-glanceclient = "2.17.1"
python-heatclient = "1.18.1"
python-neutronclient = "6.14.1"
python-novaclient = "15.1.1"
python-octaviaclient = "1.10.1"
osc-placement = "1.7.0"
keystoneauth1 = "3.17.4"
"oslo.policy" = "3.8.2"
skyline-console = "*"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
flake8 = "4.0.1"
skyline-apiserver = {path = "libs/skyline-apiserver", develop = true}
reno = {extras = ["sphinx"], version = "^3.5.0"} reno = {extras = ["sphinx"], version = "^3.5.0"}
openstackdocstheme = "^2.4.0" openstackdocstheme = "^2.4.0"
Sphinx = "4.5.0" Sphinx = "4.5.0"
isort = "5.9.3"
black = "21.9b0"
add-trailing-comma = "2.1.0"
flake8 = "3.9.2"
mypy = "0.910"
pytest = "6.2.5"
pytest-xdist = "2.4.0"
pytest-asyncio = "0.15.1"
pytest-cov = "2.12.1"
pytest-html = "3.1.1"
mimesis = "4.1.3"
asgi-lifespan = "1.0.1"
types-PyYAML = "5.4.10"
"oslo.log" = "4.8.0"
neutron-lib = "2.15.0"
skyline-console = "*"
[tool.poetry.scripts]
swagger-generator = 'skyline_apiserver.cmd.generate_swagger:main'
config-sample-generator = 'skyline_apiserver.cmd.generate_sample_config:main'
skyline-nginx-generator = 'skyline_apiserver.cmd.generate_nginx:main'
skyline-policy-manager = "skyline_apiserver.cmd.policy_manager:main"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-v -s -p no:cacheprovider -n auto --cov=skyline_apiserver --cov-append --cov-report=term-missing --cov-report=html --html=test_results.html --self-contained-html"
testpaths = [
"skyline_apiserver/tests",
]
markers = [
"ddt(*args: TestData): Mark the test as a data-driven test."
]
[tool.black] [tool.black]
line-length = 98 line-length = 98

View File

@ -24,29 +24,29 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
'openstackdocstheme', "openstackdocstheme",
'reno.sphinxext', "reno.sphinxext",
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ["_templates"]
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = ".rst"
# The encoding of source files. # The encoding of source files.
# source_encoding = 'utf-8-sig' # source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = "index"
# General information about the project. # General information about the project.
project = 'Skyline APIServer Release Notes' project = "Skyline APIServer Release Notes"
copyright = u'2022, Skyline APIServer developers' copyright = "2022, Skyline APIServer developers"
# openstackdocstheme options # openstackdocstheme options
openstackdocs_repo_name = 'openstack/skyline-apiserver' openstackdocs_repo_name = "openstack/skyline-apiserver"
openstackdocs_bug_project = 'skyline-apiserver' openstackdocs_bug_project = "skyline-apiserver"
openstackdocs_bug_tag = '' openstackdocs_bug_tag = ""
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@ -78,7 +78,7 @@ exclude_patterns = []
# show_authors = False # show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native' pygments_style = "native"
# A list of ignored prefixes for module index sorting. # A list of ignored prefixes for module index sorting.
# modindex_common_prefix = [] # modindex_common_prefix = []
@ -91,7 +91,7 @@ pygments_style = 'native'
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = 'openstackdocs' html_theme = "openstackdocs"
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
@ -120,7 +120,7 @@ html_theme = 'openstackdocs'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = ["_static"]
# Add any extra paths that contain custom files (such as robots.txt or # Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied # .htaccess) here, relative to this directory. These files are copied
@ -165,7 +165,7 @@ html_use_index = False
# html_file_suffix = None # html_file_suffix = None
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'SkylineAPIServerReleaseNotesdoc' htmlhelp_basename = "SkylineAPIServerReleaseNotesdoc"
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
@ -174,8 +174,13 @@ htmlhelp_basename = 'SkylineAPIServerReleaseNotesdoc'
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
('index', 'SkylineAPIServerReleaseNotes.tex', u'Skyline APIServer Release Notes Documentation', (
u'Skyline APIServer developers', 'manual'), "index",
"SkylineAPIServerReleaseNotes.tex",
"Skyline APIServer Release Notes Documentation",
"Skyline APIServer developers",
"manual",
),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
@ -204,8 +209,13 @@ latex_documents = [
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('index', 'skylineapiserverreleasenotes', u'Skyline APIServer Release Notes Documentation', (
[u'Skyline APIServer developers'], 1) "index",
"skylineapiserverreleasenotes",
"Skyline APIServer Release Notes Documentation",
["Skyline APIServer developers"],
1,
),
] ]
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
@ -218,9 +228,15 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
('index', 'SkylineAPIServerReleaseNotes', u'Skyline APIServer Release Notes Documentation', (
u'Skyline APIServer developers', 'SkylineAPIServerReleaseNotes', 'One line description of project.', "index",
'Miscellaneous'), "SkylineAPIServerReleaseNotes",
"Skyline APIServer Release Notes Documentation",
"Skyline APIServer developers",
"SkylineAPIServerReleaseNotes",
"One line description of project.",
"Miscellaneous",
),
] ]
# Documents to append as an appendix to all manuals. # Documents to append as an appendix to all manuals.
@ -236,4 +252,4 @@ texinfo_documents = [
# texinfo_no_detailmenu = False # texinfo_no_detailmenu = False
# -- Options for Internationalization output ------------------------------ # -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/'] locale_dirs = ["locale/"]

View File

View File

@ -19,6 +19,7 @@ from logging import StreamHandler
from pprint import pprint from pprint import pprint
import uvloop import uvloop
from skyline_apiserver.config import configure from skyline_apiserver.config import configure
from skyline_apiserver.log import setup from skyline_apiserver.log import setup

View File

@ -20,6 +20,7 @@ from typing import Optional
import jose import jose
from fastapi import HTTPException, Request, Response, status from fastapi import HTTPException, Request, Response, status
from fastapi.security import APIKeyCookie from fastapi.security import APIKeyCookie
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from skyline_apiserver.core.security import generate_profile_by_token, parse_access_token from skyline_apiserver.core.security import generate_profile_by_token, parse_access_token

View File

@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
from fastapi import APIRouter from fastapi import APIRouter
from skyline_apiserver.api.v1 import contrib, extension, login, policy, prometheus, setting from skyline_apiserver.api.v1 import contrib, extension, login, policy, prometheus, setting
api_router = APIRouter() api_router = APIRouter()

View File

@ -18,6 +18,7 @@ import asyncio
from typing import Any, List from typing import Any, List
from fastapi import APIRouter, Header, HTTPException, status from fastapi import APIRouter, Header, HTTPException, status
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.client.openstack import system from skyline_apiserver.client.openstack import system
from skyline_apiserver.client.openstack.system import get_endpoints from skyline_apiserver.client.openstack.system import get_endpoints

View File

@ -22,6 +22,7 @@ from typing import List
from dateutil import parser from dateutil import parser
from fastapi import APIRouter, Depends, Header, Query, status from fastapi import APIRouter, Depends, Header, Query, status
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.api import deps from skyline_apiserver.api import deps
from skyline_apiserver.api.v1.openstack.base import OSPort, OSServer, OSVolume, OSVolumeSnapshot from skyline_apiserver.api.v1.openstack.base import OSPort, OSServer, OSVolume, OSVolumeSnapshot

View File

@ -18,6 +18,7 @@ from fastapi import APIRouter, Depends, Header, HTTPException, Request, Response
from keystoneauth1.identity.v3 import Password from keystoneauth1.identity.v3 import Password
from keystoneauth1.session import Session from keystoneauth1.session import Session
from keystoneclient.client import Client as KeystoneClient from keystoneclient.client import Client as KeystoneClient
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.api import deps from skyline_apiserver.api import deps
from skyline_apiserver.client import utils from skyline_apiserver.client import utils

View File

@ -15,6 +15,7 @@
from __future__ import annotations from __future__ import annotations
from fastapi import APIRouter, Depends, HTTPException, status from fastapi import APIRouter, Depends, HTTPException, status
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.api import deps from skyline_apiserver.api import deps
from skyline_apiserver.client.utils import generate_session, get_access from skyline_apiserver.client.utils import generate_session, get_access

View File

@ -2,6 +2,7 @@ from __future__ import annotations
from fastapi import APIRouter, Depends, HTTPException, status from fastapi import APIRouter, Depends, HTTPException, status
from httpx import codes from httpx import codes
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.api import deps from skyline_apiserver.api import deps
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF

View File

@ -15,6 +15,7 @@
from __future__ import annotations from __future__ import annotations
from fastapi import APIRouter, Depends, HTTPException, status from fastapi import APIRouter, Depends, HTTPException, status
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.api import deps from skyline_apiserver.api import deps
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF

View File

@ -19,9 +19,10 @@ from typing import Any, Dict
from fastapi import HTTPException, status from fastapi import HTTPException, status
from keystoneauth1.exceptions.http import Unauthorized from keystoneauth1.exceptions.http import Unauthorized
from keystoneauth1.session import Session from keystoneauth1.session import Session
from starlette.concurrency import run_in_threadpool
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from starlette.concurrency import run_in_threadpool
async def list_volumes( async def list_volumes(

View File

@ -19,9 +19,10 @@ from typing import Any, Dict
from fastapi import HTTPException, status from fastapi import HTTPException, status
from keystoneauth1.exceptions.http import Unauthorized from keystoneauth1.exceptions.http import Unauthorized
from keystoneauth1.session import Session from keystoneauth1.session import Session
from starlette.concurrency import run_in_threadpool
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from starlette.concurrency import run_in_threadpool
async def list_images( async def list_images(

View File

@ -19,9 +19,10 @@ from typing import Any, Dict
from fastapi import HTTPException, status from fastapi import HTTPException, status
from keystoneauth1.exceptions.http import Unauthorized from keystoneauth1.exceptions.http import Unauthorized
from keystoneauth1.session import Session from keystoneauth1.session import Session
from starlette.concurrency import run_in_threadpool
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from starlette.concurrency import run_in_threadpool
async def list_projects( async def list_projects(

View File

@ -19,9 +19,10 @@ from typing import Any
from fastapi import HTTPException, status from fastapi import HTTPException, status
from keystoneauth1.exceptions.http import Unauthorized from keystoneauth1.exceptions.http import Unauthorized
from keystoneauth1.session import Session from keystoneauth1.session import Session
from starlette.concurrency import run_in_threadpool
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from starlette.concurrency import run_in_threadpool
async def list_networks( async def list_networks(

View File

@ -20,9 +20,10 @@ from fastapi import HTTPException, status
from keystoneauth1.exceptions.http import Unauthorized from keystoneauth1.exceptions.http import Unauthorized
from keystoneauth1.session import Session from keystoneauth1.session import Session
from novaclient.exceptions import BadRequest, Forbidden from novaclient.exceptions import BadRequest, Forbidden
from starlette.concurrency import run_in_threadpool
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from starlette.concurrency import run_in_threadpool
async def list_servers( async def list_servers(

View File

@ -19,12 +19,13 @@ from typing import Any, Dict
from keystoneauth1.identity.v3 import Token from keystoneauth1.identity.v3 import Token
from keystoneauth1.session import Session from keystoneauth1.session import Session
from starlette.concurrency import run_in_threadpool
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from skyline_apiserver.client.utils import get_system_session from skyline_apiserver.client.utils import get_system_session
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from skyline_apiserver.log import LOG from skyline_apiserver.log import LOG
from skyline_apiserver.types import constants from skyline_apiserver.types import constants
from starlette.concurrency import run_in_threadpool
async def get_project_scope_token( async def get_project_scope_token(

View File

@ -26,10 +26,11 @@ from keystoneclient.httpclient import HTTPClient
from neutronclient.v2_0.client import Client as NeutronClient from neutronclient.v2_0.client import Client as NeutronClient
from novaclient.client import Client as NovaClient from novaclient.client import Client as NovaClient
from osc_placement.http import SessionClient as PlacementClient from osc_placement.http import SessionClient as PlacementClient
from starlette.concurrency import run_in_threadpool
from skyline_apiserver import schemas from skyline_apiserver import schemas
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from skyline_apiserver.types import constants from skyline_apiserver.types import constants
from starlette.concurrency import run_in_threadpool
SESSION = None SESSION = None

View File

@ -21,15 +21,16 @@ from typing import Dict
from urllib.parse import urlparse from urllib.parse import urlparse
import click import click
import skyline_apiserver
from jinja2 import Template from jinja2 import Template
from keystoneauth1.identity.v3 import Password from keystoneauth1.identity.v3 import Password
from keystoneauth1.session import Session from keystoneauth1.session import Session
from keystoneclient.client import Client as KeystoneClient from keystoneclient.client import Client as KeystoneClient
from pydantic import BaseModel from pydantic import BaseModel
from skyline_console import static_path
import skyline_apiserver
from skyline_apiserver.config import CONF, configure from skyline_apiserver.config import CONF, configure
from skyline_apiserver.log import LOG, setup from skyline_apiserver.log import LOG, setup
from skyline_console import static_path
class CommandException(Exception): class CommandException(Exception):

View File

@ -18,6 +18,7 @@ import sys
import click import click
import yaml import yaml
from skyline_apiserver.config import CONF, configure from skyline_apiserver.config import CONF, configure

View File

@ -18,6 +18,7 @@ import json
import sys import sys
import click import click
from skyline_apiserver.main import app from skyline_apiserver.main import app

View File

@ -22,6 +22,7 @@ from typing import Callable, Dict, Iterable, List, Union
import click import click
from oslo_policy.policy import DocumentedRuleDefault, RuleDefault # type: ignore from oslo_policy.policy import DocumentedRuleDefault, RuleDefault # type: ignore
from skyline_apiserver.log import LOG, setup as log_setup from skyline_apiserver.log import LOG, setup as log_setup
from skyline_apiserver.policy.manager import get_service_rules from skyline_apiserver.policy.manager import get_service_rules
from skyline_apiserver.policy.manager.base import APIRule, Rule from skyline_apiserver.policy.manager.base import APIRule, Rule

View File

@ -17,6 +17,7 @@ from __future__ import annotations
from typing import List from typing import List
from pydantic import StrictBool, StrictInt, StrictStr from pydantic import StrictBool, StrictInt, StrictStr
from skyline_apiserver.config.base import Opt from skyline_apiserver.config.base import Opt
debug = Opt( debug = Opt(

View File

@ -15,6 +15,7 @@
from __future__ import annotations from __future__ import annotations
from pydantic import StrictBool from pydantic import StrictBool
from skyline_apiserver.config.base import Opt from skyline_apiserver.config.base import Opt
show_raw_sql = Opt( show_raw_sql = Opt(

View File

@ -17,6 +17,7 @@ from __future__ import annotations
from typing import Dict, List from typing import Dict, List
from pydantic import HttpUrl, StrictInt, StrictStr from pydantic import HttpUrl, StrictInt, StrictStr
from skyline_apiserver.config.base import Opt from skyline_apiserver.config.base import Opt
from skyline_apiserver.types import InterfaceType from skyline_apiserver.types import InterfaceType

View File

@ -17,6 +17,7 @@ from __future__ import annotations
from typing import Any, Dict, List from typing import Any, Dict, List
from pydantic.types import StrictStr from pydantic.types import StrictStr
from skyline_apiserver.config.base import Opt from skyline_apiserver.config.base import Opt
base_settings = Opt( base_settings = Opt(

View File

@ -19,6 +19,7 @@ import uuid
from fastapi import HTTPException, status from fastapi import HTTPException, status
from jose import jwt from jose import jwt
from skyline_apiserver import __version__, schemas from skyline_apiserver import __version__, schemas
from skyline_apiserver.client import utils from skyline_apiserver.client import utils
from skyline_apiserver.client.utils import get_system_session from skyline_apiserver.client.utils import get_system_session

View File

@ -16,10 +16,11 @@ from logging import StreamHandler, basicConfig
from alembic import context from alembic import context
from databases import DatabaseURL from databases import DatabaseURL
from sqlalchemy import create_engine, pool
from skyline_apiserver.config import CONF, configure from skyline_apiserver.config import CONF, configure
from skyline_apiserver.db.models import METADATA from skyline_apiserver.db.models import METADATA
from skyline_apiserver.log import setup as log_setup from skyline_apiserver.log import setup as log_setup
from sqlalchemy import create_engine, pool
configure("skyline") configure("skyline")
basicConfig() basicConfig()

View File

@ -18,9 +18,10 @@ import time
from functools import wraps from functools import wraps
from typing import Any from typing import Any
from skyline_apiserver.types import Fn
from sqlalchemy import delete, func, insert, select, update from sqlalchemy import delete, func, insert, select, update
from skyline_apiserver.types import Fn
from .base import DB, inject_db from .base import DB, inject_db
from .models import RevokedToken, Settings from .models import RevokedToken, Settings

View File

@ -17,6 +17,7 @@ from __future__ import annotations
from contextvars import ContextVar from contextvars import ContextVar
from databases import Database, DatabaseURL, core from databases import Database, DatabaseURL, core
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
DATABASE = None DATABASE = None

View File

@ -17,12 +17,13 @@ from __future__ import annotations
from pathlib import Path from pathlib import Path
from fastapi import FastAPI from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from skyline_apiserver.api.v1 import api_router from skyline_apiserver.api.v1 import api_router
from skyline_apiserver.config import CONF, configure from skyline_apiserver.config import CONF, configure
from skyline_apiserver.db import setup as db_setup from skyline_apiserver.db import setup as db_setup
from skyline_apiserver.log import LOG, setup as log_setup from skyline_apiserver.log import LOG, setup as log_setup
from skyline_apiserver.policy import setup as policies_setup from skyline_apiserver.policy import setup as policies_setup
from starlette.middleware.cors import CORSMiddleware
PROJECT_NAME = "Skyline API" PROJECT_NAME = "Skyline API"
API_PREFIX = "/api/v1" API_PREFIX = "/api/v1"

View File

@ -21,6 +21,7 @@ import attr
from immutables import Map from immutables import Map
from keystoneauth1.access.access import AccessInfoV3 from keystoneauth1.access.access import AccessInfoV3
from oslo_policy._checks import _check from oslo_policy._checks import _check
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from .manager.base import APIRule from .manager.base import APIRule

View File

@ -18,6 +18,7 @@ from typing import List
from oslo_policy import _parser # type: ignore from oslo_policy import _parser # type: ignore
from oslo_policy.policy import DocumentedRuleDefault, RuleDefault # type: ignore from oslo_policy.policy import DocumentedRuleDefault, RuleDefault # type: ignore
from skyline_apiserver.schemas.policy_manager import Operation, OperationsSchema, ScopeTypesSchema from skyline_apiserver.schemas.policy_manager import Operation, OperationsSchema, ScopeTypesSchema

View File

@ -18,6 +18,7 @@ from typing import Any, Dict, List, Optional
from jose import jwt from jose import jwt
from pydantic import BaseModel from pydantic import BaseModel
from skyline_apiserver import config from skyline_apiserver import config
from skyline_apiserver.types import constants from skyline_apiserver.types import constants

View File

@ -16,6 +16,7 @@ import os
import pytest import pytest
from httpx import AsyncClient from httpx import AsyncClient
from skyline_apiserver import main from skyline_apiserver import main
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF

View File

@ -19,6 +19,7 @@ from typing import Any, Dict
import pytest import pytest
from httpx import AsyncClient from httpx import AsyncClient
from six.moves.urllib import parse from six.moves.urllib import parse
from skyline_apiserver import main from skyline_apiserver import main

View File

@ -17,6 +17,7 @@ import time
import pytest import pytest
from httpx import AsyncClient from httpx import AsyncClient
from skyline_apiserver import __version__, main from skyline_apiserver import __version__, main
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from skyline_apiserver.db import api as db_api, setup as db_setup from skyline_apiserver.db import api as db_api, setup as db_setup

View File

@ -17,6 +17,7 @@ import uuid
import pytest import pytest
from httpx import AsyncClient from httpx import AsyncClient
from skyline_apiserver import main from skyline_apiserver import main
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from skyline_apiserver.types import constants from skyline_apiserver.types import constants

View File

@ -18,6 +18,7 @@ import pytest
from _pytest.mark import ParameterSet from _pytest.mark import ParameterSet
from asgi_lifespan import LifespanManager from asgi_lifespan import LifespanManager
from httpx import AsyncClient from httpx import AsyncClient
from skyline_apiserver.config import CONF from skyline_apiserver.config import CONF
from skyline_apiserver.main import app from skyline_apiserver.main import app
from skyline_apiserver.tests.models import TestData from skyline_apiserver.tests.models import TestData

Some files were not shown because too many files have changed in this diff Show More