Setup problems: AWS

1> Does it mandatory to set up AWS instance like GPU enabled and/or t2 micro or we can just use CPU enabled laptop to complete the course?
2> Is AWS instance created for students that we can use or we all need to do have to have our own instance created, configured and make it work (and pay of course)?
3> Could we have a write-up to have all the dependencies listed to be installed like - all python packages (with or without Anaconda), any DL packages (Keras, Theano anything else?)?
4> Pardon me but this is overly overwhelming for me and I have been active completing similar courses in Coursera (my personal fav), Edx and Udacity. Not to criticize but I can use little help here to learn and make use of this great source of knowledge for DL. Thanks for this course.

1 Like

@anaik2 's solution, with a little extra tinkering, worked for me.

The solution provided here: http://wiki.fast.ai/index.php/Awscli_in_cygwin would not work for me (windows 10 PC, previous python build’s installed).

I needed to add the extra packages to the cygwin install and make sure all cache references to aws were cleared before things started working. Thanks @anaik2

Hi all,

I’m attempting to set up my GPU instance using ./setup_p2.sh per the instructions.

It looks like everything goes successfully, but I cannot connect to the EC2 instance – get an “Operation timed out” error.

I notice that, if I stop & restart the EC2 instance from my AWS console, then I can ssh to the instance – but my console session quickly locks up, and I again get the timeout error if I try to ssh back in.

Has anyone else had this experience?

Donal

Alright so I run bash setup_2.sh and I receive the following.
`$ bash setup_t2.sh
setup_t2.sh: line 4: $’\r’: command not found
setup_t2.sh: line 8: $’\r’: command not found
setup_t2.sh: line 9: $’\r’: command not found
setup_t2.sh: line 12: $’\r’: command not found
setup_t2.sh: line 13: $’\r’: command not found
setup_t2.sh: line 15: $’\r’: command not found
rtbassoc-28f6714e

An error occurred (InvalidRouteTableId.Malformed) when calling the CreateRoute operation: Invalid id: "rtb"d7017ab0
setup_t2.sh: line 19: $’\r’: command not found

An error occurred (InvalidGroupId.Malformed) when calling the AuthorizeSecurityGroupIngress operation: Inv"lid id: "sg-02f9017a
setup_t2.sh: line 61: syntax error: unexpected end of file
`
I already have aws configured.

1 Like

Thanks , that worked

That means you didn’t set your output type as ‘text’ when you ran aws configure. See the setup video for how to do that, or just edit ~/.aws/config and change it to ‘text’ output.

1 Like

Yes. Put it in quotes.

Your username has spaces. So you’ll need quotes around the whole path

Try doing a git pull again - an older version had windows line endings, which confused linux, but we fixed it a few days ago. Otherwise you can use dos2unix to fix it yourself.

So I never pulled any code from github, I just used wget and the link address for the t2 setup. Should I pull the whole repository or just the setup folder?

##Setup guide to Ireland

HI,

Any of you having trouble setting up GPU in Ireland, Europe. Here is what you need to add/change to add a GPU in Europe, and your GPU in Oregon will still work afterwards.

  1. Change you default aws region to eu-west-1 and not eu-east-1 as described in http://course.fast.ai/lessons/aws.html

  2. Create a file named setup_p2_ireland_local.sh from the script below, this script is actually the same as the script for Oregon but pointing to the propper aim in Ireland, creating a key role called aws-key-ireland rather than awe-key and putting this key into a a file called aws-key-ireland.pem rather thant aws-key.pem on you local machine.

regards

Max

