uber-archive / makisu

Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Apache License 2.0
2.41k stars 156 forks source link

Model stages as topological sorted tree instead of list #280

Open yiranwang52 opened 4 years ago

yiranwang52 commented 4 years ago

Is your feature request related to a problem? Please describe. Currently stages are treated as a list. They should be modeled as a tree to handle cache ID and --target (#262) correctly.

Describe the solution you'd like Model stages as a tree. Most changes should be in builder/build_plan.go

Tree is better for calculating cache IDs. Currently stages inherit cache ID from last step of previous stage - which is not necessary if no files are copied between them.

Also in theory it's possible to execute some stages without "RUN" in parallel, and ignore those that not parent of "target" stage