Skip to content

Commit 4af4f34

Browse files
authored
Merge pull request #1 from yossiovadia/main
feat: use laptop hostname in instance names and display instance info
2 parents 67ca6d5 + d270b8c commit 4af4f34

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

deploy-k8s-cluster.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,42 @@ deploy_cluster() {
3333
ansible-playbook -i "$INVENTORY_FILE" kubernetes-single-node.yaml
3434

3535
echo "Deployment complete!"
36-
echo "Check the instance details file for SSH access information."
3736

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

4140
echo "Testing LLM-D..."
4241
ansible-playbook -i "$INVENTORY_FILE" llm-d-test.yaml
42+
43+
echo ""
44+
echo "=== Instance Information ==="
45+
46+
# Find the most recent instance details file
47+
DETAILS_FILE=$(ls -rt instance-*-details.txt | tail -1)
48+
49+
if [ -n "$DETAILS_FILE" ]; then
50+
# Extract key information from the details file
51+
INSTANCE_ID=$(grep "Instance ID:" "$DETAILS_FILE" | cut -d' ' -f3)
52+
INSTANCE_NAME=$(grep "Instance Name:" "$DETAILS_FILE" | cut -d' ' -f3)
53+
PUBLIC_IP=$(grep "Public IP:" "$DETAILS_FILE" | cut -d' ' -f3)
54+
PRIVATE_IP=$(grep "Private IP:" "$DETAILS_FILE" | cut -d' ' -f3)
55+
INSTANCE_TYPE=$(grep "Instance Type:" "$DETAILS_FILE" | cut -d' ' -f3)
56+
SSH_COMMAND=$(grep "ssh -i" "$DETAILS_FILE")
57+
58+
echo "Instance ID: $INSTANCE_ID"
59+
echo "Instance Name: $INSTANCE_NAME"
60+
echo "Instance Type: $INSTANCE_TYPE"
61+
echo "Public IP: $PUBLIC_IP"
62+
echo "Private IP: $PRIVATE_IP"
63+
echo ""
64+
echo "SSH Access:"
65+
echo "$SSH_COMMAND"
66+
echo ""
67+
echo "Full details saved to: $DETAILS_FILE"
68+
else
69+
echo "Warning: Could not find instance details file"
70+
echo "Check the instance details file for SSH access information."
71+
fi
4372
}
4473

4574
cleanup_instances() {

launch-instance.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
key_pair: router-team-us-east2
1111
security_group_id: sg-0704e6bcaa5e655b1 # k8s security group
1212
root_volume_size: 500 # GB
13-
instance_name: "GPU-Instance-{{ ansible_date_time.epoch }}"
13+
instance_name: "{{ ansible_hostname }}-{{ ansible_date_time.epoch }}"
1414

1515
tasks:
1616
- name: Ensure boto3 and botocore are installed

0 commit comments

Comments
 (0)