Skip to content

Commit b72973c

Browse files
authored
Cleanup: creates a controller-only flag to speed up dev builds (#269)
* creates dockerignore file to speed up dev builds * Create a flag to ignore the client and examples directories to speed up controller only builds for development * Alphabetically orders the directories and adds a TODO
1 parent 99d8126 commit b72973c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

dev/tools/push-images

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@ def build_and_push_image(args, service_name, srcdir, dockerfile_path):
8585

8686
def main(args):
8787
"""Builds and pushes all discovered Docker images."""
88-
excluded_dirs = {"dev", "docs", "k8s", "site", "tests"}
88+
excluded_dirs = {"bin", "dev", "docs", "k8s", "site",
89+
"temp", "tests", "tmp", ".venv"}
90+
91+
if args.controller_only:
92+
# TODO: Implement an explicit inclusion strategy for controller only Dockerfile.
93+
excluded_dirs.update({"examples", "clients"})
8994

9095
for root, dirs, files in os.walk(".", topdown=True):
91-
# Exclude directories
9296
dirs[:] = [d for d in dirs if d not in excluded_dirs]
9397

9498
if "Dockerfile" in files:
@@ -132,6 +136,10 @@ if __name__ == "__main__":
132136
help="Name of the kind cluster. If set, images will be loaded into the cluster",
133137
type=str,
134138
default=os.getenv("KIND_CLUSTER_NAME"))
139+
parser.add_argument("--controller-only",
140+
dest="controller_only",
141+
action="store_true",
142+
help="Only build and push the agent-sandbox-controller image.")
135143
args = parser.parse_args()
136144

137145
if args.kind_cluster_name:

0 commit comments

Comments
 (0)