fix: Add sample yaml config file
Under etc dictory, add sample yaml config file named skyline-apiserver.yaml.sample Updated the README.md and README-zh_CN.md file to make quick start more clearly. Closes-Bug: #1931673 Change-Id: I023cfbeac33543d2989f5017c878cd17160f8c76
This commit is contained in:
parent
38ea9e3d59
commit
c1bb509391
@ -12,25 +12,50 @@
|
|||||||
|
|
||||||
### 开发模式
|
### 开发模式
|
||||||
|
|
||||||
**仅支持 Linux (由于 uvloop 和 cython 库)**
|
**支持 Linux 和 Mac 操作系统 (推荐 Linux 操作系统) (由于 uvloop 和 cython 库)**
|
||||||
|
|
||||||
```bash
|
- 安装依赖包
|
||||||
make install
|
|
||||||
cp etc/skyline_apiserver.yaml.sample etc/skyline_apiserver.yaml
|
|
||||||
export OS_CONFIG_DIR=$(pwd)/etc
|
|
||||||
rm -f /tmp/skyline_apiserver.db
|
|
||||||
make db_sync
|
|
||||||
```
|
|
||||||
|
|
||||||
```console
|
```bash
|
||||||
# $ poetry run gunicorn -c etc/gunicorn.py --reload skyline_apiserver.main:app
|
make install
|
||||||
$ poetry run uvicorn --reload --port 28000 --log-level debug skyline_apiserver.main:app
|
```
|
||||||
|
|
||||||
INFO: Uvicorn running on http://127.0.0.1:28000 (Press CTRL+C to quit)
|
- 配置 skyline-apiserver.yaml 文件
|
||||||
INFO: Started reloader process [154033] using statreload
|
|
||||||
INFO: Started server process [154037]
|
|
||||||
INFO: Waiting for application startup.
|
|
||||||
INFO: Application startup complete.
|
|
||||||
```
|
|
||||||
|
|
||||||
此时可访问在线 API 文档:`http://127.0.0.1:28000/docs`
|
可能你需要根据实际的环境修改以下参数:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- database_url (你可以设置为 sqlite:////tmp/skyline.db 来使用 sqlite)
|
||||||
|
- default_region
|
||||||
|
- keystone_url
|
||||||
|
- system_project
|
||||||
|
- system_project_domain
|
||||||
|
- system_user_domain
|
||||||
|
- system_user_name
|
||||||
|
- system_user_password
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp etc/skyline-apiserver.yaml.sample etc/skyline-apiserver.yaml
|
||||||
|
export OS_CONFIG_DIR=$(pwd)/etc
|
||||||
|
```
|
||||||
|
|
||||||
|
- 初始化 skyline 数据库
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make db_sync
|
||||||
|
```
|
||||||
|
|
||||||
|
- 运行服务
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ poetry run uvicorn --reload --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
|
||||||
|
INFO: Started server process [154037]
|
||||||
|
INFO: Waiting for application startup.
|
||||||
|
INFO: Application startup complete.
|
||||||
|
```
|
||||||
|
|
||||||
|
此时你可访问在线 API 文档:`http://127.0.0.1:28000/docs`
|
||||||
|
59
README.md
59
README.md
@ -12,25 +12,50 @@ English | [简体中文](./README-zh_CN.md)
|
|||||||
|
|
||||||
### Development mode
|
### Development mode
|
||||||
|
|
||||||
**Only support Linux (Because uvloop & cython)**
|
**Support Linux & Mac OS (Recommend Linux OS) (Because uvloop & cython)**
|
||||||
|
|
||||||
```bash
|
- Installing dependency packages
|
||||||
make install
|
|
||||||
cp etc/skyline_apiserver.yaml.sample etc/skyline_apiserver.yaml
|
|
||||||
export OS_CONFIG_DIR=$(pwd)/etc
|
|
||||||
rm -f /tmp/skyline_apiserver.db
|
|
||||||
make db_sync
|
|
||||||
```
|
|
||||||
|
|
||||||
```console
|
```bash
|
||||||
# $ poetry run gunicorn -c etc/gunicorn.py --reload skyline_apiserver.main:app
|
make install
|
||||||
$ poetry run uvicorn --reload --port 28000 --log-level debug skyline_apiserver.main:app
|
```
|
||||||
|
|
||||||
INFO: Uvicorn running on http://127.0.0.1:28000 (Press CTRL+C to quit)
|
- Set skyline-apiserver.yaml config file
|
||||||
INFO: Started reloader process [154033] using statreload
|
|
||||||
INFO: Started server process [154037]
|
Maybe you should change the params with your real environment as followed:
|
||||||
INFO: Waiting for application startup.
|
|
||||||
INFO: Application startup complete.
|
```yaml
|
||||||
```
|
- database_url (you can set sqlite:////tmp/skyline.db to use sqlite)
|
||||||
|
- default_region
|
||||||
|
- keystone_url
|
||||||
|
- system_project
|
||||||
|
- system_project_domain
|
||||||
|
- system_user_domain
|
||||||
|
- system_user_name
|
||||||
|
- system_user_password
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp etc/skyline-apiserver.yaml.sample etc/skyline-apiserver.yaml
|
||||||
|
export OS_CONFIG_DIR=$(pwd)/etc
|
||||||
|
```
|
||||||
|
|
||||||
|
- Init skyline database
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make db_sync
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run server
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ poetry run uvicorn --reload --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
|
||||||
|
INFO: Started server process [154037]
|
||||||
|
INFO: Waiting for application startup.
|
||||||
|
INFO: Application startup complete.
|
||||||
|
```
|
||||||
|
|
||||||
You can now access the online API documentation: `http://127.0.0.1:28000/docs`
|
You can now access the online API documentation: `http://127.0.0.1:28000/docs`
|
||||||
|
117
etc/skyline-apiserver.yaml.sample
Normal file
117
etc/skyline-apiserver.yaml.sample
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
default:
|
||||||
|
access_token_expire: 3600
|
||||||
|
access_token_renew: 1800
|
||||||
|
cors_allow_origins: []
|
||||||
|
database_url: mysql://root:root@localhost:3306/skyline
|
||||||
|
debug: false
|
||||||
|
log_dir: ./log
|
||||||
|
secret_key: aCtmgbcUqYUy_HNVg5BDXCaeJgJQzHJXwqbXr0Nmb2o
|
||||||
|
session_name: session
|
||||||
|
developer:
|
||||||
|
show_raw_sql: false
|
||||||
|
openstack:
|
||||||
|
base_domains:
|
||||||
|
- heat_user_domain
|
||||||
|
base_roles:
|
||||||
|
- keystone_system_admin
|
||||||
|
- keystone_system_reader
|
||||||
|
- keystone_project_admin
|
||||||
|
- keystone_project_member
|
||||||
|
- keystone_project_reader
|
||||||
|
- nova_system_admin
|
||||||
|
- nova_system_reader
|
||||||
|
- nova_project_admin
|
||||||
|
- nova_project_member
|
||||||
|
- nova_project_reader
|
||||||
|
- cinder_system_admin
|
||||||
|
- cinder_system_reader
|
||||||
|
- cinder_project_admin
|
||||||
|
- cinder_project_member
|
||||||
|
- cinder_project_reader
|
||||||
|
- glance_system_admin
|
||||||
|
- glance_system_reader
|
||||||
|
- glance_project_admin
|
||||||
|
- glance_project_member
|
||||||
|
- glance_project_reader
|
||||||
|
- neutron_system_admin
|
||||||
|
- neutron_system_reader
|
||||||
|
- neutron_project_admin
|
||||||
|
- neutron_project_member
|
||||||
|
- neutron_project_reader
|
||||||
|
- heat_system_admin
|
||||||
|
- heat_system_reader
|
||||||
|
- heat_project_admin
|
||||||
|
- heat_project_member
|
||||||
|
- heat_project_reader
|
||||||
|
- placement_system_admin
|
||||||
|
- placement_system_reader
|
||||||
|
- panko_system_admin
|
||||||
|
- panko_system_reader
|
||||||
|
- panko_project_admin
|
||||||
|
- panko_project_member
|
||||||
|
- panko_project_reader
|
||||||
|
- ironic_system_admin
|
||||||
|
- ironic_system_reader
|
||||||
|
- octavia_system_admin
|
||||||
|
- octavia_system_reader
|
||||||
|
- octavia_project_admin
|
||||||
|
- octavia_project_member
|
||||||
|
- octavia_project_reader
|
||||||
|
default_region: RegionOne
|
||||||
|
extension_mapping:
|
||||||
|
fwaas_v2: neutron_firewall
|
||||||
|
vpnaas: neutron_vpn
|
||||||
|
interface_type: internal
|
||||||
|
keystone_url: http://localhost:5000/v3/
|
||||||
|
nginx_prefix: /api/openstack
|
||||||
|
reclaim_instance_interval: 604800
|
||||||
|
service_mapping:
|
||||||
|
compute: nova
|
||||||
|
identity: keystone
|
||||||
|
image: glance
|
||||||
|
network: neutron
|
||||||
|
orchestration: heat
|
||||||
|
placement: placement
|
||||||
|
volumev3: cinder
|
||||||
|
system_admin_roles:
|
||||||
|
- admin
|
||||||
|
- system_admin
|
||||||
|
system_project: service
|
||||||
|
system_project_domain: Default
|
||||||
|
system_reader_roles:
|
||||||
|
- system_reader
|
||||||
|
system_user_domain: Default
|
||||||
|
system_user_name: skyline
|
||||||
|
system_user_password: password
|
||||||
|
setting:
|
||||||
|
base_settings:
|
||||||
|
- flavor_families
|
||||||
|
- gpu_models
|
||||||
|
- usb_models
|
||||||
|
- license
|
||||||
|
- currency
|
||||||
|
currency:
|
||||||
|
en: CNY
|
||||||
|
zh: 元
|
||||||
|
flavor_families:
|
||||||
|
- architecture: x86_architecture
|
||||||
|
categories:
|
||||||
|
- name: general_purpose
|
||||||
|
properties: []
|
||||||
|
- name: compute_optimized
|
||||||
|
properties: []
|
||||||
|
- name: memory_optimized
|
||||||
|
properties: []
|
||||||
|
- name: high_clock_speed
|
||||||
|
properties: []
|
||||||
|
- architecture: heterogeneous_computing
|
||||||
|
categories:
|
||||||
|
- name: compute_optimized_type_with_gpu
|
||||||
|
properties: []
|
||||||
|
- name: visualization_compute_optimized_type_with_gpu
|
||||||
|
properties: []
|
||||||
|
gpu_models:
|
||||||
|
- nvidia_t4
|
||||||
|
license: ''
|
||||||
|
usb_models:
|
||||||
|
- usb_c
|
Loading…
Reference in New Issue
Block a user