From ee471af10904d7129ce005abfe23ecb2aed81e64 Mon Sep 17 00:00:00 2001 From: AndrewQuijano Date: Tue, 19 Nov 2024 17:15:26 -0500 Subject: [PATCH] Use the cache-from to correctly leverage staged docker container builder to save time on creating panda packages --- panda/debian/.gitignore | 3 ++- panda/debian/setup.sh | 8 ++++---- panda/python/core/.gitignore | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/panda/debian/.gitignore b/panda/debian/.gitignore index 7bbf39a4c32..3277dbe3185 100644 --- a/panda/debian/.gitignore +++ b/panda/debian/.gitignore @@ -1 +1,2 @@ -panda.deb +*.deb +*.whl \ No newline at end of file diff --git a/panda/debian/setup.sh b/panda/debian/setup.sh index b28dc85c7e2..f3835516f85 100755 --- a/panda/debian/setup.sh +++ b/panda/debian/setup.sh @@ -43,17 +43,17 @@ if [[ ! -f "../dependencies/ubuntu_${version}_base.txt" ]]; then fi # Build the installer to generate the wheel file -DOCKER_BUILDKIT=1 docker build --target installer -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../.. +DOCKER_BUILDKIT=1 docker build --target installer -t panda_installer --build-arg BASE_IMAGE="ubuntu:${version}" ../.. # Copy wheel file out of container to host # this also preserves wheel name, which is important as pip install WILL fail if you arbitarily change the generated wheel file name -docker run --rm -v $(pwd):/out panda bash -c "cp /panda/panda/python/core/dist/*.whl /out" +docker run --rm -v $(pwd):/out panda_installer bash -c "cp /panda/panda/python/core/dist/*.whl /out" # Finish building main panda container for the target ubuntu version -DOCKER_BUILDKIT=1 docker build --target panda -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../.. +DOCKER_BUILDKIT=1 docker build --target panda --cache-from=panda_installer -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../.. # Now build the packager container from that -docker build -t packager . +DOCKER_BUILDKIT=1 docker build --cache-from=panda -t packager . # Copy deb file out of container to host docker run --rm -v $(pwd):/out packager bash -c "cp /pandare.deb /out" diff --git a/panda/python/core/.gitignore b/panda/python/core/.gitignore index 4eebd474f78..fa0ca2b31c2 100644 --- a/panda/python/core/.gitignore +++ b/panda/python/core/.gitignore @@ -8,3 +8,4 @@ data a __pycache__ *.egg-info +.eggs/ \ No newline at end of file