In [ ]:
import os
import sys
sys.path.append(os.getcwd().replace("notebooks/awsCluster", "src/awsCluster"))
## Input the AWS account access keys
aws_access_key_id = "/**aws_access_key_id**/"
aws_secret_access_key = "/**aws_secret_access_key**/"
## CFNCluster name
your_cluster_name = "cluster_name"
## The private key pair for accessing cluster.
private_key = "/path/to/aws_priate_key.pem"
## If delete cfncluster after job is done.
delete_cfncluster = False
In [ ]:
from cfnCluster import CFNClusterManager
CFNClusterManager.install_cfn_cluster()
In [ ]:
from cfnCluster import CFNClusterManager
CFNClusterManager.upgrade_cfn_cluster()
In [ ]:
from cfnCluster import CFNClusterManager
## Configure cfncluster settings
CFNClusterManager.insert_access_keys(aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
CFNClusterManager.config_key_name(private_key)
CFNClusterManager.config_instance_types(master_instance_type="m3.large", compute_instance_type="m4.xlarge")
CFNClusterManager.config_initial_cluster_size(initial_cluster_size="0")
CFNClusterManager.config_spot_price(spot_price="0.7")
CFNClusterManager.config_volume_size(volume_size="300")
CFNClusterManager.config_ebs_snapshot_id(ebs_snapshot_id="snap-058a7554")
CFNClusterManager.config_aws_region_name(aws_region_name="us-west-2")
CFNClusterManager.config_post_install(post_install="s3://path/to/postinstall.sh")
CFNClusterManager.config_vpc_subnet_id(master_subnet_id="subnet-00000000", vpc_id="vpc-00000000")
CFNClusterManager.config_s3_resource(s3_read_resource="s3://bucket_name/", s3_read_write_resource="s3://bucket_name/")
In [ ]:
CFNClusterManager.view_cfncluster_config()
In [ ]:
CFNClusterManager.list_cfn_cluster()
In [ ]:
master_ip_address = CFNClusterManager.create_cfn_cluster(cluster_name=your_cluster_name)
In [ ]:
from cfnCluster import ConnectionManager
ssh_client = ConnectionManager.connect_master(hostname=master_ip_address,
username="ec2-user",
private_key_file=private_key)
The GATK official website: https://software.broadinstitute.org/gatk/download/
In [ ]:
from cfnCluster import ConnectionManager
ConnectionManager.copy_gatk(ssh_client, "/path/to/local/GenomeAnalysisTK.jar")
In [ ]:
ConnectionManager.close_connection(ssh_client)
In [ ]:
from cfnCluster import CFNClusterManager
if delete_cfncluster == True:
CFNClusterManager.delete_cfn_cluster(cluster_name=your_cluster_name)
In [ ]: