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:
parent
6949568886
commit
8cb60f0833
1
.gitignore
vendored
1
.gitignore
vendored
@ -70,7 +70,6 @@ venv.bak/
|
||||
.vscode/
|
||||
/log/
|
||||
tmp/
|
||||
libs/skyline-apiserver/log/
|
||||
test_results.html
|
||||
|
||||
# MAC OS
|
||||
|
72
Makefile
72
Makefile
@ -1,6 +1,5 @@
|
||||
PYTHON ?= python3
|
||||
LIBS := $(shell \ls libs)
|
||||
LIB_PATHS := $(addprefix libs/,$(LIBS))
|
||||
PY_FILES := $(shell git ls-files -- *.py | xargs)
|
||||
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
|
||||
|
||||
# Color
|
||||
@ -78,50 +77,41 @@ venv:
|
||||
poetry env use $(PYTHON)
|
||||
|
||||
|
||||
.PHONY: install $(INSTALL_LIBS)
|
||||
INSTALL_LIBS := $(addsuffix .install,$(LIB_PATHS))
|
||||
install: venv $(INSTALL_LIBS)
|
||||
.PHONY: install
|
||||
install: venv
|
||||
poetry run pip install -U pip setuptools'<58.0.0'
|
||||
poetry install -vvv
|
||||
$(INSTALL_LIBS):
|
||||
$(MAKE) -C $(basename $@) install
|
||||
tools/post_install.sh
|
||||
|
||||
|
||||
.PHONY: package $(PACKAGE_LIBS)
|
||||
PACKAGE_LIBS := $(addsuffix .package,$(LIB_PATHS))
|
||||
package: $(PACKAGE_LIBS)
|
||||
.PHONY: package
|
||||
package:
|
||||
poetry build
|
||||
$(PACKAGE_LIBS):
|
||||
$(MAKE) -C $(basename $@) package
|
||||
|
||||
|
||||
.PHONY: fmt $(FMT_LIBS)
|
||||
FMT_LIBS := $(addsuffix .fmt,$(LIB_PATHS))
|
||||
fmt: $(FMT_LIBS)
|
||||
$(FMT_LIBS):
|
||||
$(MAKE) -C $(basename $@) fmt
|
||||
.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_LIBS)
|
||||
LINT_LIBS := $(addsuffix .lint,$(LIB_PATHS))
|
||||
lint: $(LINT_LIBS)
|
||||
$(LINT_LIBS):
|
||||
$(MAKE) -C $(basename $@) lint
|
||||
.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_LIBS)
|
||||
TEST_LIBS := $(addsuffix .test,$(LIB_PATHS))
|
||||
test: $(TEST_LIBS)
|
||||
$(TEST_LIBS):
|
||||
$(MAKE) -C $(basename $@) test
|
||||
.PHONY: test
|
||||
test:
|
||||
poetry run pytest
|
||||
|
||||
|
||||
.PHONY: clean $(CLEAN_LIBS)
|
||||
CLEAN_LIBS := $(addsuffix .clean,$(LIB_PATHS))
|
||||
clean: $(CLEAN_LIBS)
|
||||
rm -rf .venv dist .tox
|
||||
$(CLEAN_LIBS):
|
||||
$(MAKE) -C $(basename $@) clean
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf .venv dist htmlcov .coverage log test_results.html
|
||||
|
||||
|
||||
.PHONY: build
|
||||
@ -151,6 +141,20 @@ genconfig:
|
||||
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"
|
||||
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' {} \;
|
||||
|
@ -10,7 +10,7 @@ Skyline 的吉祥物是九色鹿。九色鹿源自于敦煌壁画《九色鹿本
|
||||
|
||||
**目录**
|
||||
|
||||
- [Skyline](#skyline)
|
||||
- [Skyline API Server](#skyline-api-server)
|
||||
- [资源](#资源)
|
||||
- [快速开始](#快速开始)
|
||||
- [先决条件](#先决条件)
|
||||
@ -190,15 +190,13 @@ Skyline 的吉祥物是九色鹿。九色鹿源自于敦煌壁画《九色鹿本
|
||||
3. 初始化 skyline 数据库
|
||||
|
||||
```bash
|
||||
pushd libs/skyline-apiserver/
|
||||
make db_sync
|
||||
popd
|
||||
```
|
||||
|
||||
4. 运行 skyline-apiserver
|
||||
|
||||
```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: Started reloader process [154033] using statreload
|
||||
|
@ -10,7 +10,7 @@ Skyline's mascot is the nine-color deer. The nine-color deer comes from Dunhuang
|
||||
|
||||
**Table of contents**
|
||||
|
||||
- [Skyline API](#skyline-api)
|
||||
- [Skyline API Server](#skyline-api-server)
|
||||
- [Resources](#resources)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Prerequisites](#prerequisites)
|
||||
@ -190,15 +190,13 @@ You can now access the dashboard: `https://<ip_address>:9999`
|
||||
3. Init skyline database
|
||||
|
||||
```bash
|
||||
pushd libs/skyline-apiserver/
|
||||
make db_sync
|
||||
popd
|
||||
```
|
||||
|
||||
4. Run skyline-apiserver
|
||||
|
||||
```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: Started reloader process [154033] using statreload
|
||||
|
@ -12,7 +12,7 @@ LABEL skyline.build_branch=${GIT_BRANCH}\
|
||||
ENV LANG 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 ./etc/skyline.yaml.sample /etc/skyline/skyline.yaml
|
||||
COPY ./etc/gunicorn.py /etc/skyline/gunicorn.py
|
||||
@ -29,7 +29,7 @@ RUN export LANG=C.UTF-8 \
|
||||
&& pip install poetry!=1.1.8 \
|
||||
&& poetry config virtualenvs.create false \
|
||||
&& mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline \
|
||||
&& cd /skyline \
|
||||
&& cd /skyline-apiserver \
|
||||
&& poetry install \
|
||||
&& pip install -U ${SKYLINE_CONSOLE_PACKAGE_URL} \
|
||||
&& apt-get clean \
|
||||
|
@ -8,7 +8,7 @@ mapfile -t CMD < <(tail /run_command | xargs -n 1)
|
||||
|
||||
# kolla_extend_start
|
||||
if [[ "${!KOLLA_BOOTSTRAP[*]}" ]]; then
|
||||
cd /skyline/libs/skyline-apiserver/
|
||||
cd /skyline-apiserver/
|
||||
make db_sync
|
||||
exit 0
|
||||
fi
|
||||
|
@ -40,9 +40,11 @@ function _install_skyline_console {
|
||||
install_package nginx
|
||||
|
||||
# build static
|
||||
if [[ ! -d "$DEST/skyline-console" ]]; then
|
||||
export ERROR_ON_CLONE=False
|
||||
git_clone_by_name "skyline-console"
|
||||
unset ERROR_ON_CLONE
|
||||
fi
|
||||
pushd $DEST/skyline-console
|
||||
make package
|
||||
source $DEST/skyline-apiserver/.venv/bin/activate
|
||||
@ -76,8 +78,11 @@ function _install_dependent_tools {
|
||||
contrib_pip_install poetry!=1.1.8
|
||||
|
||||
# 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
|
||||
NVM_INSTALL_FILE_NAME=nvm-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
|
||||
|
||||
# nodejs
|
||||
@ -105,9 +110,6 @@ function cleanup_skyline {
|
||||
# remove all .venv under skyline
|
||||
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_package nginx
|
||||
}
|
||||
@ -147,7 +149,7 @@ function create_skyline_accounts {
|
||||
function init_skyline {
|
||||
recreate_database skyline
|
||||
|
||||
pushd $SKYLINE_APISERVER_DIR/libs/skyline-apiserver
|
||||
pushd $SKYLINE_APISERVER_DIR
|
||||
make db_sync
|
||||
popd
|
||||
}
|
||||
|
@ -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' {} \;
|
4158
libs/skyline-apiserver/poetry.lock
generated
4158
libs/skyline-apiserver/poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
[virtualenvs]
|
||||
in-project = true
|
@ -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"
|
@ -1,20 +1,9 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Install tox, nvm, nodejs and yarn
|
||||
- name: Install tox
|
||||
shell:
|
||||
executable: /bin/bash
|
||||
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
|
||||
pip3 install tox
|
||||
|
||||
@ -22,27 +11,10 @@
|
||||
shell:
|
||||
executable: /bin/bash
|
||||
cmd: |
|
||||
git submodule update --init
|
||||
. $HOME/.nvm/nvm.sh
|
||||
$HOME/.local/bin/tox -e package
|
||||
args:
|
||||
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
|
||||
shell: "mv {{ item }}*.whl {{ item }}-{{ zuul.branch | replace('/', '-') }}.whl"
|
||||
args:
|
||||
|
1639
poetry.lock
generated
1639
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,80 @@
|
||||
[tool.poetry]
|
||||
name = "skyline"
|
||||
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"
|
||||
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]
|
||||
flake8 = "4.0.1"
|
||||
skyline-apiserver = {path = "libs/skyline-apiserver", develop = true}
|
||||
reno = {extras = ["sphinx"], version = "^3.5.0"}
|
||||
openstackdocstheme = "^2.4.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]
|
||||
line-length = 98
|
||||
|
@ -24,29 +24,29 @@
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'openstackdocstheme',
|
||||
'reno.sphinxext',
|
||||
"openstackdocstheme",
|
||||
"reno.sphinxext",
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = ["_templates"]
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
source_suffix = ".rst"
|
||||
|
||||
# The encoding of source files.
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = 'Skyline APIServer Release Notes'
|
||||
copyright = u'2022, Skyline APIServer developers'
|
||||
project = "Skyline APIServer Release Notes"
|
||||
copyright = "2022, Skyline APIServer developers"
|
||||
# openstackdocstheme options
|
||||
openstackdocs_repo_name = 'openstack/skyline-apiserver'
|
||||
openstackdocs_bug_project = 'skyline-apiserver'
|
||||
openstackdocs_bug_tag = ''
|
||||
openstackdocs_repo_name = "openstack/skyline-apiserver"
|
||||
openstackdocs_bug_project = "skyline-apiserver"
|
||||
openstackdocs_bug_tag = ""
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
@ -78,7 +78,7 @@ exclude_patterns = []
|
||||
# show_authors = False
|
||||
|
||||
# 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.
|
||||
# modindex_common_prefix = []
|
||||
@ -91,7 +91,7 @@ pygments_style = 'native'
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# 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
|
||||
# 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,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# 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
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
@ -165,7 +165,7 @@ html_use_index = False
|
||||
# html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'SkylineAPIServerReleaseNotesdoc'
|
||||
htmlhelp_basename = "SkylineAPIServerReleaseNotesdoc"
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
@ -174,8 +174,13 @@ htmlhelp_basename = 'SkylineAPIServerReleaseNotesdoc'
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
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
|
||||
@ -204,8 +209,13 @@ latex_documents = [
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
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.
|
||||
@ -218,9 +228,15 @@ man_pages = [
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'SkylineAPIServerReleaseNotes', u'Skyline APIServer Release Notes Documentation',
|
||||
u'Skyline APIServer developers', 'SkylineAPIServerReleaseNotes', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
(
|
||||
"index",
|
||||
"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.
|
||||
@ -236,4 +252,4 @@ texinfo_documents = [
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
# -- Options for Internationalization output ------------------------------
|
||||
locale_dirs = ['locale/']
|
||||
locale_dirs = ["locale/"]
|
||||
|
@ -19,6 +19,7 @@ from logging import StreamHandler
|
||||
from pprint import pprint
|
||||
|
||||
import uvloop
|
||||
|
||||
from skyline_apiserver.config import configure
|
||||
from skyline_apiserver.log import setup
|
||||
|
@ -20,6 +20,7 @@ from typing import Optional
|
||||
import jose
|
||||
from fastapi import HTTPException, Request, Response, status
|
||||
from fastapi.security import APIKeyCookie
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.config import CONF
|
||||
from skyline_apiserver.core.security import generate_profile_by_token, parse_access_token
|
@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from skyline_apiserver.api.v1 import contrib, extension, login, policy, prometheus, setting
|
||||
|
||||
api_router = APIRouter()
|
@ -18,6 +18,7 @@ import asyncio
|
||||
from typing import Any, List
|
||||
|
||||
from fastapi import APIRouter, Header, HTTPException, status
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.client.openstack import system
|
||||
from skyline_apiserver.client.openstack.system import get_endpoints
|
@ -22,6 +22,7 @@ from typing import List
|
||||
|
||||
from dateutil import parser
|
||||
from fastapi import APIRouter, Depends, Header, Query, status
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.api import deps
|
||||
from skyline_apiserver.api.v1.openstack.base import OSPort, OSServer, OSVolume, OSVolumeSnapshot
|
@ -18,6 +18,7 @@ from fastapi import APIRouter, Depends, Header, HTTPException, Request, Response
|
||||
from keystoneauth1.identity.v3 import Password
|
||||
from keystoneauth1.session import Session
|
||||
from keystoneclient.client import Client as KeystoneClient
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.api import deps
|
||||
from skyline_apiserver.client import utils
|
@ -15,6 +15,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.api import deps
|
||||
from skyline_apiserver.client.utils import generate_session, get_access
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from httpx import codes
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.api import deps
|
||||
from skyline_apiserver.config import CONF
|
@ -15,6 +15,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.api import deps
|
||||
from skyline_apiserver.config import CONF
|
@ -19,9 +19,10 @@ from typing import Any, Dict
|
||||
from fastapi import HTTPException, status
|
||||
from keystoneauth1.exceptions.http import Unauthorized
|
||||
from keystoneauth1.session import Session
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.client import utils
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
|
||||
async def list_volumes(
|
@ -19,9 +19,10 @@ from typing import Any, Dict
|
||||
from fastapi import HTTPException, status
|
||||
from keystoneauth1.exceptions.http import Unauthorized
|
||||
from keystoneauth1.session import Session
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.client import utils
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
|
||||
async def list_images(
|
@ -19,9 +19,10 @@ from typing import Any, Dict
|
||||
from fastapi import HTTPException, status
|
||||
from keystoneauth1.exceptions.http import Unauthorized
|
||||
from keystoneauth1.session import Session
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.client import utils
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
|
||||
async def list_projects(
|
@ -19,9 +19,10 @@ from typing import Any
|
||||
from fastapi import HTTPException, status
|
||||
from keystoneauth1.exceptions.http import Unauthorized
|
||||
from keystoneauth1.session import Session
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.client import utils
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
|
||||
async def list_networks(
|
@ -20,9 +20,10 @@ from fastapi import HTTPException, status
|
||||
from keystoneauth1.exceptions.http import Unauthorized
|
||||
from keystoneauth1.session import Session
|
||||
from novaclient.exceptions import BadRequest, Forbidden
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.client import utils
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
|
||||
async def list_servers(
|
@ -19,12 +19,13 @@ from typing import Any, Dict
|
||||
|
||||
from keystoneauth1.identity.v3 import Token
|
||||
from keystoneauth1.session import Session
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver.client import utils
|
||||
from skyline_apiserver.client.utils import get_system_session
|
||||
from skyline_apiserver.config import CONF
|
||||
from skyline_apiserver.log import LOG
|
||||
from skyline_apiserver.types import constants
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
|
||||
async def get_project_scope_token(
|
@ -26,10 +26,11 @@ from keystoneclient.httpclient import HTTPClient
|
||||
from neutronclient.v2_0.client import Client as NeutronClient
|
||||
from novaclient.client import Client as NovaClient
|
||||
from osc_placement.http import SessionClient as PlacementClient
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from skyline_apiserver import schemas
|
||||
from skyline_apiserver.config import CONF
|
||||
from skyline_apiserver.types import constants
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
SESSION = None
|
||||
|
@ -21,15 +21,16 @@ from typing import Dict
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import click
|
||||
import skyline_apiserver
|
||||
from jinja2 import Template
|
||||
from keystoneauth1.identity.v3 import Password
|
||||
from keystoneauth1.session import Session
|
||||
from keystoneclient.client import Client as KeystoneClient
|
||||
from pydantic import BaseModel
|
||||
from skyline_console import static_path
|
||||
|
||||
import skyline_apiserver
|
||||
from skyline_apiserver.config import CONF, configure
|
||||
from skyline_apiserver.log import LOG, setup
|
||||
from skyline_console import static_path
|
||||
|
||||
|
||||
class CommandException(Exception):
|
@ -18,6 +18,7 @@ import sys
|
||||
|
||||
import click
|
||||
import yaml
|
||||
|
||||
from skyline_apiserver.config import CONF, configure
|
||||
|
||||
|
@ -18,6 +18,7 @@ import json
|
||||
import sys
|
||||
|
||||
import click
|
||||
|
||||
from skyline_apiserver.main import app
|
||||
|
||||
|
@ -22,6 +22,7 @@ from typing import Callable, Dict, Iterable, List, Union
|
||||
|
||||
import click
|
||||
from oslo_policy.policy import DocumentedRuleDefault, RuleDefault # type: ignore
|
||||
|
||||
from skyline_apiserver.log import LOG, setup as log_setup
|
||||
from skyline_apiserver.policy.manager import get_service_rules
|
||||
from skyline_apiserver.policy.manager.base import APIRule, Rule
|
@ -17,6 +17,7 @@ from __future__ import annotations
|
||||
from typing import List
|
||||
|
||||
from pydantic import StrictBool, StrictInt, StrictStr
|
||||
|
||||
from skyline_apiserver.config.base import Opt
|
||||
|
||||
debug = Opt(
|
@ -15,6 +15,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import StrictBool
|
||||
|
||||
from skyline_apiserver.config.base import Opt
|
||||
|
||||
show_raw_sql = Opt(
|
@ -17,6 +17,7 @@ from __future__ import annotations
|
||||
from typing import Dict, List
|
||||
|
||||
from pydantic import HttpUrl, StrictInt, StrictStr
|
||||
|
||||
from skyline_apiserver.config.base import Opt
|
||||
from skyline_apiserver.types import InterfaceType
|
||||
|
@ -17,6 +17,7 @@ from __future__ import annotations
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from pydantic.types import StrictStr
|
||||
|
||||
from skyline_apiserver.config.base import Opt
|
||||
|
||||
base_settings = Opt(
|
@ -19,6 +19,7 @@ import uuid
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
from jose import jwt
|
||||
|
||||
from skyline_apiserver import __version__, schemas
|
||||
from skyline_apiserver.client import utils
|
||||
from skyline_apiserver.client.utils import get_system_session
|
@ -16,10 +16,11 @@ from logging import StreamHandler, basicConfig
|
||||
|
||||
from alembic import context
|
||||
from databases import DatabaseURL
|
||||
from sqlalchemy import create_engine, pool
|
||||
|
||||
from skyline_apiserver.config import CONF, configure
|
||||
from skyline_apiserver.db.models import METADATA
|
||||
from skyline_apiserver.log import setup as log_setup
|
||||
from sqlalchemy import create_engine, pool
|
||||
|
||||
configure("skyline")
|
||||
basicConfig()
|
@ -18,9 +18,10 @@ import time
|
||||
from functools import wraps
|
||||
from typing import Any
|
||||
|
||||
from skyline_apiserver.types import Fn
|
||||
from sqlalchemy import delete, func, insert, select, update
|
||||
|
||||
from skyline_apiserver.types import Fn
|
||||
|
||||
from .base import DB, inject_db
|
||||
from .models import RevokedToken, Settings
|
||||
|
@ -17,6 +17,7 @@ from __future__ import annotations
|
||||
from contextvars import ContextVar
|
||||
|
||||
from databases import Database, DatabaseURL, core
|
||||
|
||||
from skyline_apiserver.config import CONF
|
||||
|
||||
DATABASE = None
|
@ -17,12 +17,13 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi import FastAPI
|
||||
from starlette.middleware.cors import CORSMiddleware
|
||||
|
||||
from skyline_apiserver.api.v1 import api_router
|
||||
from skyline_apiserver.config import CONF, configure
|
||||
from skyline_apiserver.db import setup as db_setup
|
||||
from skyline_apiserver.log import LOG, setup as log_setup
|
||||
from skyline_apiserver.policy import setup as policies_setup
|
||||
from starlette.middleware.cors import CORSMiddleware
|
||||
|
||||
PROJECT_NAME = "Skyline API"
|
||||
API_PREFIX = "/api/v1"
|
@ -21,6 +21,7 @@ import attr
|
||||
from immutables import Map
|
||||
from keystoneauth1.access.access import AccessInfoV3
|
||||
from oslo_policy._checks import _check
|
||||
|
||||
from skyline_apiserver.config import CONF
|
||||
|
||||
from .manager.base import APIRule
|
@ -18,6 +18,7 @@ from typing import List
|
||||
|
||||
from oslo_policy import _parser # type: ignore
|
||||
from oslo_policy.policy import DocumentedRuleDefault, RuleDefault # type: ignore
|
||||
|
||||
from skyline_apiserver.schemas.policy_manager import Operation, OperationsSchema, ScopeTypesSchema
|
||||
|
||||
|
@ -18,6 +18,7 @@ from typing import Any, Dict, List, Optional
|
||||
|
||||
from jose import jwt
|
||||
from pydantic import BaseModel
|
||||
|
||||
from skyline_apiserver import config
|
||||
from skyline_apiserver.types import constants
|
||||
|
@ -16,6 +16,7 @@ import os
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
|
||||
from skyline_apiserver import main
|
||||
from skyline_apiserver.config import CONF
|
||||
|
@ -19,6 +19,7 @@ from typing import Any, Dict
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from six.moves.urllib import parse
|
||||
|
||||
from skyline_apiserver import main
|
||||
|
||||
|
@ -17,6 +17,7 @@ import time
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
|
||||
from skyline_apiserver import __version__, main
|
||||
from skyline_apiserver.config import CONF
|
||||
from skyline_apiserver.db import api as db_api, setup as db_setup
|
@ -17,6 +17,7 @@ import uuid
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
|
||||
from skyline_apiserver import main
|
||||
from skyline_apiserver.config import CONF
|
||||
from skyline_apiserver.types import constants
|
@ -18,6 +18,7 @@ import pytest
|
||||
from _pytest.mark import ParameterSet
|
||||
from asgi_lifespan import LifespanManager
|
||||
from httpx import AsyncClient
|
||||
|
||||
from skyline_apiserver.config import CONF
|
||||
from skyline_apiserver.main import app
|
||||
from skyline_apiserver.tests.models import TestData
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user