<commit_before>#!/bin/bash 
set -e

if [ -z "$1" ]; then
    echo usage: $0 MAC_NAME;
    exit;
fi
MAC_NAME="$1"

if [ -z "$SECM_DB_SECRET" ]; then
    echo need to set SECM_DB_SECRET;
    exit;
fi

if [ -z "$OS_USERNAME" ]; then
    echo need to set OS_USERNAME with rackspace username;
    exit;
fi

if [ -z "$OS_API_KEY" ]; then
    echo need to set OS_API_KEY  with rackspace API_KEY;
    exit;
fi

if [ -z "$OS_REGION_NAME" ]; then
    echo need to set OS_REGION_NAME with rackspace REGION_NAME;
    exit;
fi


# flavor  can be found at http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/server-flavors.html
docker-machine create --driver rackspace --rackspace-flavor-id 2 "$MAC_NAME"

# TODO - remove public port 
docker `docker-machine config $MAC_NAME` run -p 5432:5432 --name my-postgres -e POSTGRES_PASSWORD=$SECM_DB_SECRET -d postgres 

echo
echo Machine IP is `docker-machine ip $MAC_NAME`
echo Remember to delete server at https://mycloud.rackspace.com





<commit_msg>update machine creation to add ks<commit_after>#!/bin/bash 
set -e

if [ -z "$1" ]; then
    echo usage: $0 MAC_NAME;
    exit;
fi
MAC_NAME="$1"

if [ -z "$SECM_DB_SECRET" ]; then
    echo need to set SECM_DB_SECRET;
    exit;
fi

if [ -z "$OS_USERNAME" ]; then
    echo need to set OS_USERNAME with rackspace username;
    exit;
fi

if [ -z "$OS_API_KEY" ]; then
    echo need to set OS_API_KEY  with rackspace API_KEY;
    exit;
fi

if [ -z "$OS_REGION_NAME" ]; then
    echo need to set OS_REGION_NAME with rackspace REGION_NAME;
    exit;
fi


# flavor  can be found at http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/server-flavors.html
docker-machine create --driver rackspace --rackspace-flavor-id 2 "$MAC_NAME"

# TODO - remove public port 
docker `docker-machine config $MAC_NAME` run -p 5432:5432 --name my-postgres -e POSTGRES_PASSWORD=$SECM_DB_SECRET -d postgres 

docker-machine ssh $MAC_NAME git clone https://github.com/fluffy/secm.git
docker-machine ssh $MAC_NAME "docker build -t fluffy/ks:v5 /root/secm/ks"

docker `docker-machine config $MAC_NAME` run -p 8080:8080  --name="my-ks" --link my-postgres:db -d fluffy/ks:v5

echo
echo Machine IP is `docker-machine ip $MAC_NAME`
echo Remember to delete server at https://mycloud.rackspace.com






{'fraction_non_alphanumeric': 0.11237928007023705, 'fraction_numerical': 0.016681299385425813, 'mean_word_length': 3.4686274509803923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '5653082', 'n_tokens_mistral': 895, 'n_tokens_neox': 839, 'n_words': 255}