<commit_before># Setting up ION-Roller service and ION-Roller CLI

Install ION-Roller CLI

```bash
curl -s https://s3.amazonaws.com/ionroller-cli/install | sh
```

Test that ION-Roller CLI works properly:

```bash
ionroller 
```
should display the list of available commands, i.e.

```bash
ionroller 
v0.0.124

Usage: ionroller COMMAND [--base BASE_URL]

Available options:
  -h,--help                Show this help text
  COMMAND                  Command to run
  --base BASE_URL          Base URL for ionroller service

Available commands:
  release                  Release version: ionroller release SERVICE VERSION [-c|--conf
                           ISO_8601_DATE]
  drop                     Drop version: ionroller drop SERVICE VERSION [-c|--conf
                           ISO_8601_DATE] [--force]
  events                   Show events for service: ionroller events SERVICE [VERSION]
                           [-f|--from ISO_8601_DATE] [-t|--to ISO_8601_DATE]
  config                   Get configuration: ionroller config SERVICE [-t,--timestamp
                           ISO_8601_DATE]
  set_config               Set configuration: ionroller set_config SERVICE [FILE]
  delete_config            Delete configuration: ionroller delete_config SERVICE
  configs                  Get configuration history timestamps: ionroller configs
                           SERVICE [-f|--from ISO_8601_DATE] [-t|--to ISO_8601_DATE]
  current                  Get current version: ionroller current SERVICE
  update                   Update ionroller CLI
  setup                    Setup ionroller service
  version                  ionroller version
  set_base_url             Set ionroller base URL
  set_client_update_url    Set ionroller CLI update URL
```
Deploy ION-Roller with ION-Roller CLI (so meta... ;-) ). 

First create the configuration for your ION-Roller service.

Fill all required values in the configuration template below and save it as ionroller-config.json.

**Configuration template for ION-Roller service**:

```json
{
   "url":"ionroller.<YOUR_DOMAIN>", 
   "hosted_zone_id":"<HOSTED_ZONE_ID>",
   "aws_account_id":"<AWS_ACCOUNT_ID>",
   "service_role":"ionroller",
   "image":"giltouroboros/ionroller",
   "port_mappings":[
      {
         "internal":9000,
         "external":9000
      }
   ],
   "volume_mappings":[],
   "run_args":[
        "-Dpidfile.path=/dev/null",
        "-Dionroller.modify-environments-whitelist=ALL",
        "-Dionroller.modify-environments-blacklist=ionroller"],
   "eb":{
      "deployment_bucket":"<DEPLOYMENT_BUCKET>",
      "settings":[
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"VPCId",
            "Value":"<VPC_ID>"
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"Subnets",
            "Value":"<SUBNET_ID>"
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"ELBSubnets",
            "Value":"<SUBNET_ID>"
         },
         {
            "Namespace":"aws:autoscaling:launchconfiguration",
            "OptionName":"SecurityGroups",
            "Value":"<SECURITY_GROUP_ID>"
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"AssociatePublicIpAddress",
            "Value":"true"
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"ELBScheme",
            "Value":"internal"
         },
         {
            "Namespace":"aws:elb:loadbalancer",
            "OptionName":"CrossZone",
            "Value":"true"
         },
         {
            "Namespace":"aws:autoscaling:launchconfiguration",
            "OptionName":"InstanceType",
            "Value":"t2.micro"
         },
         {
            "Namespace":"aws:autoscaling:asg",
            "OptionName":"MinSize",
            "Value":"1"
         },
         {
            "Namespace":"aws:autoscaling:asg",
            "OptionName":"MaxSize",
            "Value":"1"
         },
         {
            "Namespace":"aws:autoscaling:launchconfiguration",
            "OptionName":"EC2KeyName",
            "Value":"<KEYNAME>"
          }
      ],
      "remove_unused_after_minutes":0
   }
```
<commit_msg>Update serviceSetup.md<commit_after># Setting up ION-Roller service and ION-Roller CLI

Install ION-Roller CLI

```bash
curl -s https://s3.amazonaws.com/ionroller-cli/install | sh
```

Test that ION-Roller CLI works properly:

```bash
ionroller 
```
should display the list of available commands, i.e.

```bash
ionroller 
v0.0.124

Usage: ionroller COMMAND [--base BASE_URL]

Available options:
  -h,--help                Show this help text
  COMMAND                  Command to run
  --base BASE_URL          Base URL for ionroller service

Available commands:
  release                  Release version: ionroller release SERVICE VERSION [-c|--conf
                           ISO_8601_DATE]
  drop                     Drop version: ionroller drop SERVICE VERSION [-c|--conf
                           ISO_8601_DATE] [--force]
  events                   Show events for service: ionroller events SERVICE [VERSION]
                           [-f|--from ISO_8601_DATE] [-t|--to ISO_8601_DATE]
  config                   Get configuration: ionroller config SERVICE [-t,--timestamp
                           ISO_8601_DATE]
  set_config               Set configuration: ionroller set_config SERVICE [FILE]
  delete_config            Delete configuration: ionroller delete_config SERVICE
  configs                  Get configuration history timestamps: ionroller configs
                           SERVICE [-f|--from ISO_8601_DATE] [-t|--to ISO_8601_DATE]
  current                  Get current version: ionroller current SERVICE
  update                   Update ionroller CLI
  setup                    Setup ionroller service
  version                  ionroller version
  set_base_url             Set ionroller base URL
  set_client_update_url    Set ionroller CLI update URL
```
Deploy ION-Roller with ION-Roller CLI (so meta... ;-) ). 

