"git@developer.sourcefind.cn:OpenDAS/openpcdet.git" did not exist on "a0cfd6e4ee3cc94edf2c21377f4c5a3c6071ba84"
Unverified Commit 04e892d1 authored by hhzhang16's avatar hhzhang16 Committed by GitHub
Browse files

feat: misc changes while deploying (#831)

parent 3f5a44ab
......@@ -136,11 +136,12 @@ dynamo-build:
dynamo-base-docker:
ARG IMAGE=dynamo-base-docker
ARG CI_REGISTRY_IMAGE=my-registry
ARG CI_COMMIT_SHA=latest
ARG DOCKER_SERVER=my-registry
ARG IMAGE_TAG=latest
FROM ubuntu:24.04
WORKDIR /workspace
COPY container/deps/requirements.txt /tmp/requirements.txt
# Install Python and other dependencies
RUN apt-get update && \
......@@ -160,6 +161,8 @@ dynamo-base-docker:
ENV VIRTUAL_ENV=/opt/dynamo/venv
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
RUN uv pip install -r /tmp/requirements.txt
# Copy and install wheels -- ai-dynamo-runtime first, then ai-dynamo
COPY +dynamo-build/ai_dynamo_runtime*.whl /tmp/wheels/
COPY +dynamo-build/ai_dynamo*.whl /tmp/wheels/
......@@ -167,7 +170,7 @@ dynamo-base-docker:
uv pip install /tmp/wheels/*.whl && \
rm -rf /tmp/wheels
SAVE IMAGE --push $CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA
SAVE IMAGE --push $DOCKER_SERVER/$IMAGE:$IMAGE_TAG
############### ALL TARGETS ##############################
all-test:
......
......@@ -466,9 +466,10 @@ FROM ${RUNTIME_IMAGE}:${RUNTIME_IMAGE_TAG} AS runtime
WORKDIR /workspace
ENV DYNAMO_HOME=/workspace
ENV VIRTUAL_ENV=/opt/dynamo/venv
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
# Copy NIXL
COPY --from=build /usr/local/nixl /usr/local/nixl
COPY --from=base /usr/local/nixl /usr/local/nixl
ENV LD_LIBRARY_PATH=/usr/local/nixl/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
ENV PYTHONPATH=/usr/local/nixl/lib/python3/dist-packages/:/opt/nixl/test/python/:$PYTHONPATH
......@@ -480,9 +481,11 @@ RUN apt-get update && \
uv venv $VIRTUAL_ENV --python 3.12 && \
echo "source $VIRTUAL_ENV/bin/activate" >> ~/.bashrc
# Install the wheels
# Install the wheels and symlink executables to /usr/local/bin so dynamo components can use them
# Dynamo components currently do not have the VIRTUAL_ENV in their PATH, so we need to symlink the executables
COPY --from=wheel_builder /workspace/dist/*.whl wheelhouse/
RUN uv pip install ai-dynamo[vllm] --find-links wheelhouse && \
RUN uv pip install ai-dynamo[vllm] --find-links wheelhouse && \
ln -sf $VIRTUAL_ENV/bin/* /usr/local/bin/ && \
rm -r wheelhouse
# Tell vllm to use the Dynamo LLM C API for KV Cache Routing
......
......@@ -164,17 +164,27 @@ DYNAMO_TAG=$(dynamo build hello_world:Frontend | grep "Successfully built" | awk
```bash
echo $DYNAMO_TAG
export HELM_RELEASE=ci-hw
dynamo deployment create $DYNAMO_TAG -n $HELM_RELEASE
export DEPLOYMENT_NAME=ci-hw
dynamo deployment create $DYNAMO_TAG -n $DEPLOYMENT_NAME
```
4. **Test the deployment**
Once you create the Dynamo deployment, a pod prefixed with `yatai-dynamonim-image-builder` will begin running. Once it finishes running, it will create the pods necessary. Once the pods prefixed with `$HELM_RELEASE` are up and running, you can test out your example!
Find your frontend pod using one of these methods:
```bash
# Forward the service port to localhost
kubectl -n ${KUBE_NS} port-forward svc/${HELM_RELEASE}-frontend 8000:8000
# Method 1: List all pods and find the frontend pod manually
kubectl get pods -n ${KUBE_NS} | grep frontend | cat
# Method 2: Use a label selector to find the frontend pod automatically
export FRONTEND_POD=$(kubectl get pods -n ${KUBE_NS} | grep "${DEPLOYMENT_NAME}-frontend" | sort -k1 | tail -n1 | awk '{print $1}')
# Forward the pod's port to localhost
kubectl port-forward pod/$FRONTEND_POD 8000:8000 -n ${KUBE_NS}
# Note: We forward directly to the pod's port 8000 rather than the service port because the frontend component listens on port 8000 internally.
# Test the API endpoint
curl -X 'POST' 'http://localhost:8000/generate' \
......
......@@ -208,7 +208,7 @@ DYNAMO_TAG=$(dynamo build graphs.agg:Frontend | grep "Successfully built" | awk
```bash
echo $DYNAMO_TAG
export DEPLOYMENT_NAME=llm-agg
dynamo deployment create $DYNAMO_TAG --no-wait -n $DEPLOYMENT_NAME -f ./configs/agg.yaml
dynamo deployment create $DYNAMO_TAG -n $DEPLOYMENT_NAME -f ./configs/agg.yaml
```
4. **Test the deployment**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment