Compare commits

..

5 Commits

Author SHA1 Message Date
zhuboxiang
718cfe2b36 Change to use shell cat to fetch commit_id
Command file can not do correct when run it on centos 7
with docker to build. So Change it to use shell cat.

Change-Id: I1186b22c224bbc6e828f71014f5b7f920df3a651
(cherry picked from commit 2a3a08e328)
2024-07-10 02:41:17 +00:00
zhuboxiang
9b85645aab fix: Set stable-2024.1 version of skyline-console to use
1. Use version of stable-2024.1 for skyline-console package
2. Set docker image tag as 2024.1

Change-Id: Ifedbefe00f6f7d52393fef507f31ddcaf1d122b9
2024-07-02 14:02:18 +08:00
Michal Arbet
c7195d5bcb Fix skyline-apiserver on python3.11
Bump pydantic version which fixes skyline-apiserver
when running under python3.11.

Closes-Bug: #2047145
Change-Id: Idb1897f64ffaf0cd0fbee4f7f198935386a5f599
(cherry picked from commit eea81cef1e)
2024-06-21 18:15:35 +02:00
OpenStack Release Bot
b18edc14c0 Update TOX_CONSTRAINTS_FILE for stable/2024.1
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/2024.1 branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I99531dd8dab86694f3b836cdef1ef48a65a95b27
2024-03-15 14:21:23 +00:00
OpenStack Release Bot
c5a20b98e4 Update .gitreview for stable/2024.1
Change-Id: Idb6dcf86c5e071c811b1166923f711731351aabb
2024-03-15 14:21:21 +00:00
14 changed files with 65 additions and 44 deletions

View File

@ -2,4 +2,4 @@
host=review.opendev.org host=review.opendev.org
port=29418 port=29418
project=openstack/skyline-apiserver.git project=openstack/skyline-apiserver.git
defaultbranch=master defaultbranch=stable/2024.1

View File

@ -25,13 +25,40 @@
tox_install_siblings: false tox_install_siblings: false
tox_envlist: functional tox_envlist: functional
- job:
name: skyline-tox-py38
parent: openstack-tox-py38
description: |
Skyline py38 unittest tests
vars:
python_version: 3.8
tox_envlist: py38
- job:
name: skyline-tox-pep8-py38
parent: openstack-tox-py38
description: |
Skyline code static analysis
vars:
python_version: 3.8
tox_envlist: pep8
- project: - project:
templates: templates:
- openstack-python3-jobs
- release-notes-jobs-python3 - release-notes-jobs-python3
- publish-openstack-docs-pti - publish-openstack-docs-pti
check: check:
jobs: jobs:
- skyline-tox-py38:
irrelevant-files:
- ^container/.*$
- ^devstack/.*$
- ^docs/.*$
- ^tools/.*$
- ^.*\.rst$
- ^.*\.md$
- ^kolla/.*$
- skyline-tox-pep8-py38
- skyline-functional-devstack: - skyline-functional-devstack:
irrelevant-files: irrelevant-files:
- ^container/.*$ - ^container/.*$
@ -44,6 +71,16 @@
- ^releasenotes/.*$ - ^releasenotes/.*$
gate: gate:
jobs: jobs:
- skyline-tox-py38:
irrelevant-files:
- ^container/.*$
- ^devstack/.*$
- ^docs/.*$
- ^tools/.*$
- ^.*\.rst$
- ^.*\.md$
- ^kolla/.*$
- skyline-tox-pep8-py38
- skyline-functional-devstack: - skyline-functional-devstack:
irrelevant-files: irrelevant-files:
- ^container/.*$ - ^container/.*$

View File

@ -17,7 +17,7 @@ GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT ?= $(shell git rev-parse --verify HEAD) GIT_COMMIT ?= $(shell git rev-parse --verify HEAD)
# URL for skyline-console packages # URL for skyline-console packages
SKYLINE_CONSOLE_PACKAGE_URL ?= "https://tarballs.opendev.org/openstack/skyline-console/skyline-console-master.tar.gz" SKYLINE_CONSOLE_PACKAGE_URL ?= "https://tarballs.opendev.org/openstack/skyline-console/skyline-console-stable-2024.1.tar.gz"
.PHONY: help .PHONY: help
@ -81,7 +81,7 @@ BUILD_ENGINE ?= docker
BUILD_CONTEXT ?= . BUILD_CONTEXT ?= .
DOCKER_FILE ?= container/Dockerfile DOCKER_FILE ?= container/Dockerfile
IMAGE ?= skyline IMAGE ?= skyline
IMAGE_TAG ?= latest IMAGE_TAG ?= 2024.1
ifeq ($(BUILD_ENGINE), docker) ifeq ($(BUILD_ENGINE), docker)
build_cmd = docker build build_cmd = docker build
else ifeq ($(BUILD_ENGINE), buildah) else ifeq ($(BUILD_ENGINE), buildah)

