Top Engine Code
Status: Alpha
Brought to you by:
topengine
AWS account: 0252-8232-1887 EC2 user ID: 025282321887 AWS Access key: 1GD4FJ7FVE4PKEJNHH82 AWS Secret key: xjkmAypKBc2ahRKLl3faW5ZZnj9ziK/BXk10rrwZ ---------------------------------- Buiding AMI for Top Engine (test) ---------------------------------- start from ami-2c8f6a45 from ~/projects/ec2_workspace [michel@localhost ec2_workspace]$ ec2-run-instances ami-2c8f6a45 -k top-keypair INSTANCE i-b74aa8de ami-2c8f6a45 pending top-keypair 0 [michel@localhost ec2_workspace]$ ec2-describe-instances i-b74aa8de INSTANCE i-b74aa8de ami-2c8f6a45 ec2-72-44-49-160.z-1.compute-1.amazonaws.com domU-12-31-36-00-26-44.z-1.compute-1.internal running top-keypair 0 [michel@localhost ec2_workspace]$ ssh -i ./top-keypair root@ec2-72-44-49-160.z-1.compute-1.amazonaws.com [root@domU-12-31-36-00-26-44:~] --------------------- Modifying the instance: --------------------- [michel@localhost ec2_workspace]$ scp -i ./top-keypair ../top_engine/tools/ec2-readme root@ec2-72-44-49-160.z-1.compute-1.amazonaws.com:/root/ec2-readme [root@domU-12-31-36-00-26-44:~] ls ec2-readme --------------------- Bundling the instance: --------------------- [michel@localhost ec2_workspace]$ scp -i ./top-keypair ~/.ec2/pk-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem ~/.ec2/cert-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem root@ec2-72-44-49-160.z-1.compute-1.amazonaws.com:/mnt [root@domU-12-31-36-00-26-44:~] ec2-bundle-vol -d /mnt -k /mnt/pk-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem -c /mnt/cert-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem -u 025282321887 -s 2560 [root@domU-12-31-36-00-26-44:~] ec2-upload-bundle -b topengine_02 -m /mnt/image.manifest.xml -a 1GD4FJ7FVE4PKEJNHH82 -s xjkmAypKBc2ahRKLl3faW5ZZnj9ziK/BXk10rrwZ [michel@localhost ec2_workspace]$ ec2-register topengine_02/image.manifest.xml IMAGE ami-49e40120 ----------------------------- Stoping the modified instance ----------------------------- [michel@localhost ec2_workspace]$ ec2-terminate-instances i-b74aa8de INSTANCE i-b74aa8de running shutting-down -------------------------------- Trying out the modyfied instance: -------------------------------- [michel@localhost ec2_workspace]$ ec2-run-instances ami-49e40120 -k top-keypair INSTANCE i-e04ba989 ami-49e40120 pending top-keypair 0 [michel@localhost ec2_workspace]$ ec2-describe-instances i-e04ba989 INSTANCE i-e04ba989 ami-49e40120 ec2-72-44-50-15.z-1.compute-1.amazonaws.com domU-12-31-36-00-24-81.z-1.compute-1.internal running top-keypair 0 [michel@localhost ec2_workspace]$ ssh -i ./top-keypair root@ec2-72-44-50-15.z-1.compute-1.amazonaws.com [root@domU-12-31-36-00-24-81:~] ----------------------------------------- Modifying the new instance for Top Engine (pre-requisites): ----------------------------------------- executed from promt: [root@domU-12-31-36-00-24-81:~] yum -y install boost* yum -y install httpd.i386 yum -y install system-config-httpd.noarch yum -y install mod_ssl.i386 yum -y install httpd-manual.i386 yum -y install mod_python.i386 yum -y install xerces-c.i386 yum -y install postgresql.i386 yum -y install postgresql-contrib.i386 yum -y install postgresql-libs.i386 yum -y install postgresql-server.i386 yum -y install phpPgAdmin.noarch yum -y install python-cheetah.i386 [root@domU-12-31-36-00-24-81:~] svn co http://svn.cherrypy.org/branches/cherrypy-3.0.x [root@domU-12-31-36-00-24-81:~] cd cherrypy-3.0.x/ [root@domU-12-31-36-00-24-81:~/cherrypy-3.0.x] python ./setup.py install [root@domU-12-31-36-00-24-81:~/cherrypy-3.0.x] cd .. -------------------- Deploying top engine -------------------- [michel@localhost ec2_workspace]$ scp -i ./top-keypair ../top-engine/tools/modpython_gateway.py root@72.44.50.15:/usr/lib/python2.4/site-packages/ [michel@localhost ec2_workspace]$ scp -i ./top-keypair ../top-engine/tools/root-deploy-topengine root@72.44.50.15:/root [michel@localhost ec2_workspace]$ scp -i ./top-keypair ../top-engine/tools/top-engine-deploy-v41.tgz root@72.44.50.15:/root [root@domU-12-31-36-00-24-81:~] tar -xvf ./top-engine-deploy-v41.tgz [root@domU-12-31-36-00-24-81:~] ./root-deploy-topengine [root@domU-12-31-36-00-24-81:~] cp -v ./deploy/usr_lib/* /usr/lib [root@domU-12-31-36-00-24-81:~] ldconfig [root@domU-12-31-36-00-24-81:~] /usr/sbin/apachectl -k restart -------------------------------------- Bundling the Top Engine-ready instance: -------------------------------------- [michel@localhost ec2_workspace]$ scp -i ./top-keypair ~/.ec2/pk-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem ~/.ec2/cert-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem root@72.44.50.15:/mnt [root@domU-12-31-36-00-24-81:~] ec2-bundle-vol -d /mnt -k /mnt/pk-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem -c /mnt/cert-ZZ6Z6BMHP5TWBJL2DQTEHG2V73FUN3DC.pem -u 025282321887 -s 2560 [root@domU-12-31-36-00-24-81:~] ec2-upload-bundle -b topengine_03 -m /mnt/image.manifest.xml -a 1GD4FJ7FVE4PKEJNHH82 -s xjkmAypKBc2ahRKLl3faW5ZZnj9ziK/BXk10rrwZ [michel@localhost ec2_workspace]$ ec2-register topengine_03/image.manifest.xml IMAGE ami-b9ed08d0 [michel@localhost ec2_workspace]$ ec2-describe-images -o self IMAGE ami-49e40120 topengine_02/image.manifest.xml 025282321887 available private IMAGE ami-519b7e38 topengine_01/image.manifest.xml 025282321887 available private IMAGE ami-b9ed08d0 topengine_03/image.manifest.xml 025282321887 available private ------------------------------------ Testing the new Top Engine instance: ------------------------------------ [michel@localhost ec2_workspace]$ ec2-run-instances ami-b9ed08d0 -k top-keypair INSTANCE i-71e30f18 ami-b9ed08d0 pending top-keypair 0 [michel@localhost ec2_workspace]$ ec2-describe-instances i-71e30f18 INSTANCE i-71e30f18 ami-b9ed08d0 ec2-72-44-40-82.z-2.compute-1.amazonaws.com domU-12-31-35-00-0C-44.z-2.compute-1.internal running top-key [michel@localhost ec2_workspace]$ ssh -i ./top-keypair root@ec2-72-44-40-82.z-2.compute-1.amazonaws.com [michel@localhost ec2_workspace]$ ec2-terminate-instances i-71e30f18 ------------------------ Cleaning up unused AMIs ------------------------ [michel@localhost ec2_workspace]$ ec2-describe-images -o self IMAGE ami-49e40120 topengine_02/image.manifest.xml 025282321887 available private IMAGE ami-519b7e38 topengine_01/image.manifest.xml 025282321887 available private IMAGE ami-b9ed08d0 topengine_03/image.manifest.xml 025282321887 available private [michel@localhost ec2_workspace]$ ec2-deregister ami-49e40120 [michel@localhost ec2_workspace]$ ec2-deregister ami-519b7e38 [michel@localhost ec2_workspace]$ ec2-describe-images -o self IMAGE ami-b9ed08d0 topengine_03/image.manifest.xml 025282321887 available private [michel@localhost ec2_workspace]$ ec2-delete-bundle -b topengine_01 -p image -a 1GD4FJ7FVE4PKEJNHH82 -s xjkmAypKBc2ahRKLl3faW5ZZnj9ziK/BXk10rrwZ [michel@localhost ec2_workspace]$ ec2-delete-bundle -b topengine_02 -p image -a 1GD4FJ7FVE4PKEJNHH82 -s xjkmAypKBc2ahRKLl3faW5ZZnj9ziK/BXk10rrwZ