Feeds:
Posts
Comments

Archive for April, 2012

1. set starcluater configuration file
mount an EBS to /mnt/galaxyTools

2. launch a spot instance cluster
starcluster start spot_cluster –bid 0.11

3. enable job tolerance of node failure
#to enable resubmitting jobs when nodes die,
#log on the master node,
vi ~/.sge_request
#add the following line and save the change:
-r y

4. set Galaxy job scheduler to SGE
export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0
export SGE_ROOT=/opt/sge6

5. download and set Galaxy
$cd /mnt/galaxyTools
$ hg clone https://bitbucket.org/galaxy/galaxy-central or https://bitbucket.org/galaxy/galaxy-dist
$cd /mnt/galaxyTools/galaxy-dist
$./run.sh
#kill the process by control+c when Galaxy is up
$vi universe_wsgi.ini
#make the following changes to universe_wsgi.ini:
host = 0.0.0.0
start_job_runners = drmaa
default_cluster_job_runner = drmaa:///
#use MySQL instead of the default SQLite
database_connection = mysql://ubuntu@localhost:3306/galaxy_db?unix_socket=/run/mysqld/mysqld.sock

(
#or use postgreSQL instead of the default SQLite
database_connection = postgres:///galaxy_db?user=ubuntu&host=/var/run/postgresql
)
export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0
export SGE_ROOT=/opt/sge6

or (depending on what instances (x86 or x64) you are using)

export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x64/libdrmaa.so.1.0
export SGE_ROOT=/opt/sge6

(to persist the above setting, add them to the file /etc/profile)

6. create database account and database (use either MySQL or postgreSQL)

#create a MySQL account (ubuntu) since Galaxy is running as ubuntu (you can have it run as another user)
$mysql -u root
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘ubuntu’@’localhost’; //Galaxy should run as ubuntu, if not ubuntu, change to the user correspondingly
mysql>exit
$mysql //log on as ubuntu by default
mysql>create database galaxy_db;//the database name galaxy_db should be consistent with the one above used in the file universe_wsgi.ini

(
#use postgresql instead of SQLite
install postgresql
start postgresql
sudo /etc/init.d/postgresql start

I am running Galaxy under the user ubuntu, so first I create the ubuntu user
sudo -u postgres createuser -D -A -P ubuntu
sudo -u postgres createdb -O ubuntu galaxy_db
sudo -u postgres psql
GRANT ALL ON galaxy_db.* to ubuntu
)

#start Galaxy (should have set DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0 or DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x64/libdrmaa.so.1.0 and SGE_ROOT=/opt/sge6 before this step)
$cd /mnt/galaxyTools/galaxy-dist
$./run.sh

#change security group of the cluster by adding 8080
#visit Galaxy

http://EC2 ip address:8080

Image

Image

Read Full Post »

attach EBS to /dev/sdf

check the location where the EBS is attached (in this case, it is located /dev/xvdf on the Starcluster small instance)
$sudo fdisk -l
$sudo fdisk /dev/xvdf
select w

#make an xfs file system and mount it
$sudo apt-get install xfsprogs
$sudo mkfs.xfs -f /dev/xvdf
$mkdir tmp
$sudo mount /dev/xvdf tmp

Read Full Post »

create an EBS and mount it at /mnt/galaxy
$chown -R ubuntu:ubuntu /mnt/galaxy
$cd /mnt/galaxy
$hg clone ssh://hg@bitbucket.org/galaxy/galaxy-dist
$./run.sh
stop this process,

$vi universe_wsgi.ini
change host = 127.0.0.1 to host = 0.0.0.0 for web service
uncomment and change start_job_runners = None
start_job_runners = drmaa
uncomment and change default_cluster_job_runner = drmaa:///
default_cluster_job_runner = local:///

set environmental variables:
$export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0
(or export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x64/libdrmaa.so.1.0 depending on what instances were used.)
$export SGE_ROOT=/opt/sge6

$./run.sh

change security groups propertiy by adding tcp:8080 port

visit the galaxy on you instance
http://yourEC2Instancce:8080

Read Full Post »

1. create a bitbucket account and set ssh key

$ssh-keygen

which generates id_rsa.pub and id_rsa under ~/.ssh/, copy the content of id_rsa.pub and paste it in the SSH Key box on the bitbucket.org web site. see figure below.

Image

2. create a repo

Image

3. set bitbucket account information

Image

4. get a file which will be put in the repo

Image

5. add the file to the repo

Image

commit the change and push to bitbucket.org (need to create a new repo called cai_ssh_ajax_demo on the web site)

Image

6. add one more file and see how the change is reflected online

Image

Image

more details refer to http://zagar.biz/2012/up-and-running-with-mercurial-and-bitbucket/

Read Full Post »

1. log on to ubuntu with X11 forwarding enabled
Image

2. download chrome package (google-chrome-stable_current_amd64.deb) for ubuntu
wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
or
wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.deb

3. install chrome on ubuntu
$sudo dpkg -i google-chrome-stable_current_amd64.deb
(install other dependencies if needed)

4.use xming to show GUI. run xming by double click on it in windows

5. run chrome
$google-chrome

Read Full Post »

1. Galaxy cannot start with the follow error:
socket.error: [Errno 98] Address already in use
This error suggests something else is running on port 8080. You can either edit universe_wsgi.ini and changing port to something else. E.g.:

# The port on which to listen.
port = 8888

or you can kill the processes running on port 8080
Image
The command lsof -i tcp:8080 show all open TCP connections on port 8080
(refer to http://alexander.holbreich.org/2010/11/lsof/ for more lsof command examples)

Kill those processes and restart Galaxy.

Read Full Post »

The EC2 cloud versions of Galaxy are missing some index data files. For example Fetch taxonomic representation under Metagenomic analyses runs into the following error:

Image

The problem is that the required index data do not come with Galaxy because the data sets are very large, but Galaxy provides the script to generate the required data.

Here is the solution:
Go to /mnt/galaxyTools/galaxy-central/scripts/taxonomy
Copy processTaxonomy.sh to /mnt/galaxyIndices/AdditionalData/taxonomy (create the directory if it does not exist) since the output of running this script will take 4.4G disk space, and there is no enough disk space in the /mnt/galaxyTools directory
Run processTaxonomy.sh, which will generate the file gi_taxid_sorted.txt and some other files.
sh processTaxonomy.sh
Link those files to the directory /mnt/galaxyTools/galaxy-central/tool-data/taxonomy:
mkdir /mnt/galaxyTools/galaxy-central/tool-data/taxonomy
ls|awk ‘{print “ln -s /mnt/galaxyIndices/AdditionalData/taxonomy/”$1” /mnt/galaxyTools/galaxy-central/tool-data/taxonomy/”$1}’|sh

Read Full Post »

There is a file gi_taxid_sorted.txt in the current work directory,

$ pwd
/mnt/galaxyIndices/AdditionalData
$ ll
total 4511668
-rw-r–r– 1 galaxy galaxy 4619943478 2012-04-03 15:59 gi_taxid_sorted.txt

and if you want to link it to /otherPath/gi_taxid_sorted.txt
The following command line will not work:
$ ln -s gi_taxid_sorted.txt /otherPath/gi_taxid_sorted.txt
$ more /otherPath/gi_taxid_sorted.txt
/otherPath/gi_taxid_sorted.txt: Too many levels of symbolic links

The problem is that viewing this file /otherPath/gi_taxid_sorted.txt will take you to the file gi_taxid_sorted.txt in the directory /otherPath, e.g, the file itself, not the one in your current working directory, thus forming an infinite loop. You have to use the full path of the file you want to link to:
$ ln -s /mnt/galaxyIndices/AdditionalData/gi_taxid_sorted.txt /otherPath/gi_taxid_sorted.txt

Read Full Post »