View File

@ -25,12 +25,12 @@ RUN pip install -U /opt/skyline_apiserver/skyline_console/skyline_console.tar.gz
COPY ./requirements.txt /opt/skyline_apiserver/requirements.txt COPY ./requirements.txt /opt/skyline_apiserver/requirements.txt
RUN pip install -r /opt/skyline_apiserver/requirements.txt -chttps://releases.openstack.org/constraints/upper/master RUN pip install -r /opt/skyline_apiserver/requirements.txt -chttps://releases.openstack.org/constraints/upper/2024.1
COPY ./ /opt/skyline_apiserver/ COPY ./ /opt/skyline_apiserver/
RUN git init /opt/skyline_apiserver \ RUN git init /opt/skyline_apiserver \
&& pip install /opt/skyline_apiserver -chttps://releases.openstack.org/constraints/upper/master \ && pip install /opt/skyline_apiserver -chttps://releases.openstack.org/constraints/upper/2024.1 \
&& apt-get clean \ && apt-get clean \
&& rm -rf ~/.cache/pip \ && rm -rf ~/.cache/pip \
&& mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline && mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline

View File

@ -1,6 +0,0 @@
===========================
2024.1 Series Release Notes
===========================
.. release-notes::
:branch: stable/2024.1

View File

@ -1,6 +0,0 @@
===========================
2024.2 Series Release Notes
===========================
.. release-notes::
:branch: stable/2024.2

View File

@ -6,8 +6,6 @@ Skyline APIServer Release Notes
:maxdepth: 1 :maxdepth: 1
unreleased unreleased
2024.2
2024.1
2023.2 2023.2
2023.1 2023.1
zed zed

View File

@ -3,4 +3,4 @@ Zed Series Release Notes
======================== ========================
.. release-notes:: .. release-notes::
:branch: unmaintained/zed :branch: stable/zed

View File

@ -4,8 +4,8 @@ pydantic<=1.10.0 # MIT
uvicorn<=0.17.6 # BSD License (3 clause) uvicorn<=0.17.6 # BSD License (3 clause)
gunicorn>=20.1.0 # MIT gunicorn>=20.1.0 # MIT
python-jose<=3.3.0 # MIT python-jose<=3.3.0 # MIT
databases>=0.9.0 # BSD License (3 clause) databases<=0.8.0 # BSD License (3 clause)
aiomysql>=0.2.0 # MIT aiomysql<=0.1.1 # MIT
aiosqlite<=0.17.0 # MIT aiosqlite<=0.17.0 # MIT
loguru<=0.5.3 # MIT loguru<=0.5.3 # MIT
PyYAML>=5.4.1 # MIT PyYAML>=5.4.1 # MIT

View File

