Skip to content

Commit 189f3e4

Browse files
[BUZZOK-257330] Update GenAI Agents environment to latest (#1434)
* Update GenAI Agents environment to latest * Bump version * Reconcile dependencies, updated IDs, tags, values.yaml for public_dropin_environments/python311_genai_agents * Update env * Lint --------- Co-authored-by: svc-harness-git2 <svc-harness-git2@datarobot.com>
1 parent d69a191 commit 189f3e4

File tree

13 files changed

+629
-207
lines changed

13 files changed

+629
-207
lines changed

public_dropin_environments/python311_genai_agents/Dockerfile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ ARG VENV_PATH
2626
USER root
2727

2828
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
29+
# hadolint ignore=DL3018,DL3059
2930
RUN apk add --no-cache graphviz openblas openssh-server gzip zip unzip curl \
3031
openjdk-11 vim nano procps tzdata poppler-utils
31-
RUN apk add rust sqlite
32+
# hadolint ignore=DL3018,DL3059
33+
RUN apk add --no-cache rust sqlite
3234

3335
ENV PYTHONUNBUFFERED=1 \
3436
PYTHONDONTWRITEBYTECODE=1 \
@@ -39,6 +41,7 @@ ENV PYTHONUNBUFFERED=1 \
3941
ENV PATH="$VENV_PATH/bin:$PATH" \
4042
PYTHONPATH="/home/notebooks/.ipython/extensions:/home/notebooks/storage"
4143

44+
# hadolint ignore=DL3013
4245
RUN python3 -m venv ${VENV_PATH} && pip3 install -U pip setuptools
4346
WORKDIR ${WORKDIR}
4447

@@ -84,20 +87,20 @@ FROM base AS builder
8487
ARG WORKDIR
8588
ARG VENV_PATH
8689

87-
COPY ./run_agent.py ${WORKDIR}/
8890
COPY ./requirements.txt ${WORKDIR}/
89-
COPY ./requirements-genai.txt ${WORKDIR}/
9091
COPY ./agent/requirements-agent.txt ${WORKDIR}/
91-
RUN python3 -m ensurepip --upgrade
92-
RUN python3 -m pip install --upgrade pip setuptools
93-
RUN python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements.txt && rm ${WORKDIR}/requirements.txt
94-
RUN python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements-agent.txt && rm ${WORKDIR}/requirements-agent.txt
92+
93+
# hadolint ignore=DL3013
94+
RUN python3 -m pip install --upgrade pip setuptools && \
95+
python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements.txt && rm ${WORKDIR}/requirements.txt && \
96+
python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements-agent.txt && rm ${WORKDIR}/requirements-agent.txt
9597

9698
# Generative AI Agents
97-
RUN python3 -m pip uninstall -y urllib3
98-
RUN python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements-genai.txt && rm ${WORKDIR}/requirements-genai.txt
99-
RUN python3 -m pip uninstall -y litellm
100-
RUN python3 -m pip install --no-cache-dir --no-warn-conflicts git+https://github.com/datarobot-forks/litellm@mattn/add-datarobot-support-to-litellm
99+
RUN python3 -m pip uninstall -y litellm && \
100+
python3 -m pip install --no-cache-dir --no-warn-conflicts git+https://github.com/datarobot-forks/litellm@mattn/add-datarobot-support-to-litellm
101+
102+
# Copy agent runtime into work directory
103+
COPY ./run_agent.py ${WORKDIR}/
101104

102105
RUN rm ${VENV_PATH}/share/jupyter/kernels/python3/kernel.json && chmod a+x ${WORKDIR}/start_server.sh
103106
COPY ./kernel.json ${VENV_PATH}/share/jupyter/kernels/python3/

public_dropin_environments/python311_genai_agents/Dockerfile.local

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ARG UID=10101
1515
ARG GID=10101
1616

1717
# This reproduces a open source variant of https://images.chainguard.dev/directory/image/python
18-
FROM cgr.dev/chainguard/wolfi-base AS chainguard_python_dev
18+
# hadolint ignore=DL3007
19+
FROM cgr.dev/chainguard/wolfi-base:latest AS chainguard_python_dev
1920

2021
ARG PYTHON_VERSION=3.11
2122
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
@@ -24,11 +25,13 @@ RUN echo "[Python $PYTHON_VERSION]"
2425
ENV PATH="${PATH}:/sbin"
2526
RUN apk update && apk upgrade
2627
# Wolfi python image
28+
# hadolint ignore=DL3018,DL3059
2729
RUN apk add --no-cache ca-certificates-bundle gdbm glibc glibc-locale-posix \
2830
ld-linux libbz2-1 libcrypto3 libexpat1 libffi libgcc libssl3 libstdc++ \
2931
mpdecimal ncurses ncurses-terminfo readline sqlite-libs \
3032
wolfi-baselayout xz zlib
3133
# Wolfi python dev image
34+
# hadolint ignore=DL3018,DL3059
3235
RUN apk add --no-cache apk-tools bash binutils build-base busybox cyrus-sasl \
3336
gcc git glibc-dev gmp heimdal-libs isl keyutils-libs \
3437
krb5-conf krb5-libs libatomic libbrotlicommon1 libbrotlidec1 \
@@ -38,13 +41,15 @@ libunistring libverto libxcrypt libxcrypt-dev libzstd1 \
3841
linux-headers make mpc mpfr nss-db nss-hesiod \
3942
openssf-compiler-options pkgconf posix-cc-wrappers wget
4043
# Python
44+
# hadolint ignore=DL3018,DL3059
4145
RUN apk add --no-cache \
4246
python-$PYTHON_VERSION \
4347
python-$PYTHON_VERSION-base \
4448
py$PYTHON_VERSION-pip \
4549
py3-pip-wheel
4650
# Python dev
47-
RUN apk add python-$PYTHON_VERSION-dev \
51+
# hadolint ignore=DL3018,DL3059
52+
RUN apk add --no-cache python-$PYTHON_VERSION-dev \
4853
python-$PYTHON_VERSION-base-dev \
4954
py$PYTHON_VERSION-pip-base \
5055
py$PYTHON_VERSION-setuptools
@@ -61,9 +66,11 @@ ARG VENV_PATH
6166
USER root
6267

6368
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
69+
# hadolint ignore=DL3018,DL3059
6470
RUN apk add --no-cache graphviz openblas openssh-server gzip zip unzip curl \
6571
openjdk-11 vim nano procps tzdata poppler-utils
66-
RUN apk add rust sqlite
72+
# hadolint ignore=DL3018,DL3059
73+
RUN apk add --no-cache rust sqlite
6774

6875
ENV PYTHONUNBUFFERED=1 \
6976
PYTHONDONTWRITEBYTECODE=1 \
@@ -74,6 +81,7 @@ ENV PYTHONUNBUFFERED=1 \
7481
ENV PATH="$VENV_PATH/bin:$PATH" \
7582
PYTHONPATH="/home/notebooks/.ipython/extensions:/home/notebooks/storage"
7683

84+
# hadolint ignore=DL3013
7785
RUN python3 -m venv ${VENV_PATH} && pip3 install -U pip setuptools
7886
WORKDIR ${WORKDIR}
7987

@@ -119,20 +127,20 @@ FROM base AS builder
119127
ARG WORKDIR
120128
ARG VENV_PATH
121129

122-
COPY ./run_agent.py ${WORKDIR}/
123130
COPY ./requirements.txt ${WORKDIR}/
124-
COPY ./requirements-genai.txt ${WORKDIR}/
125131
COPY ./agent/requirements-agent.txt ${WORKDIR}/
126-
RUN python3 -m ensurepip --upgrade
127-
RUN python3 -m pip install --upgrade pip setuptools
128-
RUN python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements.txt && rm ${WORKDIR}/requirements.txt
129-
RUN python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements-agent.txt && rm ${WORKDIR}/requirements-agent.txt
132+
133+
# hadolint ignore=DL3013
134+
RUN python3 -m pip install --upgrade pip setuptools && \
135+
python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements.txt && rm ${WORKDIR}/requirements.txt && \
136+
python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements-agent.txt && rm ${WORKDIR}/requirements-agent.txt
130137

131138
# Generative AI Agents
132-
RUN python3 -m pip uninstall -y urllib3
133-
RUN python3 -m pip install --no-cache-dir -r ${WORKDIR}/requirements-genai.txt && rm ${WORKDIR}/requirements-genai.txt
134-
RUN python3 -m pip uninstall -y litellm
135-
RUN python3 -m pip install --no-cache-dir --no-warn-conflicts git+https://github.com/datarobot-forks/litellm@mattn/add-datarobot-support-to-litellm
139+
RUN python3 -m pip uninstall -y litellm && \
140+
python3 -m pip install --no-cache-dir --no-warn-conflicts git+https://github.com/datarobot-forks/litellm@mattn/add-datarobot-support-to-litellm
141+
142+
# Copy agent runtime into work directory
143+
COPY ./run_agent.py ${WORKDIR}/
136144

137145
RUN rm ${VENV_PATH}/share/jupyter/kernels/python3/kernel.json && chmod a+x ${WORKDIR}/start_server.sh
138146
COPY ./kernel.json ${VENV_PATH}/share/jupyter/kernels/python3/

public_dropin_environments/python311_genai_agents/agent/agent.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# Copyright 2025 DataRobot, Inc. and its affiliates.
2-
# All rights reserved.
3-
# DataRobot, Inc. Confidential.
4-
# This is unpublished proprietary source code of DataRobot, Inc.
5-
# and its affiliates.
6-
# The copyright notice above does not evidence any actual or intended
7-
# publication of such source code.
1+
# Copyright 2025 DataRobot, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
814

915
import asyncio
1016
import logging

public_dropin_environments/python311_genai_agents/agent/cgroup_watchers.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright 2025 DataRobot, Inc. and its affiliates.
2-
# All rights reserved.
3-
# DataRobot, Inc. Confidential.
4-
# This is unpublished proprietary source code of DataRobot, Inc.
5-
# and its affiliates.
6-
# The copyright notice above does not evidence any actual or intended
7-
# publication of such source code.
1+
# Copyright 2025 DataRobot, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815
import re
916
import time
1017
from pathlib import Path

public_dropin_environments/python311_genai_agents/env_info.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"name": "[DataRobot] Python 3.11 GenAI Agents",
44
"description": "This template environment can be used to create GenAI-powered agents using CrewAI, LangGraph, or Llama-Index. Similar to other drop-in environments, you can either include a .pth artifact or any other code needed to deserialize your model, and optionally a custom.py file. You can also use this environment in codespaces.",
55
"programmingLanguage": "python",
6-
"environmentVersionId": "68220405046afc414c6a9ff4",
6+
"environmentVersionId": "68238acf9604e975d4139288",
77
"isPublic": true,
88
"useCases": [
99
"notebook",
1010
"customModel"
11-
]
11+
],
12+
"imageRepository": "env-python-genai-agents"
1213
}

public_dropin_environments/python311_genai_agents/extensions/dataframe_formatter.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright 2025 DataRobot, Inc. and its affiliates.
2-
# All rights reserved.
3-
# DataRobot, Inc. Confidential.
4-
# This is unpublished proprietary source code of DataRobot, Inc.
5-
# and its affiliates.
6-
# The copyright notice above does not evidence any actual or intended
7-
# publication of such source code.
1+
# Copyright 2025 DataRobot, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
815

916
# -*- coding: utf-8 -*-
1017
import json
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Copyright 2024 DataRobot, Inc. and its affiliates.
2-
# All rights reserved.
3-
# DataRobot, Inc. Confidential.
4-
# This is unpublished proprietary source code of DataRobot, Inc.
5-
# and its affiliates.
6-
# The copyright notice above does not evidence any actual or intended
7-
# publication of such source code.
1+
# Copyright 2025 DataRobot, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
814

915
# This need to load extensions automaticaly when kernel starting
10-
c.InteractiveShellApp.extensions = ["dataframe_formatter"] # ruff: noqa: F821
16+
17+
c.InteractiveShellApp.extensions = ["dataframe_formatter"]

public_dropin_environments/python311_genai_agents/jupyter_kernel_gateway_config.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# Copyright 2022 DataRobot, Inc. and its affiliates.
2-
# All rights reserved.
3-
# DataRobot, Inc. Confidential.
4-
# This is unpublished proprietary source code of DataRobot, Inc.
5-
# and its affiliates.
6-
# The copyright notice above does not evidence any actual or intended
7-
# publication of such source code.
1+
# Copyright 2025 DataRobot, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
814

915
c.KernelGatewayApp.ip = "0.0.0.0" # nosec
1016
c.KernelGatewayApp.prespawn_count = 1

public_dropin_environments/python311_genai_agents/requirements-genai.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file is used to generate the requirements.txt file for the Docker image.
2+
setuptools
3+
ecs-logging
4+
jupyter-client
5+
jupyter_kernel_gateway
6+
jupyter_core
7+
ipykernel
8+
pandas
9+
numpy
10+
mistune
11+
datarobot-drum @ git+https://github.com/datarobot/datarobot-user-models#egg=datarobot-drum&subdirectory=custom_model_runner
12+
datarobot
13+
numpy
14+
uwsgi
15+
16+
# Generative AI Frameworks
17+
crewai
18+
crewai-tools
19+
langgraph
20+
langchain
21+
langchain-community
22+
llama-index
23+
llama-index-llms-openai
24+
llama-index-llms-langchain
25+
llama-index-llms-litellm
26+
openai
27+
ragas
28+
traceloop-sdk

0 commit comments

Comments
 (0)