Customizing your Galaxy CloudMan Deployment
It is possible to use the infrastructure composition component of Galaxy CloudMan but customize the Galaxy instance running on your cloud cluster as well as use your own set of tools. Note that this process is not automated but requires use of the command line tools. In order to modify your cloud deployment, these are the general steps that need to be performed:
- Start a Galaxy CloudMan cluster instance
- ssh to the EC2 instance and update Galaxy, Galaxy configuration and/or tools
- Create new snapshots the modified EBS volume(s)
- Repair the cluster, then terminate it
- Update cluster configuration in S3 to point to the new snapshots
Follow directions on this page to start a new cloud cluster instance. Using the CloudMan web interface, create a 'Galaxy' cluster and wait for it to complete initialization to the point where Galaxy application is running.
From the command prompt, connect to the newly created cluster using the following command, filling in the appropriate details:
1 ssh -o StrictHostKeyChecking=no -i <path to your private key> ubuntu@<instance public DNS>
Next, navigate to the Galaxy installation directory and stop Galaxy (note that all of the Galaxy-related modifications should be performed as 'galaxy' system user:
Now, manipulate Galaxy as desired. If you wish to also make changes to the available tools, all of the tools that Galaxy uses are installed in /mnt/galaxyTools/tools/. Please note and respect the structure of the directories for the tools when adding/modifying tools. Lastly, all of the available genomes are located in /mnt/galaxyIndices/genomes/, if modifications to those are desired as well.
After you have completed all of the desired modifications, as 'ubuntu' user, remove the file system where Galaxy is installed from NFS and unmount it:
Next, from the AWS console, detach the EBS volume where Galaxy is installed. You can discover which EBS volume to detach by looking at the CloudMan log located in /mnt/cm/paster.log and searching for a line similar to this one: Successfully mounted file system '/mnt/galaxyTools' from '/dev/sdg2'. Once the volume is detached, from the AWS console, create a snapshot of the volume. Note the newly created snapshot ID and the snapshot size, which will be needed in Step 5.
Note that if you modified available genomes in /mnt/galaxyIndices/genomes/, you will need to unmount that file system as well (umount /mnt/galaxyIndices/), detach the corresponding EBS volume, and create a snapshot of it as well.
In order to ensure a clean cluster shutdown, it is necessary to patch everything that was broken during the update. So, first, from the AWS console, reattach the original EBS volume to the instance using the same device ID (e.g., /dev/sdg2 in the above example), mount the device as the corresponding file system:
1 ubuntu@<ip>$ sudo mount /dev/sdg2 /mnt/galaxyTools
Lastly, as 'galaxy' system user, start Galaxy:
Back on the CloudMan web interface, once Galaxy is running again, click 'Terminate cluster'. Also, from the cluster log on that same page, note down the name of the cluster's bucket. It will be something like cm-ca8d43f924f3ba1x5b63dabcdcd524ec.
Once the cluster has terminated (including the master instance), in the AWS console, click on the S3 tab. Find the desired cluster's bucket (as noted in Step 4) and download file persistent_data.yaml. Edit this file under - filesystem: galaxyTools:// replace the snap_id with the snapshot ID you got in Step 3. Also, if you happened to have changed the size of the filesystem in Step 3 (and thus the size of the snapshot), reflect that change in this file as well. If you changed any of the genomes and thus the galaxyIndices file system, and created a new snapshot, modify that snapshot ID as well. Save the file and replace the one in your cluster's bucket with the new version.
If you made any modifications to the Galaxy tool configuration file tool_conf.xml or the universe_wsgi.ini file, you should modify those files in the cluster's bucket as well so the changes will take effect at next cluster instantiation. When uploading those files, append .cloud file extension before saving them to the bucket (i.e., tool_conf.xml.cloud and universe_wsgi.ini.cloud).
That is it. Instantiate the cluster as you normally would (i.e., using the same user data) and your customizations will be preserved for the given cluster.