First create the configuration for your ION-Roller service.

Fill all required values in the configuration template below and save it as ionroller-config.json.

**Configuration template for ION-Roller service**:

<table cellpadding="10">
    <tr>
        <td>
       <pre><code>{
   "url":<a href ="gettingStarted.md#decide-on-the-domain-for-your-services">"ionroller.&lt;YOUR_DOMAIN&gt;"</a>, 
   "hosted_zone_id":<a href ="gettingStarted.md#decide-on-the-domain-for-your-service">"&lt;HOSTED_ZONE_ID&gt;"</a>,
   "aws_account_id":<a href ="gettingStarted.md#prepare-aws-account">"&lt;AWS_ACCOUNT_ID&gt;"</a>,
   "service_role":"ionroller",
   "image":"giltouroboros/ionroller",
   "port_mappings":[
      {
         "internal":9000,
         "external":9000
      }
   ],
   "run_args":[
        "-Dpidfile.path=/dev/null",
        "-Dionroller.modify-environments-whitelist=ALL",
        "-Dionroller.modify-environments-blacklist=ionroller"
   ],
   "eb":{
      "deployment_bucket":<a href ="gettingStarted.md#create-s3-deployment-bucket">"&lt;DEPLOYMENT_BUCKET&gt;"</a>,
      <a href ="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html">"settings"</a>:[
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"VPCId",
            "Value":<a href ="gettingStarted.md#minimum-viable-aws-knowledge">"&lt;VPC_ID&gt;"</a>
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"Subnets",
            "Value":<a href ="gettingStarted.md#minimum-viable-aws-knowledge">"&lt;SUBNET_ID&gt;"</a>
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"ELBSubnets",
            "Value":<a href ="gettingStarted.md#minimum-viable-aws-knowledge">"&lt;SUBNET_ID&gt;"</a>
         },
         {
            "Namespace":"aws:autoscaling:launchconfiguration",
            "OptionName":"SecurityGroups",
            "Value":<a href ="gettingStarted.md#minimum-viable-aws-knowledge">"&lt;SECURITY_GROUP_ID&gt;"</a>
         },
         {
            "Namespace":"aws:ec2:vpc",
            "OptionName":"AssociatePublicIpAddress",
            "Value":"true"
         },
         {
            "Namespace":"aws:elb:loadbalancer",
            "OptionName":"CrossZone",
            "Value":"true"
         },
         {
            "Namespace":"aws:autoscaling:launchconfiguration",
            "OptionName":"InstanceType",
            "Value":<a href="https://aws.amazon.com/ec2/instance-types/">"t2.micro"</a>
         },
         {
            "Namespace":"aws:autoscaling:asg",
            "OptionName":"MaxSize",
            "Value":"1"
         },
         {
            "Namespace":"aws:autoscaling:launchconfiguration",
            "OptionName":"EC2KeyName",
            "Value":<a href ="gettingStarted.md#create-ssh-keys-to-enable-logging-in-to-the-amazon-ec2-instances">"&lt;KEYNAME&gt;"</a>
          }
      ],
      "remove_unused_after_minutes":0
   }</code></pre>
        </td>
        <td valign="top">
<i>Notes</i>
<br/><br/>
<b>url</b>: Unique endpoint for each service hosted_zone_id: Unique for each AWS account!
<br/><br/>
<b>run_args</b>: run arguments for service.<br/><code>pidfile.path=/dev/null</code><br/>is required for restarting Play apps withing Docker container.
<br/><br/>
<b>subnets</b>: There should be a Subnet for each ELBSubnet, with matching availability zones (in the standard cases, the value of Subnets equals that of ELBSubnets)
<br/><br/>
<b>ELBScheme</b>: private - only connectable from internal VPCs; internal - only connectable from a trusted IP, i.e. VPN, offices etc.; public - the world. Default: internal
<br/><br/>
<b>CrossZone</b>: Allow ELBs to send traffic to other availability zones
<br/><br/>
<b>InstanceType</b>: optional; default t2.small
<br/><br/>
<b>MaxSize</b>: must be set to 1 for ionroller
<br/><br/>
<b>EC2KeyName</b>: optional; enables ssh to your instance
<br/><br/>
<b>remove_unused_after_minutes</b>: set to 0 for ionroller service
        </td>
    </tr>
</table>

{'fraction_non_alphanumeric': 0.1313702161411858, 'fraction_numerical': 0.011005353955978583, 'mean_word_length': 2.182018927444795, 'pattern_counts': {'":': 86, '<': 88, '<?xml version=': 0, '>': 88, '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': '4185700', 'n_tokens_mistral': 3176, 'n_tokens_neox': 2983, 'n_words': 623}