diff --git a/tests/framework/artifacts.py b/tests/framework/artifacts.py index 0ed27c16b61..701f26cdd40 100644 --- a/tests/framework/artifacts.py +++ b/tests/framework/artifacts.py @@ -75,10 +75,10 @@ def jailer(self): @property def version(self): - """Return Firecracker's version: `X.Y.Z`.""" - # Get the filename, split on '-' and trim the leading 'v'. - # sample: firecracker-v1.2.0 - return self.path.name.split("-")[1][1:] + """Return Firecracker's version: `X.Y.Z-prerelase`.""" + # Get the filename, split on the first '-' and trim the leading 'v'. + # sample: firecracker-v1.2.0-alpha + return self.path.name.split("-", 1)[1][1:] @property def version_tuple(self): @@ -132,7 +132,7 @@ def working_version_as_artifact(): Return working copy of Firecracker as a release artifact """ cargo_version = get_firecracker_version_from_toml() - return FirecrackerArtifact(current_release(cargo_version.base_version)[0]) + return FirecrackerArtifact(current_release(str(cargo_version))[0]) def firecracker_artifacts(): diff --git a/tests/framework/utils.py b/tests/framework/utils.py index f35819236ad..35df48c7d7a 100644 --- a/tests/framework/utils.py +++ b/tests/framework/utils.py @@ -16,8 +16,8 @@ from contextlib import contextmanager from typing import Dict -import packaging.version import psutil +import semver from tenacity import ( Retrying, retry, @@ -381,7 +381,7 @@ def get_firecracker_version_from_toml(): """ cmd = "cd ../src/firecracker && cargo pkgid | cut -d# -f2 | cut -d: -f2" _, stdout, _ = check_output(cmd) - return packaging.version.parse(stdout) + return semver.Version.parse(stdout) def get_kernel_version(level=2): diff --git a/tests/integration_tests/functional/test_api.py b/tests/integration_tests/functional/test_api.py index e7c730acc94..24283228f9a 100644 --- a/tests/integration_tests/functional/test_api.py +++ b/tests/integration_tests/functional/test_api.py @@ -10,8 +10,8 @@ import resource from pathlib import Path -import packaging.version import pytest +import semver import host_tools.drive as drive_tools import host_tools.network as net_tools @@ -923,14 +923,12 @@ def test_api_version(uvm_plain): assert preboot_response.json() == postboot_response.json() cargo_version = get_firecracker_version_from_toml() - api_version = packaging.version.parse( - preboot_response.json()["firecracker_version"] - ) + api_version = semver.Version.parse(preboot_response.json()["firecracker_version"]) # Cargo version should match FC API version assert cargo_version == api_version - binary_version = packaging.version.parse(test_microvm.firecracker_version) + binary_version = semver.Version.parse(test_microvm.firecracker_version) assert api_version == binary_version diff --git a/tools/devctr/Dockerfile b/tools/devctr/Dockerfile index 9b9c52ecdf1..0ee47d7b5ce 100644 --- a/tools/devctr/Dockerfile +++ b/tools/devctr/Dockerfile @@ -156,7 +156,7 @@ RUN cd /usr/include/$ARCH-linux-musl \ && ln -s ../asm-generic asm-generic # Install static version of libseccomp -# We need to compile from source because +# We need to compile from source because # libseccomp provided by the distribution is not # compiled with musl-gcc and we need this # for our musl builds. diff --git a/tools/devctr/poetry.lock b/tools/devctr/poetry.lock index 62018578d73..637e4362018 100644 --- a/tools/devctr/poetry.lock +++ b/tools/devctr/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -2147,6 +2147,18 @@ dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy (==1.10.0)", "pycodest doc = ["intersphinx_registry", "jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.19.1)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0,<8.0.0)", "sphinx-copybutton", "sphinx-design (>=0.4.0)"] test = ["Cython", "array-api-strict (>=2.0,<2.1.1)", "asv", "gmpy2", "hypothesis (>=6.30)", "meson", "mpmath", "ninja ; sys_platform != \"emscripten\"", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +[[package]] +name = "semver" +version = "3.0.4" +description = "Python helper for Semantic Versioning (https://semver.org)" +optional = false +python-versions = ">=3.7" +groups = ["main"] +files = [ + {file = "semver-3.0.4-py3-none-any.whl", hash = "sha256:9c824d87ba7f7ab4a1890799cec8596f15c1241cb473404ea1cb0c55e4b04746"}, + {file = "semver-3.0.4.tar.gz", hash = "sha256:afc7d8c584a5ed0a11033af086e8af226a9c0b206f313e0301f8dd7b6b589602"}, +] + [[package]] name = "setproctitle" version = "1.3.6" @@ -2581,4 +2593,4 @@ propcache = ">=0.2.1" [metadata] lock-version = "2.1" python-versions = "^3.10.0" -content-hash = "95b0cf9fbdb252f8db0f1252da9373862660af491300136524e80c9dce79ff2b" +content-hash = "bb8080a3d8d9c807d8754ea4b415f4a2474598b5868d8ecfd26a545347cf149d" diff --git a/tools/devctr/pyproject.toml b/tools/devctr/pyproject.toml index 5739c73ed83..db70f41b2cb 100644 --- a/tools/devctr/pyproject.toml +++ b/tools/devctr/pyproject.toml @@ -34,6 +34,7 @@ requests-unixsocket2 = "^0.4.0" scipy = "^1.11.2" setproctitle = "^1.3.2" tenacity = "^8.2.2" +semver = "^3.0.4" [tool.poetry.group.dev.dependencies] diff --git a/tools/devtool b/tools/devtool index 5b59e17228e..9d12c58fd60 100755 --- a/tools/devtool +++ b/tools/devtool @@ -68,7 +68,7 @@ DEVCTR_IMAGE_NO_TAG="public.ecr.aws/firecracker/fcuvm" # Development container tag -DEVCTR_IMAGE_TAG=${DEVCTR_IMAGE_TAG:-v81} +DEVCTR_IMAGE_TAG=${DEVCTR_IMAGE_TAG:-v82} # Development container image (name:tag) # This should be updated whenever we upgrade the development container.