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
10 changed files with 29 additions and 30 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

@ -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)
@ -91,14 +91,14 @@ else
endif endif
build: skyline_console/skyline_console.tar.gz skyline_console/commit_id build: skyline_console/skyline_console.tar.gz skyline_console/commit_id
$(build_cmd) --no-cache --pull --force-rm \ $(build_cmd) --no-cache --pull --force-rm \
--build-arg GIT_CONSOLE_COMMIT=$(file < skyline_console/commit_id) \ --build-arg GIT_CONSOLE_COMMIT=$(shell cat skyline_console/commit_id) \
--build-arg GIT_BRANCH=$(GIT_BRANCH) \ --build-arg GIT_BRANCH=$(GIT_BRANCH) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \ --build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg RELEASE_VERSION=$(RELEASE_VERSION) \ --build-arg RELEASE_VERSION=$(RELEASE_VERSION) \
$(BUILD_ARGS) -f $(DOCKER_FILE) -t $(IMAGE):$(IMAGE_TAG) $(BUILD_CONTEXT) $(BUILD_ARGS) -f $(DOCKER_FILE) -t $(IMAGE):$(IMAGE_TAG) $(BUILD_CONTEXT)
devbuild: skyline_console/skyline_console.tar.gz skyline_console/commit_id devbuild: skyline_console/skyline_console.tar.gz skyline_console/commit_id
$(build_cmd) \ $(build_cmd) \
--build-arg GIT_CONSOLE_COMMIT=$(file < skyline_console/commit_id) \ --build-arg GIT_CONSOLE_COMMIT=$(shell cat skyline_console/commit_id) \
--build-arg GIT_BRANCH=devbuild \ --build-arg GIT_BRANCH=devbuild \
--build-arg GIT_COMMIT=devbuild \ --build-arg GIT_COMMIT=devbuild \
--build-arg RELEASE_VERSION=devbuild \ --build-arg RELEASE_VERSION=devbuild \

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 +1,6 @@
pbr>=5.8.0 # Apache-2.0 pbr>=5.8.0 # Apache-2.0
fastapi<=0.58.1 # MIT fastapi<=0.58.1 # MIT
pydantic<=1.8.2 # MIT 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

View File

@ -19,6 +19,8 @@ classifier =
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
project_urls: project_urls:
Source=https://opendev.org/openstack/skyline-apiserver Source=https://opendev.org/openstack/skyline-apiserver
Tracker=https://bugs.launchpad.net/skyline-apiserver Tracker=https://bugs.launchpad.net/skyline-apiserver

View File

@ -165,7 +165,7 @@ async def list_servers(
sort_dirs=[sort_dirs.value] if sort_dirs else None, sort_dirs=[sort_dirs.value] if sort_dirs else None,
) )
result = [] result: List = []
server_ids = [] server_ids = []
image_ids = [] image_ids = []
root_device_ids = [] root_device_ids = []
@ -752,13 +752,13 @@ async def list_volume_snapshots(
) )
except NotFound as ex: except NotFound as ex:
LOG.debug(f"Not found volume snapshot with id '{uuid}': {ex}") LOG.debug(f"Not found volume snapshot with id '{uuid}': {ex}")
return schemas.VolumeSnapshotsResponse(**{"count": 0, "volume_snapshots": []}) return schemas.VolumeSnapshotsResponse(count=0, volume_snapshots=[])
if volume_snapshot.project_id != profile.project.id: if volume_snapshot.project_id != profile.project.id:
LOG.debug( LOG.debug(
f"Volume snapshot with id '{uuid}' is in project " f"Volume snapshot with id '{uuid}' is in project "
f"'{volume_snapshot.project_id}', not in '{profile.project.id}'" f"'{volume_snapshot.project_id}', not in '{profile.project.id}'"
) )
return schemas.VolumeSnapshotsResponse(**{"count": 0, "volume_snapshots": []}) return schemas.VolumeSnapshotsResponse(count=0, volume_snapshots=[])
snapshot_session = get_system_session() snapshot_session = get_system_session()
search_opts["all_tenants"] = True search_opts["all_tenants"] = True

View File

