<commit_before># Cloud Foundry v2 installer with Nise BOSH (+ Vagrant)

## Links

* [cf-vagrant-installer](https://github.com/Altoros/cf-vagrant-installer)
 * Another Chef-based vagrant project

## Install Cloud Foundry v2

### On local machine

#### Requirements

* Ubuntu 10.04 64bit

#### Full-automatic install

```sh
sudo apt-get install curl
bash < <(curl -s -k -B https://raw.github.com/yudai/cf_nise_installer/master/scripts/bootstrap.sh)
```

#### Customized install

TODO

#### Process management

Use Monit which installed by Nise BOSH.

```sh
# Start Monit
sudo /var/vcap/bosh/bin/monit
# Launch `all` processes
sudo /var/vcap/bosh/bin/monit start all
# See status
sudo /var/vcap/bosh/bin/monit status
sudo /var/vcap/bosh/bin/monit summary # shorter
# Stop `all` processes
sudo /var/vcap/bosh/bin/monit stop all
```

### With Vagrant

You can create a devbox vagrant VM with [nise-bosh-vagrant](https://github.com/BrianMMcClain/nise-bosh-vagrant).

#### Requirements

* Vagrant 1.2 or later
* Ruby 1.9.3-p392 (Required by cf-release)

#### Install

```sh
# Install required gems, add `sudo` if needed
gem install bosh_cli bundler nise-bosh-vagrant
rbenv rehash # for rbenv users

# Clone this repository
git clone https://github.com/yudai/cf_nise_installer.git

# Clone the latest cf-release and create a release
# You can also use your customized cf-release if needed
./cf_nise_installer/scripts/clone_cf_release.sh

# Run
nise-bosh-vagrant ./cf-release --manifest ./cf_nise_installer/manifests/micro.yml --postinstall ./cf_nise_installer/scripts/postinstall.sh --memory 4096 --start
```

## Play with Cloud Foundry v2

| Target URI     | api.\<IP Address\>.xip.io | api.192.168.10.10.xip.io |
| :------------: | :-----------------------: | :----------------------: |
| Admin User     | <EMAIL>             | <-                       |
| Admin Password | <PASSWORD>               | <-                       |

### Service token registration

To create services, register tokens to UAA.

```sh
# login as an admin in advance
gem install admin-cf-plugin
cf create-service-auth-token --provider core --token token --label postgresql
cf create-service-auth-token --provider core --token token --label mysql
```
<commit_msg>Add minimum requirements<commit_after># Cloud Foundry v2 installer with Nise BOSH (+ Vagrant)

## Links

* [cf-vagrant-installer](https://github.com/Altoros/cf-vagrant-installer)
 * Another Chef-based vagrant project

## Install Cloud Foundry v2

### On local machine

#### Requirements

* Ubuntu 10.04 64bit
* 8GB+ free HDD space
* 4Gb+ memory
   * m1.large or larger instance is recommended on AWS

#### Full-automatic install

```sh
sudo apt-get install curl
bash < <(curl -s -k -B https://raw.github.com/yudai/cf_nise_installer/master/scripts/bootstrap.sh)
```

#### Customized install

TODO

#### Process management

Use Monit which installed by Nise BOSH.

```sh
# Start Monit
sudo /var/vcap/bosh/bin/monit
# Launch `all` processes
sudo /var/vcap/bosh/bin/monit start all
# See status
sudo /var/vcap/bosh/bin/monit status
sudo /var/vcap/bosh/bin/monit summary # shorter
# Stop `all` processes
sudo /var/vcap/bosh/bin/monit stop all
```

### With Vagrant

You can create a devbox vagrant VM with [nise-bosh-vagrant](https://github.com/BrianMMcClain/nise-bosh-vagrant).

#### Requirements

* Vagrant 1.2 or later
* Ruby 1.9.3-p392 (Required by cf-release)
* 8GB+ free HDD space
* 4GB+ free memory

#### Install

```sh
# Install required gems, add `sudo` if needed
gem install bosh_cli bundler nise-bosh-vagrant
rbenv rehash # for rbenv users

# Clone this repository
git clone https://github.com/yudai/cf_nise_installer.git

# Clone the latest cf-release and create a release
# You can also use your customized cf-release if needed
./cf_nise_installer/scripts/clone_cf_release.sh

# Run
nise-bosh-vagrant ./cf-release --manifest ./cf_nise_installer/manifests/micro.yml --postinstall ./cf_nise_installer/scripts/postinstall.sh --memory 4096 --start
```

## Play with Cloud Foundry v2

| Target URI     | api.\<IP Address\>.xip.io | api.192.168.10.10.xip.io |
| :------------: | :-----------------------: | :----------------------: |
| Admin User     | <EMAIL>             | <-                       |
| Admin Password | <PASSWORD>               | <-                       |

### Service token registration

To create services, register tokens to UAA.

```sh
# login as an admin in advance
gem install admin-cf-plugin
cf create-service-auth-token --provider core --token token --label postgresql
cf create-service-auth-token --provider core --token token --label mysql
```

{'fraction_non_alphanumeric': 0.14933796396787496, 'fraction_numerical': 0.014543086607336662, 'mean_word_length': 2.975841242450388, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1282352', 'n_tokens_mistral': 1645, 'n_tokens_neox': 1520, 'n_words': 433}