From b3428e7d38cc1e834799bc8ea07f7dc7ebdab527 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:05:17 -0500 Subject: [PATCH] Unify dependencies in agent image (#3008) * Install all flyteagent image dependencies in a single command Signed-off-by: Eduardo Apolinario * test - Can I run docker commands in gh workflows? Signed-off-by: Eduardo Apolinario * Remove `-it` flag from `docker run` Signed-off-by: Eduardo Apolinario * Remove quick test after confirming that running `docker run --rm ghcr.io/flyteorg/flyteagent:1.14.0 pyflyte serve agent --port 8000 --timeout 1` in a gh workflow works Signed-off-by: Eduardo Apolinario --------- Signed-off-by: Eduardo Apolinario Co-authored-by: Eduardo Apolinario --- .github/workflows/pythonpublish.yml | 3 +++ Dockerfile.agent | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 11f9c8e222..e5a8118923 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -222,6 +222,9 @@ jobs: file: ./Dockerfile.agent cache-from: type=gha cache-to: type=gha,mode=max + - name: Confirm Agent can start + run: | + docker run --rm ghcr.io/${{ github.repository_owner }}/flyteagent:${{ github.sha }} pyflyte serve agent --port 8000 --timeout 1 - name: Push flyteagent-all Image to GitHub Registry uses: docker/build-push-action@v2 with: diff --git a/Dockerfile.agent b/Dockerfile.agent index 7faa049336..1715fde894 100644 --- a/Dockerfile.agent +++ b/Dockerfile.agent @@ -8,13 +8,14 @@ ARG VERSION RUN apt-get update && apt-get install build-essential -y \ && pip install uv -RUN uv pip install --system prometheus-client grpcio-health-checking RUN uv pip install --system --no-cache-dir -U flytekit==$VERSION \ flytekitplugins-airflow==$VERSION \ flytekitplugins-bigquery==$VERSION \ flytekitplugins-openai==$VERSION \ flytekitplugins-snowflake==$VERSION \ flytekitplugins-awssagemaker==$VERSION \ + prometheus-client \ + grpcio-health-checking \ && apt-get clean autoclean \ && apt-get autoremove --yes \ && rm -rf /var/lib/{apt,dpkg,cache,log}/ \