@ -15,7 +15,7 @@
from __future__ import annotations from __future__ import annotations
from pathlib import PurePath from pathlib import PurePath
from typing import Any, List, Optional, Tuple, Union from typing import Any, Dict, List, Optional, Tuple, Union
from fastapi import APIRouter, Depends, Form, Header, HTTPException, Request, Response, status from fastapi import APIRouter, Depends, Form, Header, HTTPException, Request, Response, status
from fastapi.responses import RedirectResponse from fastapi.responses import RedirectResponse
@ -218,12 +218,12 @@ async def login(
response_description="OK", response_description="OK",
) )
async def get_sso(request: Request) -> schemas.SSO: async def get_sso(request: Request) -> schemas.SSO:
sso = { sso: Dict = {
"enable_sso": False, "enable_sso": False,
"protocols": [], "protocols": [],
} }
if CONF.openstack.sso_enabled: if CONF.openstack.sso_enabled:
protocols = [] protocols: List = []
ks_url = CONF.openstack.keystone_url.rstrip("/") ks_url = CONF.openstack.keystone_url.rstrip("/")
url_scheme = "https" if CONF.default.ssl_enabled else "http" url_scheme = "https" if CONF.default.ssl_enabled else "http"

View File

@ -14,7 +14,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Dict from typing import Dict, List
from fastapi import APIRouter, Depends, HTTPException, status from fastapi import APIRouter, Depends, HTTPException, status
from keystoneauth1.exceptions.http import ( from keystoneauth1.exceptions.http import (
@ -113,7 +113,7 @@ async def list_policies(
LOG.debug("Keystone is not reachable. No privilege to access system scope.") LOG.debug("Keystone is not reachable. No privilege to access system scope.")
target = _generate_target(profile) target = _generate_target(profile)
results = [] results: List = []
services = constants.SUPPORTED_SERVICE_EPS.keys() services = constants.SUPPORTED_SERVICE_EPS.keys()
for service in services: for service in services:
try: try:
@ -176,7 +176,7 @@ async def check_policies(
target = _generate_target(profile) target = _generate_target(profile)
target.update(policy_rules.target if policy_rules.target else {}) target.update(policy_rules.target if policy_rules.target else {})
try: try:
result = [] result: List = []
for policy_rule in policy_rules.rules: for policy_rule in policy_rules.rules:
service = policy_rule.split(":", 1)[0] service = policy_rule.split(":", 1)[0]
rule = policy_rule.split(":", 1)[1] rule = policy_rule.split(":", 1)[1]

View File

@ -79,7 +79,7 @@ class TestOpt:
{ {
"name": FAKER.text.word(), "name": FAKER.text.word(),
"description": FAKER.text.word(), "description": FAKER.text.word(),
"schema": object, "schema": RuntimeError,
}, },
RuntimeError, RuntimeError,
), ),

21
tox.ini
View File

@ -2,22 +2,20 @@
minversion = 3.18.0 minversion = 3.18.0
requires = virtualenv>=20.4.2 requires = virtualenv>=20.4.2
skipsdist = True skipsdist = True
# python runtimes: https://governance.openstack.org/tc/reference/project-testing-interface.html#tested-runtimes envlist = pep8,py3,functional
envlist = pep8,py38,functional
# this allows tox to infer the base python from the environment name # this allows tox to infer the base python from the environment name
# and override any basepython configured in this file # and override any basepython configured in this file
ignore_basepython_conflict=true ignore_basepython_conflict=true
[testenv] [testenv]
basepython = python3 usedevelop = true
setenv = VIRTUAL_ENV={envdir} setenv =
PYTHONWARNINGS=default::DeprecationWarning VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1 OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1 OS_STDERR_CAPTURE=1
usedevelop = True
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
@ -68,10 +66,9 @@ commands =
black --check --diff --color skyline_apiserver --line-length 98 black --check --diff --color skyline_apiserver --line-length 98
flake8 {posargs} . flake8 {posargs} .
[testenv:py38] [testenv:py{3,38,39,310,311}]
description = description =
Run pytest. Run pytest.
envdir = {toxworkdir}/shared
deps = deps =
{[testenv]deps} {[testenv]deps}
extras = extras =
@ -80,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 =