diff --git a/README.md b/README.md index 0ecb4fb..219bb61 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ Build and run from source Download and run a binary release ``` -rel= +rel= wget https://github.com/80degreeswest/bfmgr/releases/download/$rel/bfmgr-$rel.jar java -jar target/bfmgr-$rel.jar ``` -Go to http://localhost:8080 and click Create +Go to http://localhost and click Create #### Deploying in AWS @@ -38,6 +38,17 @@ Run below CloudFormation template in your AWS account https://github.com/80degreeswest/bfmgr/blob/master/src/main/resources/bfmgr-aws.json ``` -Go to http://:8080 and click Create -Enter desired Subnet ID and Security Group and click Create -You should have a working Buildfarm cluster setup in under 5 minutes \ No newline at end of file +Alternatively, manually launch an EC2 instance with the IAM Role with specified policies and run the following + +``` +yum install java -y +rel= +wget -N https://github.com/80degreeswest/bfmgr/releases/download/$rel/bfmgr-$rel.jar +mkdir /var/log/bfmgr && chmod 0777 /var/log/bfmgr +java -jar bfmgr-$rel.jar & +disown +``` + +Go to http:// and click Create
+Enter desired Subnet ID and Security Group and click Create
+You should have a working Buildfarm cluster setup in under 5 minutes
\ No newline at end of file diff --git a/output-resources/README.md b/output-resources/README.md new file mode 100644 index 0000000..dd6c6a6 --- /dev/null +++ b/output-resources/README.md @@ -0,0 +1,43 @@ +# Buildfarm Manager + +This repository hosts the [Buildfarm](https://github.com/bazelbuild/bazel-buildfarm) deployment and administration application. + +### Quick Start + +#### Local Testing + +Make sure Docker is running + +Create log directory + +``` +sudo mkdir /var/log/bfmgr && sudo chmod 0777 /var/log/bfmgr +``` + +Build and run from source + +``` +./mvnw clean package && java -jar target/bfmgr-.jar +``` + +Download and run a binary release + +``` +rel=${version} +wget https://github.com/80degreeswest/bfmgr/releases/download/$rel/bfmgr-$rel.jar +java -jar target/bfmgr-$rel.jar +``` + +Go to http://localhost and click Create + +#### Deploying in AWS + +Run below CloudFormation template in your AWS account + +``` +https://github.com/80degreeswest/bfmgr/blob/master/src/main/resources/bfmgr-aws.json +``` + +Go to http:// and click Create +Enter desired Subnet ID and Security Group and click Create +You should have a working Buildfarm cluster setup in under 5 minutes \ No newline at end of file diff --git a/output-resources/pom.xml b/output-resources/pom.xml new file mode 100644 index 0000000..d91d424 --- /dev/null +++ b/output-resources/pom.xml @@ -0,0 +1,163 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.8.BUILD-SNAPSHOT + + + com.eightydegreeswest + bfmgr + 1.0.1 + bfmgr + Buildfarm Manager + + + 10 + Hoxton.SR4 + 1.11.791 + + + + + com.amazonaws + aws-java-sdk-core + ${aws.version} + + + com.amazonaws + aws-java-sdk-autoscaling + ${aws.version} + + + + com.amazonaws + aws-java-sdk-cloudformation + ${aws.version} + + + com.amazonaws + aws-java-sdk-elasticloadbalancingv2 + ${aws.version} + + + + com.amazonaws + aws-java-sdk-ec2 + ${aws.version} + + + com.github.docker-java + docker-java + 3.2.1 + + + io.github.lognet + grpc-spring-boot-starter + 3.3.0 + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + maven-resources-plugin + 3.0.2 + + output-resources + + + . + + *.json + *.xml + README.md + + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + + diff --git a/pom.xml b/pom.xml index ca26880..b444eef 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.eightydegreeswest bfmgr - 1.0.0 + 1.0.1 bfmgr Buildfarm Manager @@ -103,6 +103,12 @@ + + + src/main/resources + true + + org.springframework.boot diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4b9d552..27a98a3 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,5 @@ +server.port=80 + container.name.server=buildfarm-server container.name.worker=buildfarm-worker container.name.redis=buildfarm-redis diff --git a/src/main/resources/aws.json b/src/main/resources/aws.json index f2a7639..fe6e08b 100644 --- a/src/main/resources/aws.json +++ b/src/main/resources/aws.json @@ -129,7 +129,20 @@ }, "TagSpecifications" : [ { - "ResourceType" : "launch-template", + "ResourceType" : "instance", + "Tags" : [ + { + "Key" : { + "Ref": "RequiredTagName" + }, + "Value" : { + "Ref": "ClusterName" + } + } + ] + }, + { + "ResourceType" : "volume", "Tags" : [ { "Key" : { @@ -226,7 +239,20 @@ }, "TagSpecifications" : [ { - "ResourceType" : "launch-template", + "ResourceType" : "instance", + "Tags" : [ + { + "Key" : { + "Ref": "RequiredTagName" + }, + "Value" : { + "Ref": "ClusterName" + } + } + ] + }, + { + "ResourceType" : "volume", "Tags" : [ { "Key" : { diff --git a/src/main/resources/bfmgr-aws.json b/src/main/resources/bfmgr-aws.json index 373cefc..19f6db8 100644 --- a/src/main/resources/bfmgr-aws.json +++ b/src/main/resources/bfmgr-aws.json @@ -14,6 +14,10 @@ "Type": "String", "Default": "Asset", "Description": "Enter required asset tag name" + }, + "ReleaseNumber": { + "Type": "String", + "Description": "Enter bfmgr release number" } }, "Resources": { @@ -73,7 +77,10 @@ "Properties" : { "Path" : "/", "Roles" : ["buildfarm-manager"] - } + }, + "DependsOn": [ + "BfMgrRole" + ] }, "BfMgrEc2": { "Type": "AWS::EC2::Instance", @@ -112,7 +119,7 @@ [ "#!/bin/bash\n\n", "yum install java -y\n", - "rel=1.0.0", + "rel=", { "Ref": "ReleaseNumber" }, "\n", "wget -N https://github.com/80degreeswest/bfmgr/releases/download/$rel/bfmgr-$rel.jar\n", "mkdir /var/log/bfmgr && chmod 0777 /var/log/bfmgr\n", "java -jar bfmgr-$rel.jar &\n", @@ -123,7 +130,8 @@ } }, "DependsOn": [ - "BfMgrRole" + "BfMgrRole", + "BfMgrInstanceProfile" ] } } diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html index be71a39..ba7c175 100644 --- a/src/main/resources/templates/error.html +++ b/src/main/resources/templates/error.html @@ -23,9 +23,11 @@

Error Occurred!

- status] error + [status] error

message

+

exception

+

trace