Build workspace Dockerfiles below the client layer so client refreshes keep them cached #74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A workspace
Dockerfile.azkaban(orDockerfile.<client>) is built onthe client image, whose first
FROMthe launcher overrides. Everyrefresh of the client image, such as a nightly one that busts the client
install layer with
CACHEBUST, therefore invalidates every layer of theworkspace file, and the next launch rebuilds all of them: apt installs,
language runtimes, compiled dependencies.
Most of what a workspace file adds does not depend on the client: the
client lands in the user's
~/.localas the last step of its stage. Theclient stage in
containers/Dockerfilealready buildsFROM ${BASE_IMAGE}, so the order could be inverted:FROMoverridden bylocalhost/azkaban-base:latestinstead of the client image.--build-arg BASE_IMAGE=<that image>and
--target <client>, as_azk_update_default_imagedoes today.A client refresh would then rebuild only the client's own layers on top
of the cached workspace layers; the workspace layers would rebuild only
when the base image or the workspace file changes.
Points to settle:
contract would end with
USER root(or leaveUSERalone) instead ofUSER 1000, and files it gives to the user need numeric IDs.azkaban-baseitself changes on the forge decides how muchthis saves; if it is rebuilt nightly as well, the gain is limited to
launches between base refreshes.
USER 1000or rely on theclient being present during their build would need a migration note.
Workaround in use today: declare the client as
FROM <client> AS client,do the heavy work in stages independent of it, and finish with
FROM clientplusCOPY --from=those stages, so a client refreshrebuilds only the copies.