Skip to content

Commit

Permalink
chore: use 0.2 eval image in RAG jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanture1064 committed Mar 20, 2024
1 parent 6e64f1d commit 1dfc75b
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 630 deletions.
1 change: 0 additions & 1 deletion .github/workflows/eval_image_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
paths:
- 'deploy/evaluation/Dockerfile'
- 'pkg/**'
- 'pypi/ragas_once/**'
workflow_dispatch:
env:
PYTHON_INDEX_URL: https://pypi.org/simple
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/eval_image_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
paths:
- 'deploy/evaluation/Dockerfile'
- 'pkg/**'
- 'pypi/ragas_once/**'
workflow_dispatch:
env:
PYTHON_INDEX_URL: https://pypi.org/simple
Expand Down
19 changes: 13 additions & 6 deletions deploy/evaluation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ ARG PYTHON_INDEX_URL=https://pypi.mirrors.ustc.edu.cn/simple/

WORKDIR /usr/local/bin
COPY --from=builder /go/src/arctl ./arctl
RUN python -m pip install ragas langchain==0.0.354 -i ${PYTHON_INDEX_URL}
RUN python -m pip install ragas langchain -i ${PYTHON_INDEX_URL}

# build ragas-once by source code
COPY ./pypi/ragas_once ./ragas_once
WORKDIR /usr/local/bin/ragas_once
RUN python setup.py bdist_wheel -d /usr/local/bin/ragas_once/dist
RUN pip install dist/ragas_once-0.0.1-py3-none-any.whl
# Install core-library
RUN apt-get install -y git make gcc
RUN git clone https://github.com/kubeagi/core-library.git
WORKDIR /usr/local/bin/core-library
RUN make install-eval

# DEPRECATED: moved to core library
# # build ragas-once by source code
# COPY ./pypi/ragas_once ./ragas_once
# WORKDIR /usr/local/bin/ragas_once
# RUN python setup.py bdist_wheel -d /usr/local/bin/ragas_once/dist
# RUN pip install dist/ragas_once-0.0.1-py3-none-any.whl
18 changes: 10 additions & 8 deletions pkg/evaluation/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
defaultPVCMountPath = "/data/evaluations"
defaultTestRagFile = "ragas.csv"
defaultMCImage = "kubeagi/minio-mc:RELEASE.2023-01-28T20-29-38Z"
defaultEvalImage = "kubeagi/arcadia-eval:v0.2.0"

// The clusterrolebinding required for the rag evaluation process is ragas-eval-clusterrolebinding by default,
// and can be changed via environment variable RAG_EVAL_CLUSTERROLEBINDING.
Expand Down Expand Up @@ -86,7 +87,7 @@ func DownloadJob(instance *evav1alpha1.RAG) (*batchv1.Job, error) {
Containers: []v1.Container{
{
Name: "download-dataset-files",
Image: "kubeagi/arcadia-eval:v0.1.0",
Image: defaultEvalImage,
Command: []string{
"arctl",
},
Expand Down Expand Up @@ -146,7 +147,7 @@ func GenTestDataJob(instance *evav1alpha1.RAG) (*batchv1.Job, error) {
Containers: []v1.Container{
{
Name: "gen-test-files",
Image: "kubeagi/arcadia-eval:v0.1.0",
Image: defaultEvalImage,
Command: []string{
"arctl",
},
Expand Down Expand Up @@ -253,20 +254,21 @@ func JudgeJobGenerator(ctx context.Context, c client.Client) func(*evav1alpha1.R
Containers: []v1.Container{
{
Name: "judge-llm",
Image: "kubeagi/arcadia-eval:v0.1.0",
Image: defaultEvalImage,
WorkingDir: defaultPVCMountPath,
Command: []string{
"python3",
"kubeagi-cli",
},
Args: []string{
"-m",
"ragas_once.cli",
"evaluate",
fmt.Sprintf("--apibase=%s", apiBase),
fmt.Sprintf("--llm=%s", model),
fmt.Sprintf("--embedding-apibase=%s", apiBase),
fmt.Sprintf("--llm-model=%s", model),
fmt.Sprintf("--apikey=%s", apiKey),
fmt.Sprintf("--embedding-apikey=%s", apiKey),
fmt.Sprintf("--dataset=%s", filepath.Join(defaultPVCMountPath, defaultTestRagFile)),
fmt.Sprintf("--metrics=%s", strings.Join(metrics, ",")),
fmt.Sprintf("--embedding=%s", embedderModelList[0]),
fmt.Sprintf("--embedding-model=%s", embedderModelList[0]),
},
VolumeMounts: []v1.VolumeMount{
{
Expand Down
201 changes: 0 additions & 201 deletions pypi/ragas_once/LICENSE

This file was deleted.

59 changes: 0 additions & 59 deletions pypi/ragas_once/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions pypi/ragas_once/pyproject.toml

This file was deleted.

5 changes: 0 additions & 5 deletions pypi/ragas_once/setup.py

This file was deleted.

Empty file.
Loading

0 comments on commit 1dfc75b

Please sign in to comment.