Update base image to 2023.10.0 (#102126)

This commit is contained in:
Franck Nijhof 2023-10-18 19:11:41 +02:00 committed by GitHub
parent 1b73219137
commit 664e490cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 60 deletions

View File

@ -3,3 +3,4 @@ ignored:
- DL3008
- DL3013
- DL3018
- DL3042

View File

@ -14,41 +14,29 @@ COPY requirements.txt homeassistant/
COPY homeassistant/package_constraints.txt homeassistant/homeassistant/
RUN \
pip3 install \
--no-cache-dir \
--only-binary=:all: \
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
-r homeassistant/requirements.txt
COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/
RUN \
if ls homeassistant/home_assistant_frontend*.whl 1> /dev/null 2>&1; then \
pip3 install \
--no-cache-dir \
--no-index \
homeassistant/home_assistant_frontend-*.whl; \
pip3 install homeassistant/home_assistant_frontend-*.whl; \
fi \
&& if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \
pip3 install \
--no-cache-dir \
--no-index \
homeassistant/home_assistant_intents-*.whl; \
pip3 install homeassistant/home_assistant_intents-*.whl; \
fi \
&& \
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
pip3 install \
--no-cache-dir \
--only-binary=:all: \
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
-r homeassistant/requirements_all.txt
## Setup Home Assistant Core
COPY . homeassistant/
RUN \
pip3 install \
--no-cache-dir \
--only-binary=:all: \
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
-e ./homeassistant \
&& python3 -m compileall \
homeassistant/homeassistant

View File

@ -1,10 +1,10 @@
image: ghcr.io/home-assistant/{arch}-homeassistant
build_from:
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2023.09.0
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.09.0
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.09.0
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.09.0
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.09.0
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2023.10.0
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.10.0
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.10.0
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.10.0
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.10.0
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io

View File

@ -85,11 +85,8 @@ def pip_kwargs(config_dir: str | None) -> dict[str, Any]:
is_docker = pkg_util.is_docker_env()
kwargs = {
"constraints": os.path.join(os.path.dirname(__file__), CONSTRAINT_FILE),
"no_cache_dir": is_docker,
"timeout": PIP_TIMEOUT,
}
if "WHEELS_LINKS" in os.environ:
kwargs["find_links"] = os.environ["WHEELS_LINKS"]
if not (config_dir is None or pkg_util.is_virtual_env()) and not is_docker:
kwargs["target"] = os.path.join(config_dir, "deps")
return kwargs

View File

@ -67,9 +67,7 @@ def install_package(
upgrade: bool = True,
target: str | None = None,
constraints: str | None = None,
find_links: str | None = None,
timeout: int | None = None,
no_cache_dir: bool | None = False,
) -> bool:
"""Install a package on PyPi. Accepts pip compatible package strings.
@ -81,14 +79,10 @@ def install_package(
args = [sys.executable, "-m", "pip", "install", "--quiet", package]
if timeout:
args += ["--timeout", str(timeout)]
if no_cache_dir:
args.append("--no-cache-dir")
if upgrade:
args.append("--upgrade")
if constraints is not None:
args += ["--constraint", constraints]
if find_links is not None:
args += ["--find-links", find_links, "--prefer-binary"]
if target:
assert not is_virtual_env()
# This only works if not running in venv

View File

@ -42,7 +42,6 @@ async def test_requirement_installed_in_venv(hass: HomeAssistant) -> None:
"package==0.0.1",
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
timeout=60,
no_cache_dir=False,
)
@ -64,7 +63,6 @@ async def test_requirement_installed_in_deps(hass: HomeAssistant) -> None:
target=hass.config.path("deps"),
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
timeout=60,
no_cache_dir=False,
)
@ -379,10 +377,8 @@ async def test_install_with_wheels_index(hass: HomeAssistant) -> None:
assert mock_inst.call_args == call(
"hello==1.0.0",
find_links="https://wheels.hass.io/test",
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
timeout=60,
no_cache_dir=True,
)
@ -406,7 +402,6 @@ async def test_install_on_docker(hass: HomeAssistant) -> None:
"hello==1.0.0",
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
timeout=60,
no_cache_dir=True,
)

View File

@ -194,33 +194,6 @@ def test_install_constraint(mock_sys, mock_popen, mock_env_copy, mock_venv) -> N
assert mock_popen.return_value.communicate.call_count == 1
def test_install_find_links(mock_sys, mock_popen, mock_env_copy, mock_venv) -> None:
"""Test install with find-links on not installed package."""
env = mock_env_copy()
link = "https://wheels-repository"
assert package.install_package(TEST_NEW_REQ, False, find_links=link)
assert mock_popen.call_count == 2
assert mock_popen.mock_calls[0] == call(
[
mock_sys.executable,
"-m",
"pip",
"install",
"--quiet",
TEST_NEW_REQ,
"--find-links",
link,
"--prefer-binary",
],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
env=env,
close_fds=False,
)
assert mock_popen.return_value.communicate.call_count == 1
async def test_async_get_user_site(mock_env_copy) -> None:
"""Test async get user site directory."""
deps_dir = "/deps_dir"