Created
December 28, 2011 18:37
-
-
Save mattf/1529085 to your computer and use it in GitHub Desktop.
Import EC2 instance into Schedd queue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Provide three arguments: | |
# . instance id to link | |
# . path to file with access key id | |
# . path to file with secret access key | |
# TODO: | |
# . Get EC2UserData (ec2-describe-instance-attribute --user-data) | |
ec2-describe-instances --show-empty-fields $1 | \ | |
awk '/^INSTANCE/ {id=$2; ami=$3; keypair=$7; type=$10; zone=$12; ip=$17; group=$29} | |
/^TAG/ {name=$5} | |
END {print "universe = grid\n", | |
"grid_resource = ec2 https://ec2.amazonaws.com\n", | |
"executable =", ami"-"name, "\n", | |
"log = $(executable).$(cluster).log\n", | |
"ec2_ami_id =", ami, "\n", | |
"ec2_instance_type =", type, "\n", | |
"ec2_keypair_file = name-"keypair, "\n", | |
"ec2_security_groups =", group, "\n", | |
"ec2_availability_zone =", zone, "\n", | |
"ec2_elastic_ip =", ip, "\n", | |
"+EC2InstanceName = \""id"\"\n", | |
"+GridJobId = \"$(grid_resource) BOGUS", id, "\"\n", | |
"queue\n"}' | \ | |
condor_submit -a "ec2_access_key_id = $2" \ | |
-a "ec2_secret_access_key = $3" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment