I’ve been trying to create the P2 instance using Windows 10 and Cygwin for 2 days. I also tried installing Ubuntu bash to no avail.
After almost losing the will to live and having experienced just about every setup_p2.sh error under the sun, I installed a Linux virtual machine, copied the entire setup folder from the git repository to my (virtual) Ubuntu desktop, installed aws, then ran the aws configuration followed by bash setup_p2.sh from the linux command line. Everything worked like a dream, and now the P2 instance is up and running. If you’re in a similar situation, this approach may help.
Hi JP, thanks for your suggestion. The issue is not the space, I tried that already. I get the same output if I simply type ssh command. I am basically stuck without any progress.
Can you ssh successfully anywhere else with any set of parameters? Back at school or in some corporate setup, I had access to many servers to practice on. Nowadays, I’d Google a bit and/or would setup my own SSH server. This thread for example, looks like a promising source of test locations:
You need to isolate the fault. Is it with the specific AWS parameters? Is it a ssh client install issue? Funky interaction with your shell?
Also, are you able to determine exactly which ssh client is being called? My memory of which unix commands are available on Cygwin is fuzzy, but perhaps “which ssh” would do it.
After a LOT of time spent on this, I finally found a solution that works.
The primary issue is that the cygwin didn’t come with python installed, and doesn’t know where to find the existing Windows Anaconda version on your machine. This can be verified by running which python from within cygwin - it couldn’t find where python is saved. Note that this can be confusing because running pip install awscli likely doesn’t throw an error message. Cygwin actually installs awscli in the Window’s Anaconda installation of Python (I find this odd since we didn’t run conda install awscli).
HOWEVER, rather than try to point cygwin to the already installed version of Anaconda python on your machine it will save you a ton of headache to just install a cygwin-specific instance of python.
…Note, however, that the first command pip uninstall awscli “hung up” for me. So just escape out of it using quit() and continue with the others in order.
You can check that everything worked if you run which python in cygwin and it points to the cygin version (i.e. /usr/bin/python , as opposed to: /users/…/Anaconda2/).
The next CRITICAL step is that when you download all the shell scripts from Github setup folder (https://github.com/fastai/courses/tree/master/setup), Windows automatically CRLF line terminators! Therefore, in cygwin, run the following commands:
Hi, I am having the same error,
$ bash setup_p2.sh
setup_p2.sh: line 2: syntax error near unexpected token newline’
setup_p2.sh: line 2:'
but
how to delete the original setup_instance.sh file?
I am using the Ubuntu Bash on Win10 because for some reasons Cygwin does not recognize commands like “conda” or “pip” on my computer ( I tried to add Anaconda to .bashrc but it still didn’t work).
Everything went fine in Ubuntu Bash until I set up the instance and tried to connect to it.
I ran “bash setup_p2.sh” and I get the following error:
True
An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair ‘aws-key-fast-ai’ does not exist
An error occurred (MissingParameter) when calling the CreateTags operation: The request must contain the parameter resourceIdSet
Waiting for instance start…
Waiter InstanceRunning failed: Max attempts exceeded
usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --instance-id: expected one argument
An error occurred (MissingParameter) when calling the RebootInstances operation: The request must contain the parameter InstancesSet
All done. Find all you need to connect in the fast-ai-commands.txt file and to remove the stack call fast-ai-remove.sh
Connect to your instance: ssh -i /home/Zeinab/.ssh/aws-key-fast-ai.pem ubuntu@None
I checked and I know that the file “aws-key-fast-ai.pem” does not exist, but I don’t know how to create it. Any help would be appreciated.