Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/aws-efa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ aws ec2 describe-security-groups --group-ids $CLUSTER_SG \
## GitHub Actions Integration

The script is designed to run in GitHub Actions when branches are updated.
It relies on the `GITHUB_REF` environment variable to determine which branch or commit to test. The value can be a branch name (e.g., `main`, `feature-xyz`) or a commit SHA.
It tests the exact commit in `GITHUB_SHA`, so the run is unaffected if the `pull-request/<N>` branch is deleted or force-pushed before the AWS pod starts. If `GITHUB_SHA` is unset, it falls back to `GITHUB_REF`, which can be a branch name (e.g., `main`, `feature-xyz`) or a commit SHA.

### Required GitHub Secrets

Expand Down
13 changes: 5 additions & 8 deletions contrib/aws-efa/aws_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ usage() {
echo "Runs contrib/aws-efa/aws_test_remote.sh inside the AWS job."
echo ""
echo "Required environment variables:"
echo " GITHUB_REF - Git reference to checkout (e.g., main, branch-xyz, commit SHA)"
echo " GITHUB_REF - Git reference to test if GITHUB_SHA is unset (e.g., main, branch-xyz, commit SHA)"
echo " GITHUB_SERVER_URL - GitHub server URL (e.g., \"https://github.com\")"
echo " GITHUB_REPOSITORY - GitHub repository (e.g., \"ai-dynamo/nixl\")"
echo ""
echo "Optional environment variables:"
echo " GITHUB_SHA - Commit SHA to test, takes precedence over GITHUB_REF (set by GitHub Actions)"
echo " CONTAINER_IMAGE - Container image to use (default: nvcr.io/nvidia/cuda:13.0.1-devel-ubuntu24.04)"
echo " TEST_TIMEOUT - Timeout for test execution in minutes"
exit 1
Expand All @@ -43,20 +44,16 @@ fi

export CONTAINER_IMAGE=${CONTAINER_IMAGE:-"nvcr.io/nvidia/cuda:13.0.1-devel-ubuntu24.04"}

checkout_ref="$GITHUB_REF"
case "$GITHUB_REF" in
refs/heads/*)
checkout_ref="${GITHUB_REF#refs/heads/}"
;;
esac
# Pin the commit: pull-request/<N> branches can be deleted or moved before the pod clones.
checkout_ref="${GITHUB_SHA:-$GITHUB_REF}"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

if [ -n "$TEST_TIMEOUT" ]; then
TIMEOUT_CMD="timeout ${TEST_TIMEOUT}m"
else
TIMEOUT_CMD=""
fi
# The nvidia/cuda base image ships no git; .gitlab/build.sh installs it, but only after the clone.
export AWS_CMD="set -x && apt-get -qq update && apt-get -qq install -y git && git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} && cd nixl && git checkout ${checkout_ref} && $TIMEOUT_CMD bash contrib/aws-efa/aws_test_remote.sh \${NIXL_INSTALL_DIR}"
export AWS_CMD="set -x && apt-get -qq update && apt-get -qq install -y git && git init -q nixl && cd nixl && git fetch --depth 1 ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} ${checkout_ref} && git checkout --detach FETCH_HEAD && $TIMEOUT_CMD bash contrib/aws-efa/aws_test_remote.sh \${NIXL_INSTALL_DIR}"

# Generate AWS job properties json from template
envsubst < aws_vars.template > aws_vars.json
Expand Down
Loading