<commit_before>
#!/usr/bin/python
# example strider file

from strider import Strider
from strider.virt.ec2 import EC2
from strider.provisioners.ansible_ssh import AnsibleSSH
import os

print os.environ["AWS_ACCESS_KEY"]
print os.environ["AWS_SECRET_KEY"]

my_instance = EC2(
    name                   = "strider-test-3",
    region                 = "us-east-1",
    access_key_id          = os.environ["AWS_ACCESS_KEY"],
    secret_access_key      = os.environ["AWS_SECRET_KEY"],
    session_token          = os.environ.get("AWS_SESSION_TOKEN"), # FIXME: IMPLEMENT
    user_data              = None,
    image_id               = "ami-a7e145cc", # Ubuntu 14.04 us-east1 EBS
    instance_type          = "m3.medium",
    key_name               = os.environ["AWS_KEYPAIR"],
    security_groups        = [ os.environ["AWS_SECURITY_GROUP"] ],
    ssh = dict(
      public_ip        = True,
      username         = "ubuntu",
      private_key_path =  os.environ.get("AWS_PEM_FILE")
    )
)

# TODO: this is really just a shell provisioner, I plan to make this simpler and more generic.
# and AnsibleSSH should be able to inherit from it.

provisioner = AnsibleSSH(
    copy_from       = "./examples/ansible",
    copy_to         = "/home/ubuntu/deploy_root/",
    prep_cmds       = [
        # TODO: only do this if not recently updated
        "sudo apt-get update",
        # TODO: only do this if not installed
        "sudo apt-get install ansible",
    ],
    playbook_cmd    = "sudo ansible-playbook -i 'localhost,' -c local /home/ubuntu/deploy_root/ansible/test.yml"
)

instances = [ my_instance ]
strider = Strider(provisioner=provisioner)

# EITHER OF THESE ARE IMPLEMENTED!
#strider.up(instances)
strider.provision(instances)

# TODO:
#strider.list(instances)
#strider.destroy(instances)

#strider.cli()
<commit_msg>Run "up" by default for new users versus just provisioner.<commit_after>
#!/usr/bin/python
# example strider file

from strider import Strider
from strider.virt.ec2 import EC2
from strider.provisioners.ansible_ssh import AnsibleSSH
import os

print os.environ["AWS_ACCESS_KEY"]
print os.environ["AWS_SECRET_KEY"]

my_instance = EC2(
    name                   = "strider-test-3",
    region                 = "us-east-1",
    access_key_id          = os.environ["AWS_ACCESS_KEY"],
    secret_access_key      = os.environ["AWS_SECRET_KEY"],
    session_token          = os.environ.get("AWS_SESSION_TOKEN"), # FIXME: IMPLEMENT
    user_data              = None,
    image_id               = "ami-a7e145cc", # Ubuntu 14.04 us-east1 EBS
    instance_type          = "m3.medium",
    key_name               = os.environ["AWS_KEYPAIR"],
    security_groups        = [ os.environ["AWS_SECURITY_GROUP"] ],
    ssh = dict(
      public_ip        = True,
      username         = "ubuntu",
      private_key_path =  os.environ.get("AWS_PEM_FILE")
    )
)

# TODO: this is really just a shell provisioner, I plan to make this simpler and more generic.
# and AnsibleSSH should be able to inherit from it.

provisioner = AnsibleSSH(
    copy_from       = "./examples/ansible",
    copy_to         = "/home/ubuntu/deploy_root/",
    prep_cmds       = [
        # TODO: only do this if not recently updated
        "sudo apt-get update",
        # TODO: only do this if not installed
        "sudo apt-get install ansible",
    ],
    playbook_cmd    = "sudo ansible-playbook -i 'localhost,' -c local /home/ubuntu/deploy_root/ansible/test.yml"
)

instances = [ my_instance ]
strider = Strider(provisioner=provisioner)

# EITHER OF THESE ARE IMPLEMENTED!
strider.up(instances)
# strider.provision(instances)

# TODO:
#strider.list(instances)
#strider.destroy(instances)

#strider.cli()

{'fraction_non_alphanumeric': 0.10584731997834326, 'fraction_numerical': 0.008121277747698972, 'mean_word_length': 2.601364522417154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2421912', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1240, 'n_words': 283}