Update base image to 2023.10.0 (#102126)
parent
1b73219137
commit
664e490cfa
|
@ -3,3 +3,4 @@ ignored:
|
||||||
- DL3008
|
- DL3008
|
||||||
- DL3013
|
- DL3013
|
||||||
- DL3018
|
- DL3018
|
||||||
|
- DL3042
|
||||||
|
|
16
Dockerfile
16
Dockerfile
|
@ -14,41 +14,29 @@ COPY requirements.txt homeassistant/
|
||||||
COPY homeassistant/package_constraints.txt homeassistant/homeassistant/
|
COPY homeassistant/package_constraints.txt homeassistant/homeassistant/
|
||||||
RUN \
|
RUN \
|
||||||
pip3 install \
|
pip3 install \
|
||||||
--no-cache-dir \
|
|
||||||
--only-binary=:all: \
|
--only-binary=:all: \
|
||||||
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
|
|
||||||
-r homeassistant/requirements.txt
|
-r homeassistant/requirements.txt
|
||||||
|
|
||||||
COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/
|
COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/
|
||||||
RUN \
|
RUN \
|
||||||
if ls homeassistant/home_assistant_frontend*.whl 1> /dev/null 2>&1; then \
|
if ls homeassistant/home_assistant_frontend*.whl 1> /dev/null 2>&1; then \
|
||||||
pip3 install \
|
pip3 install homeassistant/home_assistant_frontend-*.whl; \
|
||||||
--no-cache-dir \
|
|
||||||
--no-index \
|
|
||||||
homeassistant/home_assistant_frontend-*.whl; \
|
|
||||||
fi \
|
fi \
|
||||||
&& if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \
|
&& if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \
|
||||||
pip3 install \
|
pip3 install homeassistant/home_assistant_intents-*.whl; \
|
||||||
--no-cache-dir \
|
|
||||||
--no-index \
|
|
||||||
homeassistant/home_assistant_intents-*.whl; \
|
|
||||||
fi \
|
fi \
|
||||||
&& \
|
&& \
|
||||||
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
|
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
|
||||||
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
|
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
|
||||||
pip3 install \
|
pip3 install \
|
||||||
--no-cache-dir \
|
|
||||||
--only-binary=:all: \
|
--only-binary=:all: \
|
||||||
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
|
|
||||||
-r homeassistant/requirements_all.txt
|
-r homeassistant/requirements_all.txt
|
||||||
|
|
||||||
## Setup Home Assistant Core
|
## Setup Home Assistant Core
|
||||||
COPY . homeassistant/
|
COPY . homeassistant/
|
||||||
RUN \
|
RUN \
|
||||||
pip3 install \
|
pip3 install \
|
||||||
--no-cache-dir \
|
|
||||||
--only-binary=:all: \
|
--only-binary=:all: \
|
||||||
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
|
|
||||||
-e ./homeassistant \
|
-e ./homeassistant \
|
||||||
&& python3 -m compileall \
|
&& python3 -m compileall \
|
||||||
homeassistant/homeassistant
|
homeassistant/homeassistant
|
||||||
|
|
10
build.yaml
10
build.yaml
|
@ -1,10 +1,10 @@
|
||||||
image: ghcr.io/home-assistant/{arch}-homeassistant
|
image: ghcr.io/home-assistant/{arch}-homeassistant
|
||||||
build_from:
|
build_from:
|
||||||
aarch64: ghcr.io/home-assistant/aarch64-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.09.0
|
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.10.0
|
||||||
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.09.0
|
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.10.0
|
||||||
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.09.0
|
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.10.0
|
||||||
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.09.0
|
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.10.0
|
||||||
codenotary:
|
codenotary:
|
||||||
signer: notary@home-assistant.io
|
signer: notary@home-assistant.io
|
||||||
base_image: notary@home-assistant.io
|
base_image: notary@home-assistant.io
|
||||||
|
|
|
@ -85,11 +85,8 @@ def pip_kwargs(config_dir: str | None) -> dict[str, Any]:
|
||||||
is_docker = pkg_util.is_docker_env()
|
is_docker = pkg_util.is_docker_env()
|
||||||
kwargs = {
|
kwargs = {
|
||||||
"constraints": os.path.join(os.path.dirname(__file__), CONSTRAINT_FILE),
|
"constraints": os.path.join(os.path.dirname(__file__), CONSTRAINT_FILE),
|
||||||
"no_cache_dir": is_docker,
|
|
||||||
"timeout": PIP_TIMEOUT,
|
"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:
|
if not (config_dir is None or pkg_util.is_virtual_env()) and not is_docker:
|
||||||
kwargs["target"] = os.path.join(config_dir, "deps")
|
kwargs["target"] = os.path.join(config_dir, "deps")
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
|
@ -67,9 +67,7 @@ def install_package(
|
||||||
upgrade: bool = True,
|
upgrade: bool = True,
|
||||||
target: str | None = None,
|
target: str | None = None,
|
||||||
constraints: str | None = None,
|
constraints: str | None = None,
|
||||||
find_links: str | None = None,
|
|
||||||
timeout: int | None = None,
|
timeout: int | None = None,
|
||||||
no_cache_dir: bool | None = False,
|
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Install a package on PyPi. Accepts pip compatible package strings.
|
"""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]
|
args = [sys.executable, "-m", "pip", "install", "--quiet", package]
|
||||||
if timeout:
|
if timeout:
|
||||||
args += ["--timeout", str(timeout)]
|
args += ["--timeout", str(timeout)]
|
||||||
if no_cache_dir:
|
|
||||||
args.append("--no-cache-dir")
|
|
||||||
if upgrade:
|
if upgrade:
|
||||||
args.append("--upgrade")
|
args.append("--upgrade")
|
||||||
if constraints is not None:
|
if constraints is not None:
|
||||||
args += ["--constraint", constraints]
|
args += ["--constraint", constraints]
|
||||||
if find_links is not None:
|
|
||||||
args += ["--find-links", find_links, "--prefer-binary"]
|
|
||||||
if target:
|
if target:
|
||||||
assert not is_virtual_env()
|
assert not is_virtual_env()
|
||||||
# This only works if not running in venv
|
# This only works if not running in venv
|
||||||
|
|
|
@ -42,7 +42,6 @@ async def test_requirement_installed_in_venv(hass: HomeAssistant) -> None:
|
||||||
"package==0.0.1",
|
"package==0.0.1",
|
||||||
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
||||||
timeout=60,
|
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"),
|
target=hass.config.path("deps"),
|
||||||
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
||||||
timeout=60,
|
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(
|
assert mock_inst.call_args == call(
|
||||||
"hello==1.0.0",
|
"hello==1.0.0",
|
||||||
find_links="https://wheels.hass.io/test",
|
|
||||||
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
||||||
timeout=60,
|
timeout=60,
|
||||||
no_cache_dir=True,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,7 +402,6 @@ async def test_install_on_docker(hass: HomeAssistant) -> None:
|
||||||
"hello==1.0.0",
|
"hello==1.0.0",
|
||||||
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
|
||||||
timeout=60,
|
timeout=60,
|
||||||
no_cache_dir=True,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
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:
|
async def test_async_get_user_site(mock_env_copy) -> None:
|
||||||
"""Test async get user site directory."""
|
"""Test async get user site directory."""
|
||||||
deps_dir = "/deps_dir"
|
deps_dir = "/deps_dir"
|
||||||
|
|
Loading…
Reference in New Issue