Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
16691e37
Commit
16691e37
authored
Mar 29, 2016
by
Brian Beggs
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2869 from edx/go-agent-docker
Go agent docker Updates
parents
72422bb7
5458bbd9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
5 deletions
+72
-5
.dockerignore
+2
-1
docker/build/go-agent/Dockerfile
+20
-4
docker/build/go-agent/README.md
+14
-0
docker/build/go-agent/files/go-agent-env-vars
+12
-0
docker/build/go-agent/files/go-agent-start.sh
+24
-0
No files found.
.dockerignore
View file @
16691e37
*
!playbooks/
!docker/build/*/ansible_overrides.yml
!docker/build/*/*.sh
!docker/build/*
docker/build/*/Dockerfile
!docker/plays/
!util/install/
docker/build/go-agent/Dockerfile
View file @
16691e37
# Build using: docker build -f Dockerfile.gocd-agent -t gocd-agent .
# FROM edxops/precise-common:latest
FROM
gocd/gocd-agent:16.2.1
LABEL
version="0.0
1
" \
LABEL
version="0.0
2
" \
description="This custom go-agent docker file installs additional requirements for the edx pipeline"
RUN
\
echo
oracle-java7-installer shared/accepted-oracle-license-v1-1
select
true
| debconf-set-selections
&&
\
add-apt-repository
-y
ppa:webupd8team/java
&&
\
apt-get update
&&
\
apt-get install
-y
oracle-java7-installer
&&
\
rm
-rf
/var/lib/apt/lists/
*
&&
\
rm
-rf
/var/cache/oracle-jdk7-installer
# Define working directory.
WORKDIR
/data
# Define commonly used JAVA_HOME variable
ENV
JAVA_HOME /usr/lib/jvm/java-7-oracle
RUN
apt-get update
&&
apt-get install
-y
-q
\
python
\
...
...
@@ -15,4 +28,8 @@ RUN apt-get update && apt-get install -y -q \
# TODO: repalce this with a pip install command so we can version this properly
RUN
git clone https://github.com/edx/tubular.git /opt/tubular
RUN
pip install
-r
/opt/tubular/requirements.txt
RUN
cd
/opt/tubular
;
python setup.py install
\ No newline at end of file
RUN
cd
/opt/tubular
;
python setup.py install
ADD
docker/build/go-agent/files/go-agent-start.sh /etc/service/go-agent/run
ADD
docker/build/go-agent/files/go-agent-env-vars /etc/default/go-agent
RUN
update-java-alternatives
-s
java-7-oracle
docker/build/go-agent/README.md
View file @
16691e37
...
...
@@ -26,3 +26,16 @@ necessary.
```
docker run -ti -v /tmp/go-agent/conf:/var/lib/go-agent/config -e GO_SERVER=gocd.sandbox.edx.org 718d75c467c0 bash
```
[How to setup auto registration for remote agents](https://docs.go.cd/current/advanced_usage/agent_auto_register.html)
##Building and Uploading the container to ECS
* Create image
- ```
docker build --no-cache=true docker/build/go-agent
```
* Log docker in to AWS
- ```
sh -c
`aws ecr get-login --region us-east-1`
```
* Tag image
- ```
docker tag -f
<image
_id
>
############.dkr.ecr.us-east-1.amazonaws.com/release-pipeline:latest
```
- ```
docker tag -f
<image
_id
>
############.dkr.ecr.us-east-1.amazonaws.com/release-pipeline:
<version
_number
>
```
* upload:
- ```
docker push ############.dkr.ecr.us-east-1.amazonaws.com/edx/release-pipeline/go-agent/python:latest
```
- ```
docker push ############.dkr.ecr.us-east-1.amazonaws.com/edx/release-pipeline/go-agent/python:
<version
_number
>
```
\ No newline at end of file
docker/build/go-agent/files/go-agent-env-vars
0 → 100644
View file @
16691e37
GO_SERVER=127.0.0.1
export GO_SERVER
GO_SERVER_PORT=8153
export GO_SERVER_PORT
GO_SERVER_SSL_PORT=8154
export GO_SERVER_SSL_PORT
AGENT_WORK_DIR=/var/lib/${SERVICE_NAME:-go-agent}
export AGENT_WORK_DIR
DAEMON=N
VNC=N
export JAVA_HOME="/usr/lib/jvm/java-7-oracle/jre" # SET_BY_GO_INSTALLER__DONT_REMOVE
\ No newline at end of file
docker/build/go-agent/files/go-agent-start.sh
0 → 100755
View file @
16691e37
#!/bin/bash
GO_SERVER
=
${
GO_SERVER
:-
go
-server
}
GO_SERVER_PORT
=
${
GO_SERVER_PORT
:-
go
-server-port
}
COLOR_START
=
"[01;34m"
COLOR_END
=
"[00m"
echo
-e
"
${
COLOR_START
}
Starting Go Agent to connect to server
$GO_SERVER
:
$GO_SERVER_PORT
...
${
COLOR_END
}
"
sed
-i
-e
's/GO_SERVER=.*/GO_SERVER='
$GO_SERVER
'/'
/etc/default/go-agent
sed
-i
-e
's/GO_SERVER_PORT=.*/GO_SERVER_PORT='
$GO_SERVER_PORT
'/'
/etc/default/go-agent
sed
-i
-e
's/GO_SERVER_SSL_PORT=.*/GO_SERVER_SSL_PORT='
$GO_SERVER_SSL_PORT
'/'
/etc/default/go-agent
mkdir
-p
/var/lib/go-agent/config
/bin/rm
-f
/var/lib/go-agent/config/autoregister.properties
AGENT_KEY
=
"
${
AGENT_KEY
:-
123456789abcdef
}
"
echo
"agent.auto.register.key=
$AGENT_KEY
"
>
/var/lib/go-agent/config/autoregister.properties
if
[
-n
"
$AGENT_RESOURCES
"
]
;
then
echo
"agent.auto.register.resources=
$AGENT_RESOURCES
"
>>
/var/lib/go-agent/config/autoregister.properties
;
fi
if
[
-n
"
$AGENT_ENVIRONMENTS
"
]
;
then
echo
"agent.auto.register.environments=
$AGENT_ENVIRONMENTS
"
>>
/var/lib/go-agent/config/autoregister.properties
;
fi
/sbin/setuser go /etc/init.d/go-agent start
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment