mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix: copy microagents file into runtime image (#10245)
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: mamoodi <mamoodiha@gmail.com>
This commit is contained in:
parent
1d0d88d491
commit
0699a0ce7c
@ -280,6 +280,11 @@ def prep_build_folder(
|
||||
),
|
||||
)
|
||||
|
||||
# Copy the 'microagents' directory (Microagents)
|
||||
shutil.copytree(
|
||||
Path(project_root, 'microagents'), Path(build_folder, 'code', 'microagents')
|
||||
)
|
||||
|
||||
# Copy pyproject.toml and poetry.lock files
|
||||
for file in ['pyproject.toml', 'poetry.lock']:
|
||||
src = Path(openhands_source_dir, file)
|
||||
|
||||
@ -239,7 +239,8 @@ COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
|
||||
# ================================================================
|
||||
RUN if [ -d /openhands/code/openhands ]; then rm -rf /openhands/code/openhands; fi
|
||||
COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
|
||||
|
||||
RUN if [ -d /openhands/code/microagents ]; then rm -rf /openhands/code/microagents; fi
|
||||
COPY ./code/microagents /openhands/code/microagents
|
||||
COPY ./code/openhands /openhands/code/openhands
|
||||
RUN chmod a+rwx /openhands/code/openhands/__init__.py
|
||||
|
||||
|
||||
@ -89,8 +89,8 @@ def test_prep_build_folder(temp_dir):
|
||||
extra_deps=None,
|
||||
)
|
||||
|
||||
# make sure that the code was copied
|
||||
shutil_mock.copytree.assert_called_once()
|
||||
# make sure that the code (openhands/) and microagents folder were copied
|
||||
assert shutil_mock.copytree.call_count == 2
|
||||
assert shutil_mock.copy2.call_count == 2
|
||||
|
||||
# Now check dockerfile is in the folder
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user