-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_worker_templates.py
More file actions
39 lines (32 loc) · 1.17 KB
/
Copy pathsync_worker_templates.py
File metadata and controls
39 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from __future__ import annotations
import argparse
import logging
import os
from pathlib import Path
from octopal.runtime.workers.templates import sync_default_templates
def main() -> None:
logging.basicConfig(level=logging.INFO, format="%(message)s")
logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser(
description="Sync worker templates from workspace_templates/workers into workspace/workers."
)
parser.add_argument(
"--workspace",
default=os.getenv("OCTOPAL_WORKSPACE_DIR", "workspace"),
help="Workspace directory (default: OCTOPAL_WORKSPACE_DIR or ./workspace)",
)
parser.add_argument(
"--overwrite",
action="store_true",
help="Overwrite existing workspace worker templates.",
)
args = parser.parse_args()
workspace_dir = Path(args.workspace).resolve()
result = sync_default_templates(workspace_dir, overwrite=args.overwrite)
logger.info(
"Worker template sync complete: "
f"copied={result['copied']} updated={result['updated']} skipped={result['skipped']} "
f"target={workspace_dir / 'workers'}"
)
if __name__ == "__main__":
main()