-
Notifications
You must be signed in to change notification settings - Fork 88
[BUZZOK-27814] Install extra agent dependecies in runtime. #1716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
RUN . ${VENV_PATH}/bin/activate && \ | ||
uv sync | ||
uv sync && \ | ||
chmod -R 777 ${VENV_PATH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Venv should be writable both for notebook user (10101) and custom model user (1000).
ARG VENV_PATH | ||
|
||
COPY ./pyproject.toml ${WORKDIR}/pyproject.toml | ||
COPY ./uv.lock ${WORKDIR}/uv.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't use lock file, but it's better to have it for consistency of env.
# this stage has only bare minimal of dependencies installed to optimize build time for the local development | ||
|
||
ENV ANNOY_COMPILER_ARGS="-D_CRT_SECURE_NO_WARNINGS,-DANNOYLIB_MULTITHREADED_BUILD,-march=x86-64" | ||
ENV UV_COMPILE_BYTECODE=1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Env variables are not passed between docker stages, so need to explicitly enable bytecode compilation again for uv sync
.
[dependency-groups] | ||
extras = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra user dependencies will go here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this work well to put it here. We should update the templates pyproject.toml
everywhere to have this addition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, working on another PR do do the same changes in af-component-agent
.
# This file was autogenerated by uv via the following command: | ||
# uv pip compile --no-annotate --no-emit-index-url --no-emit-trusted-host --output-file=requirements.txt pyproject.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv lock
uv sync
uv pip freeze > requirements.txt
The Needs Review labels were added based on the following file changes. Team @datarobot/buzok (#genai) was assigned because of changes in files:public_dropin_environments/python311_genai_agents/Dockerfile public_dropin_environments/python311_genai_agents/Dockerfile.local public_dropin_environments/python311_genai_agents/env_info.json public_dropin_environments/python311_genai_agents/pyproject.toml public_dropin_environments/python311_genai_agents/requirements.txt public_dropin_environments/python311_genai_agents/run_agent.py public_dropin_environments/python311_genai_agents/start_server_drum.sh public_dropin_environments/python311_genai_agents/uv.lock If you think that there are some issues with ownership, please discuss with C&A domain at #sdtk slack channel and create PR to update DRCODEOWNERS\CODEOWNERS file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
Label Needs Review: GenAI Tooling (Buzok) was removed because @tsdaemon is part of Generative AI Tooling domain. |
ARG VENV_PATH | ||
|
||
COPY ./pyproject.toml ${WORKDIR}/pyproject.toml | ||
COPY ./uv.lock ${WORKDIR}/uv.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user doesn't have a uv.lock
file would this be a problem? Say they just to a task start
+ task deploy
, they might not have built a local environment. They "must" have a pyproject.toml
, but the uv.lock
could be missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular uv.lock
is part of execution env (I've added it).
If we are talking about agent itself:
uv sync
is non-critical - we would still attempt to run the agent.uv.lock
is generally supposed to be always present because recommended way to add dependency would be viauv add --no-upgrade --group extras <dependency>
or via some Task shortcut. Manual editing ofpyproject.toml
is not recommended (unless you know what you are doing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you mean that uv.lock
may be missing when building docker image locally using Dockerfile.local - I guess it's okay to require user to freeze env by generating lock file in this case. Lock file is generally a must in image if we're talking about consistency of dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, thats fair. If you make a ticket or two for updating docks related to this I can help pickup recipe and agent updates next week. I know you'll be out soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To your second comment I think that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this overall. The only question for this as a docker_context
would be the possibility of uv.lock
not existing, but maybe thats not really a thing to worry about
This repository is public. Do not put here any private DataRobot or customer's data: code, datasets, model artifacts, .etc.
Summary
Adds support for installing extra dependencies for an agent in runtime to improve iteration speed during agent development (image rebuild is no required now):
extras
group in agent'spyproject.toml
.run_agent.py
) or when LRS is started during deployment (start_server_drum.sh
).Caveats
Codespace:

Custom Model:
