<commit_before>Spring Cloud Data Flow Admin for Cloud Foundry
----------------------------------------------
<commit_msg>Moved README instructions from main README<commit_after>= Spring Cloud Data Flow Admin for Cloud Foundry

Spring Cloud Data Flow can be used to deploy modules in a Cloud Foundry environment. When doing so, the
https://github.com/spring-cloud/spring-cloud-dataflow/tree/master/spring-cloud-dataflow-admin-starter[Admin]
application can either run itself on Cloud Foundry, or on another installation (e.g. a simple laptop).

The required configuration amounts to the same in either case, and is merely related to providing credentials to the
Cloud Foundry instance so that the admin can spawn applications itself. Any Spring Boot compatible configuration
mechanism can be used (passing program arguments, editing configuration files before building the application, using
https://github.com/spring-cloud/spring-cloud-config[Spring Cloud Config], using environment variables, etc.),
although some may prove more practicable than others when running _on_ Cloud Foundry.

1. provision a redis service instance on Cloud Foundry.
+
Use `cf marketplace` to discover which plans are available to you, depending on the details of your Cloud Foundry setup.
For example when using https://run.pivotal.io/[Pivotal Web Services]:
+
```
cf create-service rediscloud 30mb redis
```

2. build packages (you'll need redis running locally for the included tests to run)
+
```
$ mvn clean package
```

3. Either
	a. push the admin application on Cloud Foundry, configure it (see below) and start it
+
NOTE: You must use a unique name for your app; an app with the same name in the same organization will cause your
deployment to fail
+
```
cf push s-c-dataflow-admin --no-start -p spring-cloud-dataflow-admin-cloudfoundry/target/spring-cloud-dataflow-admin-cloudfoundry-1.0.0.BUILD-SNAPSHOT.jar
cf bind-service s-c-dataflow-admin redis
```
+
Now we can configure the app. This configuration is for Pivotal Web Services. You need to fill in {org}, {space},
{email} and {password} before running these commands.
+
NOTE: Only set 'Skip SSL Validation' to true if you're running on a Cloud Foundry instance using self-signed certs
(e.g. in development). Do not use for production.
+
```
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_API_ENDPOINT https://api.run.pivotal.io
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_ORGANIZATION {org}
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_SPACE {space}
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_DOMAIN cfapps.io
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_SERVICES redis
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_USERNAME {email}
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_PASSWORD {password}
cf set-env s-c-dataflow-admin CLOUDFOUNDRY_SKIP_SSL_VALIDATION false
```
+
We are now ready to start the app.
+
```
cf start s-c-dataflow-admin
```
+
Alternatively,
+
	b. run the admin application locally, targeting your Cloud Foundry installation (see below for configuration)
+
```
java -jar spring-cloud-dataflow-admin-cloudfoundry/target/spring-cloud-dataflow-admin-cloudfoundry-1.0.0.BUILD-SNAPSHOT.jar [--option1=value1] [--option2=value2] [etc.]
```
+
4. run the shell and optionally target the Admin application if it's not running on the same host
(will typically be the case if deployed on Cloud Foundry as **3i.**)
+
```
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-1.0.0.BUILD-SNAPSHOT.jar
```
+
```
server-unknown:>admin config server http://s-c-dataflow-admin.cfapps.io
Successfully targeted http://s-c-dataflow-admin.cfapps.io
dataflow:>
```

At step **3ii.** the following pieces of configuration must be provided, e.g. by setting the local environment, or
passing variables on the Java invocation:

```
# Default values cited after the equal sign.
# Example values, typical for Pivotal Web Services, cited as a comment

# url of the CF API (used when using cf login -a for example), e.g. https://api.run.pivotal.io
# (for setting env var use CLOUDFOUNDRY_API_ENDPOINT)
cloudfoundry.apiEndpoint=

# name of the organization that owns the space above, e.g. youruser-org
# (for setting env var use CLOUDFOUNDRY_ORGANIZATION)
cloudfoundry.organization=

# name of the space into which modules will be deployed
# (for setting env var use CLOUDFOUNDRY_SPACE)
cloudfoundry.space=<same space as admin when running on CF, or 'development'>

# the root domain to use when mapping routes, e.g. cfapps.io
# (for setting env var use CLOUDFOUNDRY_DOMAIN)
cloudfoundry.domain=

# Comma separated set of service instance names to bind to the module.
# Amongst other things, this should include a service that will be used
# for Spring Cloud Stream binding
# (for setting env var use CLOUDFOUNDRY_SERVICES)
cloudfoundry.services=redis

# username and password of the user to use to create apps (modules)
# (for setting env var use CLOUDFOUNDRY_USERNAME and CLOUDFOUNDRY_PASSWORD)
cloudfoundry.username=
cloudfoundry.password=

# Whether to allow self-signed certificates during SSL validation
# (for setting env var use CLOUDFOUNDRY_SKIP_SSL_VALIDATION)
cloudfoundry.skipSslValidation=false
```

{'fraction_non_alphanumeric': 0.09180900621118013, 'fraction_numerical': 0.004076086956521739, 'mean_word_length': 4.570810810810811, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 5, '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': '1586406', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1525, 'n_words': 605}