2
votes

Prerequisites I have:
- JIRA Studio (hosted)
- with Bamboo 3.0.4
- ami-1cbd4475

I'm assuming that I must install the Bamboo remote agent (some jar) to this instance of Windows. But I neither can find any link to the agent installation (as stated in http://confluence.atlassian.com/display/BAMBOO/Creating+a+Remote+Agent) in my Bamboo configuration of Jira Studio nor find the required version of the agent by myself. Is my assumption correct at all?

Can anyone describe the process of setting up Windows AMI for Bamboo?

1

1 Answers

3
votes

Successfully installed it by myself. Thanks to internet and guys from Atlassian. So below are the steps I did.

To install an elastic agent on Windows AMI

  • Launch and RDP into any desirable Amazon Windows Image instance
  • Change Admin password at once
  • Install Google Chrome (for convenience)
  • Install Far Manager (for convenience)
  • Install the latest JDK
    • Update PATH to point to Java bin directory. If everything is ok, then java -version command should give you the version of Java
  • Download appropriate version of the agent from Atlassian
    • An elastic agent for Bamboo 3.0.4 can be found here
  • Extract the content of the zip into c:\bamboo-elastic-agent
    • Update PATH to point to c:\bamboo-elastic-agent\bin
    • Create folder c:\bamboo-agent-home
    • Create a file launch-bamboo.bat in c:\bamboo-elastic-agent\bin\ with the following contents

@echo off 
setlocal enabledelayedexpansion 
set BIN_PATH=%~dp0 
set OLD_PWD=%CD% 
cd %BIN_PATH% 
for %%J in ("..\lib\*.jar") do (
if defined CLASSPATH (
set CLASSPATH=!CLASSPATH!;%%J) else set CLASSPATH=%%J)

@echo on 

java -server -Xms32m -Xmx512m -XX:MaxPermSize=256m -classpath %CLASSPATH% -Dbamboo.home=C:\bamboo-agent-home com.atlassian.bamboo.agent.elastic.client.ElasticAgentBootstrap 2>&1 > C:\bamboo-agent-home\bamboo-elastic-agent.log
@echo off
cd %OLD_PWD% 
set OLD_PWD=
  • Try to launch launch-bamboo.bat manually

    • If everything is configured fine, you either should get nothing in the output and agent logs or get something like this

          C:\bamboo-elastic-agent \bin>java -server -Xms32m -Xmx512m -XX:MaxPermSize=256m -classpath ..\lib\acegi-security-1.0.4.jar;..\lib\activation-1.1.1.jar;..\lib\activeio-core-3.1.2.jar;..\lib\act
          ivemq-core-5.3.2-atlassian-1.jar;..\lib\activemq-protobuf-1.0.jar;..\lib\activemq-ra-5.3.2.jar;..\lib\annotations-6.0.5.jar;..\lib\ant-1.7.1.jar;..\lib\ant-launcher-1.7.1.jar;..\lib\antlr-2.7.
          7.jar;..\lib\antlr-runtime-3.1.3.jar;..\lib\aopalliance-1.0.jar;..\lib\aspectjrt-1.6.9.jar;..\lib\aspectjweaver-1.6.9.jar;..\lib\atlassian-aws-0.15.jar;..\lib\atlassian-bamboo-agent-bootstrap-
          3.0.4.jar;..\lib\atlassian-bamboo-agent-core-3.0.4.jar;..\lib\atlassian-bamboo-agent-elastic-3.0.4.jar;..\lib\atlassian-bamboo-agent-remote-3.0.4.jar;..\lib\atlassian-bamboo-api-3.0.4.jar;..\l
          ib\atlassian-bamboo-core-3.0.4.jar;..\lib\atlassian-bamboo-license-3.0.4.jar;..\lib\atlassian-bandana-3.1.jar;..\lib\atlassian-bonnie-3.4.1.jar;..\lib\atlassian-bucket-0.17.jar;..\lib\atlassia
          n-cache-api-1.0.jar;..\lib\atlassian-config-0.9.jar;..\lib\atlassian-cookie-tools-2.0.jar;..\lib\atlassian-core-4.5.3.jar;..\lib\atlassian-event-2.1.0.jar;..\lib\atlassian-extras-2.4.jar;..\li
          b\atlassian-johnson-1.0.jar;..\lib\atlassian-mail-1.9.jar;..\lib\atlassian-plugins-core-2.6.4.jar;..\lib\atlassian-plugins-osgi-2.6.4.jar;..\lib\atlassian-plugins-osgi-events-2.6.4.jar;..\lib\
          atlassian-plugins-servlet-2.6.4.jar;..\lib\atlassian-plugins-spring-2.6.4.jar;..\lib\atlassian-plugins-webfragment-2.6.4.jar;..\lib\atlassian-plugins-webresource-2.6.4.jar;..\lib\atlassian-pro
          filing-1.8.1.jar;..\lib\atlassian-secure-random-1.0.jar;..\lib\atlassian-seraph-2.4.0.jar;..\lib\atlassian-spring-1.3.jar;..\lib\atlassian-trusted-apps-core-2.1.jar;..\lib\atlassian-trusted-ap
          ps-seraph-integration-2.1.jar;..\lib\atlassian-tunnel-0.4.jar;..\lib\atlassian-user-1.9.jar;..\lib\atlassian-util-concurrent-0.0.12.jar;..\lib\atlassian-velocity-0.5.jar;..\lib\atlassian-xwork
          -12-1.10.jar;..\lib\atlassian-xwork-core-1.10.jar;..\lib\axis-1.4.jar;..\lib\axis-jaxrpc-1.4.jar;..\lib\axis-saaj-1.4.jar;..\lib\axis-wsdl4j-1.5.1.jar;..\lib\backport-util-concurrent-2.1.jar;.
          .\lib\bcmail-jdk15-1.44.jar;..\lib\bcprov-jdk15-1.44.jar;..\lib\bndlib-0.0.255.jar;..\lib\commons-beanutils-1.8.3.jar;..\lib\commons-codec-1.3.jar;..\lib\commons-collections-3.2.1.jar;..\lib\c
          ommons-configuration-1.4.jar;..\lib\commons-dbcp-1.2.jar;..\lib\commons-digester-1.8.jar;..\lib\commons-discovery-0.2.jar;..\lib\commons-httpclient-3.0.1.jar;..\lib\commons-io-1.4-backport-IO-
          168.jar;..\lib\commons-jxpath-1.2.jar;..\lib\commons-lang-2.5.jar;..\lib\commons-logging-1.0.4.jar;..\lib\commons-pool-1.4-RC2-atlassian-1.jar;..\lib\dom4j-1.4.jar;..\lib\ehcache-1.6.0-atlassi
          an-3.jar;..\lib\exml-7.0.jar;..\lib\fontbox-1.2.1.jar;..\lib\freemarker-2.3.16-atlassian-4.jar;..\lib\geronimo-connector-2.0.1.jar;..\lib\geronimo-j2ee-connector_1.5_spec-2.0.0.jar;..\lib\gero
          nimo-j2ee-management_1.1_spec-1.0.1.jar;..\lib\geronimo-jms_1.1_spec-1.0.jar;..\lib\geronimo-jta_1.1_spec-1.0.jar;..\lib\geronimo-transaction-2.0.1.jar;..\lib\google-collections-1.0.jar;..\lib
          \hibernate-2.1.8-atlassian-9.jar;..\lib\howl-1.0.1-1.jar;..\lib\hsqldb-1.8.0.7.jar;..\lib\icu4j-3.8.jar;..\lib\isorelax-20020414.jar;..\lib\javacvs-atlassian-20080407.jar;..\lib\javassist-3.6.
          ga.jar;..\lib\jaxb-api-2.1.jar;..\lib\jaxb-impl-2.1.10.jar;..\lib\jaxen-1.1-beta-9.jar;..\lib\jcip-annotations-1.0.jar;..\lib\jcl-over-slf4j-1.5.8.jar;..\lib\jdom-1.0.jar;..\lib\jempbox-1.2.1.
          jar;..\lib\jencks-2.1.jar;..\lib\jencks-amqpool-2.1-atlassian-1.jar;..\lib\jira-soapclient-4.0.jar;..\lib\jmock-1.0.1.jar;..\lib\jms-1.1.jar;..\lib\jna-3.2.7.jar;..\lib\joda-time-1.6.jar;..\li
          b\jsch-0.1.38.jar;..\lib\jta-1.0.1B.jar;..\lib\junit-4.5.jar;..\lib\kahadb-5.3.2.jar;..\lib\ldaptemplate-1.0.1.jar;..\lib\lingo-1.3.jar;..\lib\log4j-1.2.15.jar;..\lib\lucene-analyzers-2.3.2.ja
          r;..\lib\lucene-core-2.3.2.jar;..\lib\mail-1.4.1.jar;..\lib\mockobjects-alt-jdk1.3-j2ee1.3-0.09.jar;..\lib\msv-20020414.jar;..\lib\odmg-3.0.jar;..\lib\ognl-2.7.3-atlassian-3.jar;..\lib\org.apa
          che.felix.framework-3.0.2.jar;..\lib\oro-2.0.8.jar;..\lib\oscore-2.2.7.jar;..\lib\osuser-1.0-20060106.jar;..\lib\p4java-0.7.5-atlassian-5.8.jar;..\lib\package-scanner-0.9.4.jar;..\lib\pdfbox-1
          .2.1.jar;..\lib\plexus-utils-1.5.9.jar;..\lib\poi-3.5-FINAL.jar;..\lib\poi-scratchpad-3.5-FINAL.jar;..\lib\propertyset-1.3-21Nov03.jar;..\lib\quartz-1.6.5.jar;..\lib\relaxngDatatype-20020414.j
          ar;..\lib\rife-continuations-0.0.2.jar;..\lib\rome-1.0.jar;..\lib\sal-api-2.2.1.jar;..\lib\sal-spi-2.2.1.jar;..\lib\sal-spring-2.2.1.jar;..\lib\saxpath-1.0-FCS.jar;..\lib\servlet-api-2.5.jar;.
          .\lib\sitemesh-2.2.1.jar;..\lib\slf4j-api-1.5.8.jar;..\lib\slf4j-log4j12-1.5.8.jar;..\lib\smack-3.0.4.jar;..\lib\smackx-3.0.4.jar;..\lib\spring-aop-2.0.7.jar;..\lib\spring-beans-2.0.7.jar;..\l
          ib\spring-context-2.0.7.jar;..\lib\spring-core-2.0.7.jar;..\lib\spring-dao-2.0.7.jar;..\lib\spring-hibernate2-2.0.7.jar;..\lib\spring-jdbc-2.0.7.jar;..\lib\spring-jms-2.0.7.jar;..\lib\spring-m
          ock-2.0.7.jar;..\lib\spring-remoting-2.0.7.jar;..\lib\spring-support-2.0.7.jar;..\lib\spring-web-2.0.7.jar;..\lib\sqljet-1.0.4.jar;..\lib\stax-api-1.0-2.jar;..\lib\stringtemplate-3.2.jar;..\li
          b\svnkit-1.3.5.7539.jar;..\lib\trilead-ssh2-build213-svnkit-1.3-patch.jar;..\lib\typica-1.6.jar;..\lib\velocity-1.4.jar;..\lib\webwork-2.2.7-atlassian-5.jar;..\lib\wsdl4j-1.6.1.jar;..\lib\xapo
          ol-without-pool-1.4.jar;..\lib\xbean-spring-3.2.jar;..\lib\xercesImpl-2.9.1.jar;..\lib\xfire-core-1.2.6.jar;..\lib\xml-apis-1.3.03.jar;..\lib\xmlParserAPIs-2.6.2.jar;..\lib\XmlSchema-1.1.jar;.
          .\lib\xpp3_min-1.1.4c.jar;..\lib\xstream-1.3.1.jar;..\lib\xwork-1.2.5-atlassian-2.jar -Dbamboo.home=C:\bamboo-agent-home com.atlassian.bamboo.agent.elastic.client.ElasticAgentBootstrap 2>&1 1
          >C:\bamboo-agent-home\bamboo-elastic-agent.log
          java.io.FileNotFoundException: http://169.254.169.254/2008-02-01/user-data
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
          at java.net.URL.openStream(Unknown Source)
          at com.atlassian.urlfetcher.URLFetcherImpl.fetchSerializedObject(URLFetcherImpl.java:16)
          at com.atlassian.aws.ec2.EC2Utils.getUserData(EC2Utils.java:69)
          at com.atlassian.bamboo.agent.elastic.client.ElasticAgentBootstrap.main(ElasticAgentBootstrap.java:41)
      
    • If you get an error saying: Error: no server JVM at C:\Program Files\Java\jre6\bin\server\jvm.dll, then copy C:\Program Files\Java\jdk1.6.0\jre\bin to C:\Program Files\Java\jre1.6.0\bin

  • Download NSSM to configure the batch file to be launched as a service
    • Extract
    • launch with nssm.exe install bamboo-agent
    • enter path c:\bamboo-elastic-agent\bin\launch-bamboo.bat
    • done
  • Make sure service bamboo-agent is configured to be launched automatically in the Windows Service Manager
    • input services.msc in cmd
    • check bamboo-agent service launch as automatic
  • Configure Firewall to allow port 26224
    • Or set in Advanced firewall options to log dropped packets
    • Stop instance
    • Create temp AMI
    • Launch this temp AMI from Bamboo
    • Login via RDP to the instance of this temp AMI
    • Review the blocked ports
    • Find out the number of the Bamboo port that is blocked
    • Terminate the instance of the temp AMI
    • Deregister temp AMI
    • Resume stopped original instance
    • Configure firewall to allow this port
  • Stop the Instance at Amazon Console
    • Don't confuse it with Terminate. You should just either Stop the instance on Console or make a regular Windows Shutdown via RDP
  • Create AMI of this stopped instance in Amazon Console
    • You may Terminate the stopped instance after AMI is created