Unverified Commit cab23f21 authored by Keiven C's avatar Keiven C Committed by GitHub
Browse files

fix: update post-create.sh for current build system and fix unbound variables (#3304)


Signed-off-by: default avatarKeiven Chang <keivenchang@users.noreply.github.com>
parent af4c0cad
......@@ -63,7 +63,7 @@ mkdir -p $CARGO_TARGET_DIR
uv pip uninstall --yes ai-dynamo ai-dynamo-runtime 2>/dev/null || true
# Build project, with `dev` profile it will be saved at $CARGO_TARGET_DIR/debug
cargo build --locked --profile dev --features mistralrs
cargo build --locked --profile dev --features dynamo-llm/block-manager
# install the python bindings
......@@ -82,13 +82,13 @@ cargo build --locked --profile dev --features mistralrs
# installs overall python packages, grabs binaries from .build/target/debug
cd $DYNAMO_HOME && retry env DYNAMO_BIN_PATH=$CARGO_TARGET_DIR/debug uv pip install -e .
{ set +x; } 2>/dev/null
echo -e "\n" >> ~/.bashrc
echo "# === This section is generated by the post-create.sh script ===" >> ~/.bashrc
{ set +x; } 2>/dev/null
# Check if PYTHONPATH is already set in environment
if [ -n "$PYTHONPATH" ]; then
if [ -n "${PYTHONPATH:-}" ]; then
# PYTHONPATH exists, replace /workspace with $DYNAMO_HOME
export PYTHONPATH=$(echo "$PYTHONPATH" | sed "s|/workspace|$DYNAMO_HOME|g")
# Also add to .bashrc for persistence
......@@ -122,13 +122,13 @@ fi
# Unset empty tokens/variables to avoid issues with authentication and SSH
if ! grep -q "# Unset empty tokens" ~/.bashrc; then
echo -e "\n# Unset empty tokens and environment variables" >> ~/.bashrc
echo '[ -z "$HF_TOKEN" ] && unset HF_TOKEN' >> ~/.bashrc
echo '[ -z "$GITHUB_TOKEN" ] && unset GITHUB_TOKEN' >> ~/.bashrc
echo '[ -z "$SSH_AUTH_SOCK" ] && unset SSH_AUTH_SOCK' >> ~/.bashrc
echo '[ -z "${HF_TOKEN:-}" ] && unset HF_TOKEN' >> ~/.bashrc
echo '[ -z "${GITHUB_TOKEN:-}" ] && unset GITHUB_TOKEN' >> ~/.bashrc
echo '[ -z "${SSH_AUTH_SOCK:-}" ] && unset SSH_AUTH_SOCK' >> ~/.bashrc
fi
# Check SSH agent forwarding status
if [ -n "$SSH_AUTH_SOCK" ]; then
if [ -n "${SSH_AUTH_SOCK:-}" ]; then
if ssh-add -l > /dev/null 2>&1; then
echo "SSH agent forwarding is working - found $(ssh-add -l | wc -l) key(s):"
ssh-add -l
......
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