Skip to content

feat: use laptop hostname in instance names and display instance info #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
31 changes: 30 additions & 1 deletion deploy-k8s-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,42 @@ deploy_cluster() {
ansible-playbook -i "$INVENTORY_FILE" kubernetes-single-node.yaml

echo "Deployment complete!"
echo "Check the instance details file for SSH access information."

echo "Deploying LLM-D..."
ansible-playbook -i "$INVENTORY_FILE" llm-d-deploy.yaml

echo "Testing LLM-D..."
ansible-playbook -i "$INVENTORY_FILE" llm-d-test.yaml

echo ""
echo "=== Instance Information ==="

# Find the most recent instance details file
DETAILS_FILE=$(ls -rt instance-*-details.txt | tail -1)

if [ -n "$DETAILS_FILE" ]; then
# Extract key information from the details file
INSTANCE_ID=$(grep "Instance ID:" "$DETAILS_FILE" | cut -d' ' -f3)
INSTANCE_NAME=$(grep "Instance Name:" "$DETAILS_FILE" | cut -d' ' -f3)
PUBLIC_IP=$(grep "Public IP:" "$DETAILS_FILE" | cut -d' ' -f3)
PRIVATE_IP=$(grep "Private IP:" "$DETAILS_FILE" | cut -d' ' -f3)
INSTANCE_TYPE=$(grep "Instance Type:" "$DETAILS_FILE" | cut -d' ' -f3)
SSH_COMMAND=$(grep "ssh -i" "$DETAILS_FILE")

echo "Instance ID: $INSTANCE_ID"
echo "Instance Name: $INSTANCE_NAME"
echo "Instance Type: $INSTANCE_TYPE"
echo "Public IP: $PUBLIC_IP"
echo "Private IP: $PRIVATE_IP"
echo ""
echo "SSH Access:"
echo "$SSH_COMMAND"
echo ""
echo "Full details saved to: $DETAILS_FILE"
else
echo "Warning: Could not find instance details file"
echo "Check the instance details file for SSH access information."
fi
}

cleanup_instances() {
Expand Down
2 changes: 1 addition & 1 deletion launch-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
key_pair: router-team-us-east2
security_group_id: sg-0704e6bcaa5e655b1 # k8s security group
root_volume_size: 500 # GB
instance_name: "GPU-Instance-{{ ansible_date_time.epoch }}"
instance_name: "{{ ansible_hostname }}-{{ ansible_date_time.epoch }}"

tasks:
- name: Ensure boto3 and botocore are installed
Expand Down