<commit_before># edge-gcp
This project allows you to install edge in Google Cloud Platform using GCP's deployment manager. This uses gcp's autoscale feature to put MP blocks in autoscale group.

## Prerequisite

### gcloud
- Install gcloud sdk from https://cloud.google.com/sdk/downloads
- Initialize your account

## Apigee Private Cloud
Please go through http://docs.apigee.com/private-cloud/content/version-41705 to know more about Apigee Edge Private Cloud.

## Apigee Deployment on GCP

 - At this point of time, supported topologies are 2,5,7 and 9. For 5,7,9 node topologies, you can setup auto scaling. When set to auto scaling, Routers and MP's are configured in seperate nodes.
 - Additionally it also create Developer portal in a separate node for all supported toplogies. So for example if you choose to deploy 5 node topology, it will deploy developer portal on 6th node.
 
 - Supported Deployment Topologies

Edge Topology- 2 node
![Edge Topology- 2 node](/images/2node.png)

Edge Topology- 5 node
![Edge Topology- 5 node](/images/5node.png)

Edge Topology- 5 node with auto scaling
![Edge Topology- 5 node with auto scaling](/images/5node-auto-scaling.png)

Edge Topology- 7 node
![Edge Topology- 7 node](/images/7node.png)

Edge Topology- 7 node with auto scaling
![Edge Topology- 7 node with auto scaling](/images/7node-auto-scaling.png)

Edge Topology- 9 node
![Edge Topology- 9 node](/images/9node.png)

Edge Topology- 9 node with auto scaling
![Edge Topology- 9 node with auto scaling](/images/9node-auto-scaling.png)

GCP Resource Deployment Model for 7 node
![GCP Resource Deployment Model for 7 node](/images/resourceDeployment.png)

## Getting Started
- Create a ssh key pair 
    ```
    ssh-keygen -t rsa -b 4096 -C "apigee" -N "" -f apigee.key
    ```
    This generates a key pair file apigee.key and apigee.key.pub
    - Edit the apigee.key.pub file and prefix this with [USERNAME]: (apigee: in this case)  
    - so the public key file should like  
          ```
            apigee:sh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMQYOx.....2OA0jecyUx+3+Okp2dzhw== apigee
          ```

- Add missing fields repo->apigee->user, repo->apigee->password, repo->setup->public_key, repo->setup->private_key and license in apigee-edge.yaml. Change other entries as desired.

    | properties                             | Description                                    |
    | -------------------------------------- |:-----------------------------------------------| 
    | repo:apigee:host                       | The software repo of apigee binaries           |
    | repo:apigee:protocol                   | The software repo protocol  (http or https)    | 
    | repo:apigee:user                       | The  user id to access Apigee software         |
    | repo:apigee:password                   | The  user password to access Apigee software   |
    | repo:apigee:stage                      | The repo stage (release, e2e)                  |
    | repo:apigee:version                    | The apigee private cloud release version       |
    | infra: topology                        | This repesents the deployment topologies. Presently it comes with bundled template of 2,5,7,9 nodes. You can specify any of these values               |
    | infra:datacenters:primary:name          | Name of primary datacenter name.              |
    | infra:datacenters:primary:region.       | Datacenter region                             |
    | infra:datacenters:primary:zone          | The primary zone of datacenter                |
    | infra:datacenters:primary:vpc:cidr      | The subnet cidr                               |
    | infra:datacenters:ms:machineType.       | The machine type for management server.       |
    | infra:datacenters:ms:diskSizeGb         | The disk size associated with management server    |
    | infra:datacenters:ds:machineType.       | The machine type for datastore(Cassandra/Zookeeper) server.                                                                                        |
    | infra:datacenters:ds:diskSizeGb         | The disk size associated with for datastore(Cassandra/Zookeeper) server                                                                                |
    | infra:datacenters:rmp:machineType.      | The machine type for router/MP server.               |
    | infra:datacenters:rmp:diskSizeGb        | The disk size associated with router/MP server       |
    | infra:datacenters:rmp:autoscale.enabled | The value can be true or false                       |
    | infra:datacenters:rmp:autoscale.size    | The minimum number of mp instances. This is mandatory|
    | infra:datacenters:rmp:autoscale.maxSize | he maximum number of autoscaled instances            |
    | infra:datacenters:ax:machineType.       | The machine type for Analytics(PG & QPID) server.    |
    | infra:datacenters:ax:diskSizeGb         | The disk size associated with Analytics(PG & QPID)   |
    | infra:datacenters:portal:machineType.   | The machine type for Portal server.                  |
    | infra:datacenters:portal:diskSizeGb     | The disk size associated with portal server          |
    | setup:apigee_admin_email                | Edge system admin user                               |<commit_msg>refactored code<commit_after># edge-gcp
This project allows you to install edge in Google Cloud Platform using GCP's deployment manager. This uses gcp's autoscale feature to put MP blocks in autoscale group.

## Prerequisite

### gcloud
- Install gcloud sdk from https://cloud.google.com/sdk/downloads
- Initialize your account

## Apigee Private Cloud
Please go through http://docs.apigee.com/private-cloud/content/version-41705 to know more about Apigee Edge Private Cloud.

## Apigee Deployment on GCP

 - At this point of time, supported topologies are 2,5,7 and 9. For 5,7,9 node topologies, you can setup auto scaling. When set to auto scaling, Routers and MP's are configured in seperate nodes.
 - Additionally it also create Developer portal in a separate node for all supported toplogies. So for example if you choose to deploy 5 node topology, it will deploy developer portal on 6th node.
 
 - Supported Deployment Topologies

Edge Topology- 2 node
![Edge Topology- 2 node](/images/2node.png)

Edge Topology- 5 node
![Edge Topology- 5 node](/images/5node.png)

Edge Topology- 5 node with auto scaling
![Edge Topology- 5 node with auto scaling](/images/5node-auto-scaling.png)

Edge Topology- 7 node
![Edge Topology- 7 node](/images/7node.png)

Edge Topology- 7 node with auto scaling
![Edge Topology- 7 node with auto scaling](/images/7node-auto-scaling.png)

Edge Topology- 9 node
![Edge Topology- 9 node](/images/9node.png)

Edge Topology- 9 node with auto scaling
![Edge Topology- 9 node with auto scaling](/images/9node-auto-scaling.png)

GCP Resource Deployment Model for 7 node
![GCP Resource Deployment Model for 7 node](/images/resourceDeployment.png)

## Getting Started
- Create a ssh key pair 
    ```
    ssh-keygen -t rsa -b 4096 -C "apigee" -N "" -f apigee.key
    ```
    This generates a key pair file apigee.key and apigee.key.pub
    - Edit the apigee.key.pub file and prefix this with [USERNAME]: (apigee: in this case)  
    - so the public key file should like  
          ```
            apigee:sh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMQYOx.....2OA0jecyUx+3+Okp2dzhw== apigee
          ```

- Add missing fields repo->apigee->user, repo->apigee->password, setup->public_key, setup->private_key and setup->license in apigee-edge.yaml. Change other entries as desired.

    | properties                             | Description                                    |
    | -------------------------------------- |:-----------------------------------------------| 
    | repo:apigee:host                       | The software repo of apigee binaries           |
    | repo:apigee:protocol                   | The software repo protocol  (http or https)    | 
    | repo:apigee:user                       | The  user id to access Apigee software         |
    | repo:apigee:password                   | The  user password to access Apigee software   |
    | repo:apigee:stage                      | The repo stage (release, e2e)                  |
    | repo:apigee:version                    | The apigee private cloud release version       |
    | infra: topology                        | This repesents the deployment topologies. Presently it comes with bundled template of 2,5,7,9 nodes. You can specify any of these values               |
    | infra:datacenters:primary:name          | Name of primary datacenter name.              |
    | infra:datacenters:primary:region.       | Datacenter region                             |
    | infra:datacenters:primary:zone          | The primary zone of datacenter                |
    | infra:datacenters:primary:vpc:cidr      | The subnet cidr                               |
    | infra:datacenters:ms:machineType.       | The machine type for management server.       |
    | infra:datacenters:ms:diskSizeGb         | The disk size associated with management server    |
    | infra:datacenters:ds:machineType.       | The machine type for datastore(Cassandra/Zookeeper) server.                                                                                        |
    | infra:datacenters:ds:diskSizeGb         | The disk size associated with for datastore(Cassandra/Zookeeper) server                                                                                |
    | infra:datacenters:rmp:machineType.      | The machine type for router/MP server.               |
    | infra:datacenters:rmp:diskSizeGb        | The disk size associated with router/MP server       |
    | infra:datacenters:rmp:autoscale.enabled | The value can be true or false                       |
    | infra:datacenters:rmp:autoscale.size    | The minimum number of mp instances. This is mandatory|
    | infra:datacenters:rmp:autoscale.maxSize | he maximum number of autoscaled instances            |
    | infra:datacenters:ax:machineType.       | The machine type for Analytics(PG & QPID) server.    |
    | infra:datacenters:ax:diskSizeGb         | The disk size associated with Analytics(PG & QPID)   |
    | infra:datacenters:portal:machineType.   | The machine type for Portal server.                  |
    | infra:datacenters:portal:diskSizeGb     | The disk size associated with portal server          |
    | setup:apigee_admin_email                | Edge system admin user                               |
{'fraction_non_alphanumeric': 0.09189957366177168, 'fraction_numerical': 0.010042633822832782, 'mean_word_length': 2.0464646464646465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 19, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5090255', 'n_tokens_mistral': 2998, 'n_tokens_neox': 2814, 'n_words': 951}