Skip to content

Commit 5d57637

Browse files
Merge pull request #11 from saichandrapandraju/update-garak-provider
Update TrustyAI distro with latest garak
2 parents 00f5856 + b784c5c commit 5d57637

File tree

5 files changed

+35
-17
lines changed

5 files changed

+35
-17
lines changed

trustyai-distribution/Containerfile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@
44
FROM registry.access.redhat.com/ubi9/python-312:latest
55
WORKDIR /opt/app-root
66

7+
# Switch to root for package installation
8+
USER root
9+
710
RUN pip install uv
811
RUN pip install sqlalchemy # somehow sqlalchemy[asyncio] is not sufficient
912
RUN uv pip install --upgrade \
10-
'langchain>=0.3.25,<1.0.0'
13+
'langchain>=0.3.25,<1.0.0' \
14+
'kfp-kubernetes==2.14.6' \
15+
'pyarrow>=21.0.0' \
16+
'botocore==1.35.88' \
17+
'boto3==1.35.88' \
18+
'aiobotocore==2.16.1' \
19+
'ibm-cos-sdk-core==2.14.2' \
20+
'ibm-cos-sdk==2.14.2'
1121
RUN uv pip install --extra-index-url https://download.pytorch.org/whl/cpu 'torchao>=0.12.0' torch torchvision
1222
RUN uv pip install \
1323
'datasets>=4.0.0' \
@@ -51,17 +61,17 @@ RUN uv pip install \
5161
RUN uv pip install \
5262
llama_stack_provider_trustyai_fms==0.3.1
5363
RUN uv pip install \
54-
llama_stack_provider_trustyai_garak==0.1.6
64+
llama_stack_provider_trustyai_garak==0.1.7
5565
RUN uv pip install \
56-
llama_stack_provider_trustyai_garak[remote]==0.1.6
66+
llama_stack_provider_trustyai_garak[inline]==0.1.7
5767
RUN uv pip install --no-deps sentence-transformers
5868
RUN pip install --no-cache llama-stack==0.3.4
5969

60-
# # commenting to reduce image size
61-
# # chown the work directories to the non-root user to create garak scan log files
62-
# RUN chown -R 1001:1001 ${APP_ROOT}
70+
RUN mkdir -p ${APP_ROOT}/src/.llama/distributions/trustyai
71+
RUN chown -R 1001:1001 ${APP_ROOT}/src/.llama/distributions/trustyai
72+
6373
# # Switch back to non-root user
64-
# USER 1001
74+
USER 1001
6575
RUN mkdir -p ${HOME}/.llama ${HOME}/.cache
6676
COPY trustyai-distribution/run.yaml ${APP_ROOT}/run.yaml
6777
COPY --chmod=755 trustyai-distribution/entrypoint.sh ${APP_ROOT}/entrypoint.sh

trustyai-distribution/Containerfile.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
FROM registry.access.redhat.com/ubi9/python-312:latest
22
WORKDIR /opt/app-root
33

4+
# Switch to root for package installation
5+
USER root
6+
47
RUN pip install uv
58
RUN pip install sqlalchemy # somehow sqlalchemy[asyncio] is not sufficient
69
{dependencies}
710
RUN pip install --no-cache llama-stack==0.3.4
811

9-
# # commenting to reduce image size
10-
# # chown the work directories to the non-root user to create garak scan log files
11-
# RUN chown -R 1001:1001 ${{APP_ROOT}}
12+
RUN mkdir -p ${{APP_ROOT}}/src/.llama/distributions/trustyai
13+
RUN chown -R 1001:1001 ${{APP_ROOT}}/src/.llama/distributions/trustyai
14+
1215
# # Switch back to non-root user
13-
# USER 1001
16+
USER 1001
1417
RUN mkdir -p ${{HOME}}/.llama ${{HOME}}/.cache
1518
COPY trustyai-distribution/run.yaml ${{APP_ROOT}}/run.yaml
1619
COPY --chmod=755 trustyai-distribution/entrypoint.sh ${{APP_ROOT}}/entrypoint.sh

trustyai-distribution/build.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@
1717
"llama-stack==0.3.4",
1818
]
1919

20-
# TODO: Add other pinned dependencies from odh lls-distro
20+
# pinned dependencies from odh lls-distro
2121
PINNED_DEPENDENCIES = [
2222
"'langchain>=0.3.25,<1.0.0'",
23+
"'kfp-kubernetes==2.14.6'",
24+
"'pyarrow>=21.0.0'",
25+
"'botocore==1.35.88'",
26+
"'boto3==1.35.88'",
27+
"'aiobotocore==2.16.1'",
28+
"'ibm-cos-sdk-core==2.14.2'",
29+
"'ibm-cos-sdk==2.14.2'",
2330
]
2431

2532
def check_llama_installed():

trustyai-distribution/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ distribution_spec:
1616
- provider_type: remote::trustyai_lmeval
1717
module: llama_stack_provider_lmeval==0.4.1
1818
- provider_type: inline::trustyai_garak
19-
module: llama_stack_provider_trustyai_garak==0.1.6
19+
module: llama_stack_provider_trustyai_garak[inline]==0.1.7
2020
- provider_type: remote::trustyai_garak
21-
module: llama_stack_provider_trustyai_garak[remote]==0.1.6
21+
module: llama_stack_provider_trustyai_garak==0.1.7
2222
- provider_type: inline::trustyai_ragas
2323
module: llama_stack_provider_ragas==0.5.1
2424
- provider_type: remote::trustyai_ragas

trustyai-distribution/run.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ providers:
7474
llama_stack_url: ${env.KUBEFLOW_LLAMA_STACK_URL:=""}
7575
tls_verify: ${env.GARAK_TLS_VERIFY:=true}
7676
kubeflow_config:
77-
results_s3_prefix: ${env.KUBEFLOW_RESULTS_S3_PREFIX:=""}
78-
s3_credentials_secret_name: ${env.KUBEFLOW_S3_CREDENTIALS_SECRET_NAME:=""}
7977
pipelines_endpoint: ${env.KUBEFLOW_PIPELINES_ENDPOINT:=""}
8078
namespace: ${env.KUBEFLOW_NAMESPACE:=""}
8179
base_image: ${env.KUBEFLOW_BASE_IMAGE:=""}
@@ -85,7 +83,7 @@ providers:
8583
module: llama_stack_provider_ragas.inline
8684
config:
8785
embedding_model: ${env.EMBEDDING_MODEL:=}
88-
- provider_id: trustyai_ragas
86+
- provider_id: ${env.ENABLE_RAGAS:+trustyai_ragas}
8987
provider_type: remote::trustyai_ragas
9088
module: llama_stack_provider_ragas.remote
9189
config:

0 commit comments

Comments
 (0)