Skip to content

Commit b4708f8

Browse files
get9facebook-github-bot
authored andcommitted
antlir: Go back to omnibus linking for centos10
Summary: Until we can get native python + third-party/python working with centos10 distro platform Test Plan: Antlir distro python toolchain tests pass: https://www.internalfb.com/intern/testinfra/testrun/13510798996319307 Can run orchestrator in a c10 container (as ominbus): ``` $ buck run fbcode//mode/opt -c fbcode.platform010_cuda_version=12.8 --target-platforms fbcode//antlir/distro/platform:centos10-x86_64 fbcode//tee/orchestrator/server:install[container] File changed: fbcode//tee/orchestrator/server/BUCK Buck UI: https://www.internalfb.com/buck2/b1657ff3-d24d-467e-8549-e84b5f03c81e Network: Up: 16MiB Down: 714MiB (reSessionID-4712d9bc-6cdd-421b-b09c-914888f08334) Loading targets. Remaining 0/45869 118084 dirs read, 1539130 targets declared Analyzing targets. Remaining 0/186629 917903 actions, 1003562 artifacts declared Executing actions. Remaining 0/184711 1:58.3s exec time total Command: run. Finished 166 local, 1 cache (1% hit) 2.5s exec time cached (2%) Time elapsed: 1:29.6s BUILD SUCCEEDED - starting your binary bash-5.2# /usr/local/bin/orchestrator --help ERROR 2025-09-25 07:57:14,026 NoPIIStructuredLogger:39 uncategorized: [ORCHESTRATOR_ALLOWED_LOG_START] {"event_type": "tee_tokenizer", "event_message": "Unable to load tokenizer"} [ORCHESTRATOR_ALLOWED_LOG_END] ERROR 2025-09-25 07:57:14,054 NoPIIStructuredLogger:39 uncategorized: [ORCHESTRATOR_ALLOWED_LOG_START] {"event_type": "tokenizer_registry", "event_message": "Failed to load default tokenizer tiktoken_v5"} [ORCHESTRATOR_ALLOWED_LOG_END] Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/local/bin/orchestrator/__main__.py", line 985, in <module> File "/usr/local/bin/orchestrator/__main__.py", line 982, in __invoke_main File "/usr/local/bin/orchestrator/__main__.py", line 597, in main File "/proc/self/fd/3/__par__/meta_only/bootstrap.py", line 111, in run_as_main File "/proc/self/fd/3/__par__/bootstrap.py", line 75, in run_as_main File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 999, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/proc/self/fd/3/tee/orchestrator/server/main.py", line 9, in <module> File "/proc/self/fd/3/tee/orchestrator/orchestration/request_handlers/request_handler_registry.py", line 8, in <module> File "/proc/self/fd/3/tee/orchestrator/orchestration/request_handlers/action_suggestions_request/handler.py", line 14, in <module> File "/proc/self/fd/3/tee/orchestrator/orchestration/llama_stack_impl/agent_runner.py", line 20, in <module> File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/request_utils.py", line 32, in <module> File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/tee_tokenizers/tokenizer_registry.py", line 109, in <module> File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/tee_tokenizers/tokenizer_registry.py", line 41, in __init__ File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/tee_tokenizers/tokenizer_registry.py", line 50, in _load_default_tokenizers File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/tee_tokenizers/tee_tokenizer.py", line 58, in __init__ File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/tee_tokenizers/tee_tokenizer.py", line 48, in __init__ File "/proc/self/fd/3/tee/orchestrator/orchestration/utils/tee_tokenizers/tee_tokenizer.py", line 71, in _get_local_tokenizer_file_path ValueError: Resource path for 'tiktoken_v5' not found or doesn't contain tokenizer.json. ``` Reviewed By: CookieComputing Differential Revision: D83229386 fbshipit-source-id: 665e92d781bd58924f5ff597f2e7134e4c7a4aa3
1 parent 8fdf8f4 commit b4708f8

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

antlir/antlir2/bzl/python_helpers.bzl

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,25 @@ def _extract_python_library_info(target) -> PythonLibraryInfo | None:
3131
return library_info.get(PythonLibraryInfo)
3232
return None
3333

34-
def _extract_par_executable_info(target) -> DefaultInfo | None:
34+
def _extract_native_python_executable(target) -> DefaultInfo | None:
3535
"""
3636
Extracts the par executable from a target. For native python this is the actual
3737
native executable that doubles as the interpreter.
3838
"""
39-
return target[DefaultInfo].sub_targets.get("native-executable", {}).get(DefaultInfo)
39+
native_executable = target[DefaultInfo].sub_targets.get("native-executable")
40+
if native_executable:
41+
return native_executable[DefaultInfo]
42+
return None
43+
44+
def _extract_omnibus(target) -> DefaultInfo | None:
45+
"""
46+
Extracts libomnibus output (if present) from a target. Only relevant if the python
47+
binary was linked with omnibus linking.
48+
"""
49+
omnibus = target[DefaultInfo].sub_targets.get("omnibus")
50+
if omnibus:
51+
return omnibus[DefaultInfo]
52+
return None
4053

4154
def extract_par_elfs(target) -> list[Artifact]:
4255
"""
@@ -62,10 +75,8 @@ def extract_par_elfs(target) -> list[Artifact]:
6275
if isinstance(shlib.lib.output, Artifact)
6376
])
6477

65-
par_executable_info = _extract_par_executable_info(target)
66-
if par_executable_info:
67-
exe = par_executable_info.default_outputs
68-
if exe:
69-
elfs.append(exe[0])
78+
for info in (_extract_native_python_executable(target), _extract_omnibus(target)):
79+
if info and info.default_outputs:
80+
elfs.append(info.default_outputs[0])
7081

7182
return elfs

antlir/antlir2/os/oses.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ OSES = [
101101
"antlir//antlir/antlir2/facebook/flavor/centos10:corp": "antlir//antlir/antlir2/facebook/images/build_appliance/centos10_corp:build-appliance",
102102
}),
103103
# TODO(T238134086): This should point to the third-party/python interpreter when we've verified this correctness.
104-
python = new_python_t(interpreter = "/usr/bin/python3.12")
104+
python = new_python_t(interpreter = "/usr/bin/python3")
105105
),
106106
]
107107

0 commit comments

Comments
 (0)