@ -173,10 +173,9 @@ async def login(
regex=constants.INBOUND_HEADER_REGEX, regex=constants.INBOUND_HEADER_REGEX,
), ),
) -> schemas.Profile: ) -> schemas.Profile:
region = credential.region or CONF.openstack.default_region
try: try:
project_scope, unscope_token, default_project_id = await _get_projects_and_unscope_token( project_scope, unscope_token, default_project_id = await _get_projects_and_unscope_token(
region=region, region=credential.region,
domain=credential.domain, domain=credential.domain,
username=credential.username, username=credential.username,
password=credential.password, password=credential.password,
@ -187,13 +186,13 @@ async def login(
default_project_id = None default_project_id = None
project_scope_token = await get_project_scope_token( project_scope_token = await get_project_scope_token(
keystone_token=unscope_token, keystone_token=unscope_token,
region=region, region=credential.region,
project_id=default_project_id or project_scope[0].id, project_id=default_project_id or project_scope[0].id,
) )
profile = await generate_profile( profile = await generate_profile(
keystone_token=project_scope_token, keystone_token=project_scope_token,
region=region, region=credential.region,
) )
profile = await _patch_profile(profile, x_openstack_request_id) profile = await _patch_profile(profile, x_openstack_request_id)

View File

@ -16,9 +16,9 @@ from __future__ import annotations
import time import time
from functools import wraps from functools import wraps
from typing import Any, Union from typing import Any
from sqlalchemy import Insert, Update, delete, func, insert, select, update from sqlalchemy import delete, func, insert, select, update
from skyline_apiserver.types import Fn from skyline_apiserver.types import Fn
@ -41,7 +41,7 @@ def check_db_connected(fn: Fn) -> Any:
async def check_token(token_id: str) -> bool: async def check_token(token_id: str) -> bool:
count_label = "revoked_count" count_label = "revoked_count"
query = ( query = (
select(func.count(RevokedToken.c.uuid).label(count_label)) select([func.count(RevokedToken.c.uuid).label(count_label)])
.select_from(RevokedToken) .select_from(RevokedToken)
.where(RevokedToken.c.uuid == token_id) .where(RevokedToken.c.uuid == token_id)
) )
@ -76,7 +76,7 @@ async def purge_revoked_token() -> Any:
@check_db_connected @check_db_connected
async def list_settings() -> Any: async def list_settings() -> Any:
query = select(Settings) query = select([Settings])
db = DB.get() db = DB.get()
async with db.transaction(): async with db.transaction():
result = await db.fetch_all(query) result = await db.fetch_all(query)
@ -86,7 +86,7 @@ async def list_settings() -> Any:
@check_db_connected @check_db_connected
async def get_setting(key: str) -> Any: async def get_setting(key: str) -> Any:
query = select(Settings).where(Settings.c.key == key) query = select([Settings]).where(Settings.c.key == key)
db = DB.get() db = DB.get()
async with db.transaction(): async with db.transaction():
result = await db.fetch_one(query) result = await db.fetch_one(query)
@ -97,17 +97,17 @@ async def get_setting(key: str) -> Any:
@check_db_connected @check_db_connected
async def update_setting(key: str, value: Any) -> Any: async def update_setting(key: str, value: Any) -> Any:
get_query = ( get_query = (
select(Settings.c.key, Settings.c.value).where(Settings.c.key == key).with_for_update() select([Settings.c.key, Settings.c.value]).where(Settings.c.key == key).with_for_update()
) )
db = DB.get() db = DB.get()
async with db.transaction(): async with db.transaction():
is_exist = await db.fetch_one(get_query) is_exist = await db.fetch_one(get_query)
stmt: Union[Insert, Update]
if is_exist is None: if is_exist is None:
stmt = insert(Settings).values(key=key, value=value) query = insert(Settings)
await db.execute(query, {"key": key, "value": value})
else: else:
stmt = update(Settings).where(Settings.c.key == key).values(value=value) query = update(Settings).where(Settings.c.key == key)
await db.execute(stmt) await db.execute(query, {"value": value})
result = await db.fetch_one(get_query) result = await db.fetch_one(get_query)
return result return result

View File

@ -24,7 +24,7 @@ from skyline_apiserver.types import constants
class Credential(BaseModel): class Credential(BaseModel):
region: Optional[str] = Field(None, description="Credential identity service region") region: str = Field(..., description="Credential user region")
domain: str = Field(..., description="Credential user domain") domain: str = Field(..., description="Credential user domain")
username: str = Field(..., description="Credential username") username: str = Field(..., description="Credential username")
password: str = Field(..., description="Credential password for user") password: str = Field(..., description="Credential password for user")

View File

@ -2229,6 +2229,7 @@
"Credential": { "Credential": {
"title": "Credential", "title": "Credential",
"required": [ "required": [
"region",
"domain", "domain",
"username", "username",
"password" "password"
@ -2238,7 +2239,7 @@
"region": { "region": {
"title": "Region", "title": "Region",
"type": "string", "type": "string",
"description": "Credential identity service region" "description": "Credential user region"
}, },
"domain": { "domain": {
"title": "Domain", "title": "Domain",

View File

@ -14,8 +14,8 @@ setenv =
OS_STDOUT_CAPTURE=1 OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1 OS_STDERR_CAPTURE=1
deps = deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.1}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
@ -77,7 +77,7 @@ commands =
[testenv:docs] [testenv:docs]
deps = deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.1}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
commands = commands =
@ -106,7 +106,6 @@ commands =
description = description =
Generate swagger files. Generate swagger files.
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
allowlist_externals = skyline-swagger-generator
commands = commands =
skyline-swagger-generator -o swagger.json skyline-swagger-generator -o swagger.json
@ -114,7 +113,6 @@ commands =
description = description =
Generate config files. Generate config files.
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
allowlist_externals = skyline-sample-config-generator
commands = commands =
skyline-sample-config-generator -o etc/skyline.yaml.sample skyline-sample-config-generator -o etc/skyline.yaml.sample