<commit_before># airpal

* [Requirements](#requirements)
* [Launching](#steps-to-launch)
* [Presto Compatibility Chart](#compatibility-chart)

## Requirements

* Java 7 or higher
* MySQL database
* [Presto](http://prestodb.io) 0.77 or higher
* S3 bucket (to store CSVs)
* Gradle 2.2 or higher


## Steps to launch

*Note* that below, we'll be using a less verbose syntax to execute Airpal. This assumes
that all of the configuration settings are specified in your `.yml` configuration file,
and that it's called `reference.yml`.
If modifying `reference.yml` is undesirable, or you want to override certain settings on the command line,
you can easily specify them in [the traditional Dropwizard fashion](https://dropwizard.github.io/dropwizard/manual/core.html#configuration) like so:

```
java -Ddw.prestoCoordinator=http://presto-coordinator-url.com \
     -Ddw.s3AccessKey=$ACCESS_KEY \
     -Ddw.s3SecretKey=$SECRET_KEY \
     -Ddw.s3Bucket=airpal \
     -Ddw.metaStoreConfiguration.connectionUrl=jdbc:mysql://$METASTORE_HOST:3306/metastore \
     -Ddw.metaStoreConfiguration.password=$<PASSWORD> \
     -Ddw.metaStoreConfiguration.userName=$METASTORE_USER \
     -Ddw.dataSourceFactory.url=jdbc:mysql://127.0.0.1:3306/airpal \
     -Ddw.dataSourceFactory.user=airpal \
     -Ddw.dataSourceFactory.password=$<PASSWORD> \
     -Duser.timezone=UTC \
     -cp target/airpal-*.jar db migrate reference.yml
```

1. Build Airpal

    We'll be using [Gradle](https://www.gradle.org/) to build the back-end Java code,
    and [browserify](http://browserify.org/) (via [Node.js](http://nodejs.org/)) to build
    the front-end Javascript code.

    If you have `node` and `npm` installed locally, and wish to use
    them, simply run:

    ```
    ./gradlew clean shadowJar -Dairpal.useLocalNode
    ```

    Otherwise, `node` and `npm` will be automatically downloaded for you
    by running:

    ```
    ./gradlew clean shadowJar
    ```

2. Create a MySQL database for airpal. We recommend you call it `airpal` and will assume that for future steps.

3. Migrate your database

    ```
    java -Duser.timezone=UTC \
         -cp target/airpal-*.jar db migrate reference.yml
    ```

4. Run Airpal

    ```
    java -server \
         -Duser.timezone=UTC \
         -cp target/airpal-*.jar server reference.yml<commit_msg>[docs] Update README<commit_after># airpal

* [Requirements](#requirements)
* [Launching](#steps-to-launch)
* [Presto Compatibility Chart](#compatibility-chart)

## Requirements

* Java 7 or higher
* MySQL database
* [Presto](http://prestodb.io) 0.77 or higher
* S3 bucket (to store CSVs)
* Gradle 2.2 or higher


## Steps to launch

*Note* that below, we'll be using a less verbose syntax to execute Airpal. This assumes
that all of the configuration settings are specified in your `.yml` configuration file,
and that it's called `reference.yml`.
If modifying `reference.yml` is undesirable, or you want to override certain settings on the command line,
you can easily specify them in [the traditional Dropwizard fashion](https://dropwizard.github.io/dropwizard/manual/core.html#configuration) like so:

```
java -Ddw.prestoCoordinator=http://presto-coordinator-url.com \
     -Ddw.s3AccessKey=$ACCESS_KEY \
     -Ddw.s3SecretKey=$SECRET_KEY \
     -Ddw.s3Bucket=airpal \
     -Ddw.metaStoreConfiguration.connectionUrl=jdbc:mysql://$METASTORE_HOST:3306/metastore \
     -Ddw.metaStoreConfiguration.password=$<PASSWORD>_PASSWORD \
     -Ddw.metaStoreConfiguration.userName=$METASTORE_USER \
     -Ddw.dataSourceFactory.url=jdbc:mysql://12172.16.17.32:3306/airpal \
     -Ddw.dataSourceFactory.user=airpal \
     -Ddw.dataSourceFactory.password=$<PASSWORD> \
     -Duser.timezone=UTC \
     -cp build/libs/airpal-*-all.jar db migrate reference.yml
```

1. Build Airpal

    We'll be using [Gradle](https://www.gradle.org/) to build the back-end Java code,
    and [browserify](http://browserify.org/) (via [Node.js](http://nodejs.org/)) to build
    the front-end Javascript code.

    If you have `node` and `npm` installed locally, and wish to use
    them, simply run:

    ```
    ./gradlew clean shadowJar -Dairpal.useLocalNode
    ```

    Otherwise, `node` and `npm` will be automatically downloaded for you
    by running:

    ```
    ./gradlew clean shadowJar
    ```

2. Create a MySQL database for airpal. We recommend you call it `airpal` and will assume that for future steps.

3. Migrate your database

    ```
    java -Duser.timezone=UTC \
         -cp build/libs/airpal-*-all.jar db migrate reference.yml
    ```

4. Run Airpal

    ```
    java -server \
         -Duser.timezone=UTC \
         -cp build/libs/airpal-*-all.jar server reference.yml
{'fraction_non_alphanumeric': 0.1208110992529349, 'fraction_numerical': 0.013020277481323372, 'mean_word_length': 3.3348751156336727, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5945711', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1480, 'n_words': 413}