export vpcId=`aws ec2 create-vpc --cidr-block 10.0.0.0/28 --query 'Vpc.VpcId' --output text`
aws ec2 modify-vpc-attribute --vpc-id $vpcId --enable-dns-support "{\"Value\":true}"
aws ec2 modify-vpc-attribute --vpc-id $vpcId --enable-dns-hostnames "{\"Value\":true}"
export internetGatewayId=`aws ec2 create-internet-gateway --query 'InternetGateway.InternetGatewayId' --output text`
aws ec2 attach-internet-gateway --internet-gateway-id $internetGatewayId --vpc-id $vpcId
export subnetId=`aws ec2 create-subnet --vpc-id $vpcId --cidr-block 10.0.0.0/28 --query 'Subnet.SubnetId' --output text`
export routeTableId=`aws ec2 create-route-table --vpc-id $vpcId --query 'RouteTable.RouteTableId' --output text`
aws ec2 associate-route-table --route-table-id $routeTableId --subnet-id $subnetId
aws ec2 create-route --route-table-id $routeTableId --destination-cidr-block 0.0.0.0/0 --gateway-id $internetGatewayId
export securityGroupId=`aws ec2 create-security-group --group-name my-security-group --description "DL:Generated by setup_vpn.sh" --vpc-id $vpcId --query 'GroupId' --output text`
aws ec2 authorize-security-group-ingress --group-id $securityGroupId --protocol tcp --port 22 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $securityGroupId --protocol tcp --port 8888-8898 --cidr 0.0.0.0/0
aws ec2 create-key-pair --key-name aws-key-ireland --query 'KeyMaterial' --output text > ~/.ssh/aws-key-ireland.pem
chmod 400 ~/.ssh/aws-key-ireland.pem

export instanceId=`aws ec2 run-instances --image-id ami-b43d1ec7 --count 1 --instance-type p2.xlarge --key-name aws-key-ireland --security-group-ids $securityGroupId --subnet-id $subnetId --associate-public-ip-address --block-device-mapping "[ { \"DeviceName\": \"/dev/sda1\", \"Ebs\": { \"VolumeSize\": 128, \"VolumeType\": \"gp2\" } } ]" --query 'Instances[0].InstanceId' --output text`
export allocAddr=`aws ec2 allocate-address --domain vpc --query 'AllocationId' --output text`

echo Waiting for instance start...
aws ec2 wait instance-running --instance-ids $instanceId
sleep 10 # wait for ssh service to start running too
export assocId=`aws ec2 associate-address --instance-id $instanceId --allocation-id $allocAddr --query 'AssociationId' --output text`
export instanceUrl=`aws ec2 describe-instances --instance-ids $instanceId --query 'Reservations[0].Instances[0].PublicDnsName' --output text`
echo securityGroupId=$securityGroupId
echo subnetId=$subnetId
echo instanceId=$instanceId
echo instanceUrl=$instanceUrl
echo Connect: ssh -i ~/.ssh/aws-key-ireland.pem ubuntu@$instanceUrl
2 Likes

The new user creation shown in the video is slightly different than what I see. In the ‘add user’ page, I enter my name ‘testuser’. Below that is the AWS access type. It has 2 options

  1. Programmatic access
  2. AWS Management Console access
    I can choose both in which case more options are presented.

Can you please verify which one to check.

Thanks!
PJ

1 Like

Choosing ‘both’ should be fine.

Many thanks - I’ve fixed that page now.

How is the script you show different to the setp_p2_ireland.sh we have, and why do you suggest making those changes?

You only really need the setup folder locally.

Awesome, got it running. Now I am having the issue of not being able to connect to that instance I think. I was able to successfully start the instance because the console says it is running but when I put the To Connect address it states that ssh: command not found.

Sounds like you don’t have openssh installed.

just checked and i did have it as ‘text’. Any other thoughts? Thank you.

I was having exactly the same problem.
Rebooting fixed if for me as well!

1 Like

I am getting the following error during the configuration process, when I run
bash setup_p2.sh
As the error says that there are two instances that I am requesting, but I don’t know where I went wrong. I followed the steps as instructed.
Kindly advice.

An error occurred (InstanceLimitExceeded) when calling the RunInstances operation: You have requested more instances (2) than your current instance limit of 1 allows for the specified instance type. Please visit http://aws.amazon.com/contact-us/ec2-request to request an adjustment to this limit.