All I want to do is install python 3.4 on a cfncluster. But when I do the following, the cluster starts up, and no python3 command works. If I run the code from the pyinstall.sh directly on the machine, it runs, but the effects don't propagate to the other compute nodes.
[cluster default]
key_name = ubuntu
vpc_settings = test
post_install = https://<domain>.s3.amazonaws.com/pyinstall.sh
``` pyinstall.sh
sudo yum -y install --enablerepo=epel yum-utils python34 python34-setuptools
sudo easy_install-3.4 pip
sudo python3 -m pip install keras tensorflow scoop ipython sklearn deap
git clone https://github.com/ryanpeach/sklearn-deap.git
cd sklearn-deap
git checkout better-parallel
sudo python3 setup.py install
```
I've commented out everything except the first line and that still doesn't install anything.
I've removed the sudo's and that doesn't solve anything.
Any idea why this doesn't work?
What error are you seeing when the post install fails? You can find the logs in /var/log/cfn-init-cmd.log or /var/log/cfn-init.log
I will let you know in just a minute. But viewing those files generally hasn’t said anything negative about runpostinstall.
Edit: It creates, no errors given on sysout, but when you ssh no new versions of python are in /bin or /usr/bin
From: Mohan Gandhi notifications@github.com
Sent: Friday, October 27, 2017 12:59:20 PM
To: awslabs/cfncluster
Cc: Ryan Peach; Author
Subject: Re: [awslabs/cfncluster] post_install not doing anything. (#248)
What error are you seeing when the post install fails? You can find the logs in /var/log/cfn-init-cmd.log or /var/log/cfn-init.log
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/awslabs/cfncluster/issues/248#issuecomment-340027238, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOJryR9nGXlHVkQDKH39_ECxITvcLBpcks5swgvogaJpZM4QJVMS.
Ok so I did
cfncluster create default
cfncluster start default
Got:
Status: cfncluster-default - CREATE_COMPLETE
ssh'ing into the master I try
[ec2-user@ip-... ~]$ python3
-bash: python3: command not found
Here is my log on pastebin:
Does it not think there is anything in post install?
+stack_name=cfncluster-default
+cfn_preinstall=NONE
+cfn_preinstall_args=NONE
+cfn_postinstall=NONE
+cfn_postinstall_args="NONE"
+cfn_region=us-east-2
+cfn_scheduler=sge
+cfn_scheduler_slots=vcpus
+cfn_instance_slots=1
+cfn_encrypted_ephemeral=false
+cfn_ephemeral_dir=/scratch
+cfn_shared_dir=/shared
+cfn_proxy=NONE
+cfn_node_type=MasterServer
+cfn_cluster_user=ec2-user
@mohanasudhan any insight?
As far I see, your log doesn't reflect post_install script. One issue I see in your script path is "https", hence we use "wget" to download script file, it should fail if the script is not publicly accessible. Stating again, your logs doesn't reflect the same. Here are few options to try
1) Change to s3://location_of_script.sh - in this case we use aws cli to download the script. If this works let us know we need to improve logs in this area
2) I am not sure your config is getting picked correctly. Can you copy paste your complete config? (exclude any credential or sensitive details before publishing)
3) I am under the impression you using amazon linux but your key name is ubuntu. So just adding this information, we have an issue on sudo with centos7 ami (https://github.com/awslabs/cfncluster-cookbook/issues/34) - in case if its centos7 you want to follow the PR referred in the issue.
Sorry for the delay, I missed your follow-up messages. Don't hesitate to tag me again if you don't see response in 1-2 days. Thanks
Ok, so I'm removing sudo's as per #3, my post_install now looks like this:
#!/bin/bash
# Install Python and dependencies
yum -y install --enablerepo=epel yum-utils python34 python34-setuptools
easy_install-3.4 pip
python3 -m pip install keras tensorflow scoop ipython sklearn deap
# Install Sklearn-deap
git clone https://github.com/ryanpeach/sklearn-deap.git
cd sklearn-deap
git checkout better-parallel
python3 setup.py install
My config file looks like this:
[aws]
aws_access_key_id = <private>
aws_region_name = us-east-2
aws_secret_access_key = <private>
[cluster default]
key_name = ubuntu
vpc_settings = test
post_install = s3://<bucket-name>/pyinstall.sh
[vpc test]
vpc_id = <private>
master_subnet_id = <private>
[global]
sanity_check = true
cluster_template = default
update_check = true
Uploaded pyinstall.sh like this and double checked via the web interface it is correct and public
aws s3 cp --acl public-read <local path> s3://<bucket-name>/pyinstall.sh
I am under the impression you using amazon linux but your key name is ubuntu.
This is a mistake I just haven't bothered to rename. Pay it no mind, it's the default image.
Running cfncluster create default now. Then I'll post my log on pastebin.
Wow, thanks @mohanasudhan, just those three tips and it started working 100%!
Thing is, I'm sure I've done those things before, I tried everrryyyything. But hey, if it works it works, thanks a million.