Skip to content

Commit

Permalink
Updates to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindsv committed May 28, 2020
1 parent a1e8ff1 commit 2c5ee1d
Show file tree
Hide file tree
Showing 27 changed files with 361 additions and 194 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ src/main/resources-generated
classes/

.bundle/
contrib/cloudformation-template/bin/
contrib/cloudformation-template/bin/

.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The settings allow you to choose the AMI to be used for the EC2 instance, the in

Once the builds finish and the EC2 instances are idle for a while, they will be automatically scaled down and destroyed, removing the cost of running idle EC2 instances. Along with saving cost, this enables a flexible and dynamic build grid in which you don’t need to worry about configuration drift.

The set of images [here](docs/plugin_as_images.md) explain this concept as well
The set of images [here](docs/plugin_as_images.md) explain this concept as well.

Table of Contents
=================
Expand Down
118 changes: 59 additions & 59 deletions docs/cluster_profile_configuration.md

Large diffs are not rendered by default.

177 changes: 177 additions & 0 deletions docs/ecs_cloud_formation_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"ClusterName": {
"Description": "The name of the ECS cluster",
"Type": "String",
"Default": "GoCD"
}
},
"Outputs": {
"AccessKey": {
"Value": {
"Ref": "AccessKey"
}
},
"SecretKey": {
"Value": {
"Fn::GetAtt": [
"AccessKey",
"SecretAccessKey"
]
}
},
"GoCDEC2OptimizedRole": {
"Value": {
"Fn::GetAtt": [
"GoCDEC2OptimizedRole",
"Arn"
]
}
},
"GoCDEC2OptimizedInstanceProfile": {
"Value": {
"Fn::GetAtt": [
"GoCDEC2OptimizedInstanceProfile",
"Arn"
]
}
}
},
"Resources": {
"GoCDECSCluster": {
"Type": "AWS::ECS::Cluster",
"Properties": {
"ClusterName": {
"Ref": "ClusterName"
}
}
},
"AccessKey": {
"Type": "AWS::IAM::AccessKey",
"Properties": {
"UserName": {
"Ref": "GoCDECSPluginUser"
}
}
},
"GoCDECSPluginUser": {
"Type": "AWS::IAM::User",
"Properties": {
"Policies": [
{
"PolicyName": "ManageEC2Instances",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:runInstances",
"ec2:createTags",
"ec2:terminateInstances",
"ec2:describeInstances",
"ec2:describeSubnets",
"ec2:createVolume",
"ec2:attachVolume",
"ec2:stopInstances",
"ec2:startInstances",
"ec2:deleteTags",
"iam:PassRole",
"iam:GetRole"
],
"Resource": [
"*"
]
}
]
}
},
{
"PolicyName": "ManageECSInstances",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecs:describeClusters",
"ecs:deregisterContainerInstance",
"ecs:describeContainerInstances",
"ecs:listContainerInstances",
"ecs:registerTaskDefinition",
"ecs:deregisterTaskDefinition",
"ecs:startTask",
"ecs:stopTask",
"ecs:listTasks",
"ecs:describeTasks",
"ecs:describeTaskDefinition"
],
"Resource": [
"*"
]
}
]
}
}
]
}
},
"GoCDEC2OptimizedRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": {
"Effect": "Allow",
"Principal": {
"Service": [
"ec2.amazonaws.com"
]
},
"Action": [
"sts:AssumeRole"
]
}
},
"Policies": [
{
"PolicyName": "AllowECSAgentToManageContainers",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecs:describeClusters",
"ecs:discoverPollEndpoint",
"ecs:registerContainerInstance",
"ecs:deregisterContainerInstance",
"ecs:poll",
"ecs:startTelemetrySession",
"ecs:submitContainerStateChange",
"ecs:submitTaskStateChange",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"*"
]
}
]
}
}
]
}
},
"GoCDEC2OptimizedInstanceProfile": {
"Type": "AWS::IAM::InstanceProfile",
"Properties": {
"Roles": [
{
"Ref": "GoCDEC2OptimizedRole"
}
]
}
}
}
}
5 changes: 0 additions & 5 deletions docs/ecs_cloud_formation_template.json.erb

This file was deleted.

8 changes: 4 additions & 4 deletions docs/elastic_agent_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

GoCD elastic agents run inside Docker containers on an ECS cluster. You can either use the Docker images provided by the GoCD team or build your own images with the right software already provisioned on it.

* [Docker images provided by the GoCD team](https://hub.docker.com/u/gocd/) on Docker Hub
* Corresponding `Dockerfile` and init scripts of these docker images can be found [here](https://github.com/gocd?utf8=%E2%9C%93&q=docker-gocd-agent)
* [Docker images provided by the GoCD team](https://hub.docker.com/u/gocd/) on Docker Hub.
* Corresponding `Dockerfile` and init scripts of these docker images can be found [here](https://github.com/gocd?q=docker-gocd-agent).

## Using your own docker image with elastic agents

Expand Down Expand Up @@ -47,6 +47,6 @@ $properties = @("agent.auto.register.key=$env:GO_EA_AUTO_REGISTER_KEY",
$properties | Out-File "c:\gocd-agent\config\autoregister.properties" -Encoding "default" -append
```
**Note:** GoCD agent supports only `Little-endian` encoding. Please make sure that generated file has valid encoding.
**Note:** GoCD agent supports only little-endian encoding. Please make sure that generated file has valid encoding.
Refer to the bootstrap script template [here](https://github.com/gocd/gocd/blob/master/buildSrc/src/main/resources/gocd-docker-agent/docker-entrypoint.sh) to understand what is necessary for the image to be a GoCD agent docker image. To look for the bootstrap script for a particular container image of your choice, check one of the docker agent image repositories [here](https://github.com/gocd?utf8=%E2%9C%93&q=docker-gocd-agent).
Refer to the bootstrap script template [here](https://github.com/gocd/gocd/blob/master/buildSrc/src/main/resources/gocd-docker-agent/docker-entrypoint.sh) to understand what is necessary for the image to be a GoCD agent docker image. To look for the bootstrap script for a particular container image of your choice, check one of the docker agent image repositories [here](https://github.com/gocd?q=docker-gocd-agent).
Loading

0 comments on commit 2c5ee1d

Please sign in to comment.