Giter Club home page Giter Club logo

docker-gocd-agent's Introduction

GoCD

Google Groups GitHub Discussions GitHub License Server Docker Pulls

This is the main repository for GoCD - a continuous delivery server. GoCD helps you automate and streamline the build-test-release cycle for worry-free, continuous delivery of your product.

Security

Please see the security policy for details on GoCD's security status, and how to responsibly disclose issues.

Development

GoCD is predominantly a Java & TypeScript project utilising Spring Framework, SparkJava & MithrilJS as key frameworks, built using Gradle & Webpack and running within Eclipse Jetty.

There are a small number of older parts of GoCD rendered server-side within JRuby on Rails which utilise some legacy plain JavaScript with JQuery. GoCD itself is used to build GoCD.

Here is the guide to setup your development environment.

Contributing

We'd love it if you contributed to GoCD. For information on contributing to this project, please see our contributor's guide. A lot of useful information like links to user documentation, design documentation, mailing lists etc. can be found in the resources section.

License

GoCD is an open source project, sponsored by Thoughtworks, Inc. under the Apache License, Version 2.0.

docker-gocd-agent's People

Contributors

aerostitch avatar arvindsv avatar bdpiprava avatar fire avatar fredrikwendt avatar ganeshspatil avatar holms avatar jyotisingh avatar ketan avatar marques-work avatar neofob avatar rajiesh avatar varshavaradarajan avatar zalyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-gocd-agent's Issues

GoCD agent doesn't seem to connect / work

Hi,
I'm trying to get my head around your new alpine images, and experiencing some issues. Maybe one of you could fuze with me for a bit?

The latest issue is I have is that my agent seems to connect, is assigned to an environment, i have a pipeline in the environment, but the job never gets picked up by the agent.

I can't see anything in the gocd-agent or gocd-server logs that gives away any sort of problem, however i'm seeing a bunch of 403 (forbidden) errors in nginx:

nginx_1   | 172.24.0.4 - - [27/Jun/2017:17:17:53 +0000] "POST /go/remoting/remoteBuildRepository HTTP/1.1" 403 463 "-" "Apache-HttpClient/4.5.2 (Java/1.8.0_121)" "-"

I'm guessing the agent (which self registered fine), for whatever reason, can't pull jobs.

I only see those 403s after "enabling" the agent though the GUI, as initially, it is in a pending state.

Doesn't work !

$ docker pull gocd/gocd-agent-ubuntu-16.04
Using default tag: latest
Error response from daemon: manifest for gocd/gocd-agent-ubuntu-16.04:latest not found

`/home/go` is not writeable

On ubuntu (and I suspect debian and centos images), the /home/go directory is not writeable.

I think this is because of a missing -m argument here.

Why do you enforce the GO_SERVER_URL to be https?

Hi,
I run gocd on kubernetes, and my agents connect to the gocd-master on a private network, via it's internal kubernetes name (gocd-master.ci.cluster.svc.local), thus the GO_SERVER_URL is http://, rather than https://

I don't want my goagents to have to go out to the internet to connect to the internet facing load balancer (where the ssl termination is) just to facilitate this requirement, it actually introduces security risks to do so.

Is there any way to bypass or turn off the requirement for https agent urls?

Thanks
Karl

Can't change user inside container (alpine-3.5)

When trying to change user inside container - it doesn't work.

$ docker --tls exec -it 17330814aeea bash
bash-4.3# whoami
root
bash-4.3# su go
su: can't execute ',,,:/home/': No such file or directory
bash-4.3# cat /etc/passwd | grep go
go:x:1000:1000:Linux User,,,:/home/go:,,,:/home/

Where this ,,, comes from?

Cloning Materials Stalls

Ive had my agents running normally for a few weeks. Today i started seeing 1 of my agents with a stalled build:

[go] Job Started: 2017-09-22 16:09:33 UTC
[go] Start to prepare fishAPI/57/CommitHandler/1/CompileAPI on 2e2462b9b5ec [/go]
[go] Cleaning working directory "/go/pipelines/fishAPI" since stage is configured to clean working directory
[go] Start to update materials.

[go] Start updating files at revision XXXXXXXXXXX from https://fish_charles:******@gitlab.com/qbu/api.git
Cloning into '/go/pipelines/fishAPI'...

Each agent is a docker container, the server is a docker container, they are all on the same host. I cant seem to get this pipeline to continue. Even after killing and triggering a new build i get:

Job fishAPI/CommitHandler/CompileAPI is currently running but has not shown any console activity in the last 32 minute(s). This job may be hung.

The other agents are all working fine. Please advise.

Something is wrong with the latest tag

Pulling the latest tag seems to fail:

docker pull gocd/gocd-agent-alpine-3.5
Using default tag: latest
Error response from daemon: manifest for gocd/gocd-agent-alpine-3.5:latest not found

But works flawlessly for v17.4.0 and v.17.3.0

docker pull gocd/gocd-agent-alpine-3.5:v17.3.0
v17.3.0: Pulling from gocd/gocd-agent-alpine-3.5
627beaf3eaaf: Already exists
ba50dc5e812e: Pull complete
47daa26e069d: Pull complete
7351f6eed267: Pull complete
8a65fa6c9068: Pull complete
00fb8ace5846: Pull complete
Digest: sha256:dd2a7c67d0cf1688ad37476a0d77ea4f7f265c874a6b0c319eea22db74fca158
Status: Downloaded newer image for gocd/gocd-agent-alpine-3.5:v17.3.0

Not a big deal though

How do I set environment variables to agent (like /etc/default/go-agent)

What I'd like to do:
Run scripts that set environment variables, which become available to my agents.

Steps I've done:

  1. I've created a Docker image based on this image (gocd/gocd-agent-docker-dind specifically).
  2. I've added some scripts I'd like to run in /etc/profile.d/, for example this one:
$ cat /etc/profile.d/add-python-scripts-to-path.sh
#!/bin/false

export PATH="/home/go/.local/bin:$PATH"
  1. I've created the /etc/default/go-agent file, and have it load /etc/profile:
$ cat /etc/default/go-agent
. /etc/profile
  1. ...and /etc/profile in turn should load the files in /etc/profile.d:
$ tail -n5 /etc/profile
for script in /etc/profile.d/*.sh ; do
        if [ -r $script ] ; then
                . $script
        fi
done

...however when I run jobs using this image, my scripts haven't been run, and the environment variables aren't set.

Questions:

  1. Am I configuring the right file? (/etc/default/go-agent)
  2. Am I running without service_mode? I suppose I am (?) โ€” and then my guess (judging from /go-agent/agent.sh) is that maybe my file won't be loaded:
$ grep "/etc/default" -B 1 -A 5 /go-agent/agent.sh
if [ "$2" == "service_mode" ]; then
  if [ -f /etc/default/${SERVICE_NAME} ]; then
    . /etc/default/${SERVICE_NAME}
  fi

  # no point in not daemonizing the service
  DAEMON=Y
fi
  1. If that's the case, is there another way I should be telling the gocd agent to run my files for setting environment variables etc?

perl: warning: Setting locale failed.

What I'd like to do:
Solve the below warning during Docker image build.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: delaying package configuration, since apt-utils is not installed

Steps I've done:

# git clone https://github.com/gocd/docker-gocd-agent-debian-8.git
# cd docker-gocd-agent-debian-8
# docker build -t docker-gocd-agent-debian-8 .

Questions:
I found the my GoCD agent pod can not support Chinese characters during Gradle build

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':account-management-service:generateGitProperties'.
> Malformed input or input contains unmappable characters: /godata/pipelines/a-management-gocd-test/app/a-management-service/src/main/resources/xlxs feature toogle steUp ??????.md

Is this problem related to the warning during the image build?

Can't get the the gocd-agent to connect to the server with Docker compose

Below is a simple docker compose file to setup a go server and agent. The agent refuses to connect to the agent. I can confirm that the gocd-server host address is reachable from the agent.

version: '3'
services:
  go-server:
    networks:
        - service-net
    image: "gocd/gocd-server:v17.11.0"  
    ports:    
        - "8153:8153"
        - "8154:8154"                    
  go-agent: 
    networks:
        - service-net
    image: "gocd/gocd-agent-ubuntu-16.04:v17.11.0"
    depends_on:
        - go-server      
    environment:
        GO_SERVER_URL: "https://go-server:8514/go"        
networks:
    service-net:

It seems the server is rejecting the connection:

go-agent_1 | 2017-11-09 14:33:16,260 ERROR [main] ServerBinaryDownloader:80 - Couldn't update admin/agent-launcher.jar. Sleeping for 1m. Error:
go-agent_1 | org.apache.http.conn.HttpHostConnectException: Connect to go-server:8514 [go-server/172.20.0.2] failed: Connection refused (Connection refused)
go-agent_1 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)
go-agent_1 | at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
go-agent_1 | at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
go-agent_1 | at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
go-agent_1 | at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
go-agent_1 | at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
go-agent_1 | at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
go-agent_1 | at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
go-agent_1 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
go-agent_1 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
go-agent_1 | at com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.fetchUpdateCheckHeaders(ServerBinaryDownloader.java:96)
go-agent_1 | at com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.downloadIfNecessary(ServerBinaryDownloader.java:72)
go-agent_1 | at com.thoughtworks.go.agent.launcher.AgentLauncherImpl.doLaunch(AgentLauncherImpl.java:90)
go-agent_1 | at com.thoughtworks.go.agent.launcher.AgentLauncherImpl.lambda$launch$0(AgentLauncherImpl.java:68)
go-agent_1 | at com.thoughtworks.go.logging.LogConfigurator.runWithLogger(LogConfigurator.java:62)
go-agent_1 | at com.thoughtworks.go.agent.launcher.AgentLauncherImpl.launch(AgentLauncherImpl.java:68)
go-agent_1 | at com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.go(AgentBootstrapper.java:79)
go-agent_1 | at com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.lambda$main$0(AgentBootstrapper.java:60)
go-agent_1 | at com.thoughtworks.go.logging.LogConfigurator.runWithLogger(LogConfigurator.java:53)
go-agent_1 | at com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.main(AgentBootstrapper.java:60)
go-agent_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
go-agent_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
go-agent_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
go-agent_1 | at java.lang.reflect.Method.invoke(Method.java:498)
go-agent_1 | at com.thoughtworks.gocd.Boot.run(Boot.java:104)
go-agent_1 | at com.thoughtworks.gocd.Boot.main(Boot.java:55)
go-agent_1 | Caused by: java.net.ConnectException: Connection refused (Connection refused)
go-agent_1 | at java.net.PlainSocketImpl.socketConnect(Native Method)
go-agent_1 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
go-agent_1 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
go-agent_1 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
go-agent_1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
go-agent_1 | at java.net.Socket.connect(Socket.java:589)
go-agent_1 | at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:337)
go-agent_1 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
go-agent_1 | ... 25 common frames omitted

Make /var/go the home directory

For installations of the gocd which creates the 'go' user, /var/go is the home directory. For consistency's sake, we need to make /var/go the home directory within the container as well.

To avoid breaking the usages of /home/go, we can sym link /home/go to /var/go and add a deprecation notice and remove /home/go in a few releases time.

Agent unable to connect to Server hosted on docker container

I create docker image using command below:

DOCKER_HOST_IP=10.x.x.x
SERVER_URL=https://$DOCKER_HOST_IP:32772/go
docker run -v /data/godata_agent:/godata -d -e GO_SERVER_URL=$SERVER_URL gocd/gocd-agent-centos-7:v17.7.0

In browser, I can access https://$DOCKER_HOST_IP:32772/go ; however the server does not have SSL support.

The Agent gives this error:

2017-08-07 16:35:35,750 [main ] ERROR go.agent.launcher.ServerBinaryDownloader:81 - Couldn't update admin/agent-launcher.jar. Sleeping for 1m. Error: java.net.NoRouteToHostException: No route to host (Host unreachable)

docker agent doesn't connect with docker compose?

I am using the alpine agent and connecting by using ansible to trigger the compose script to deploy to docker swarm:

version: '3'

services:

    go_agent:
      image: gocd/gocd-agent-alpine-3.5:v17.8.0
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
      environment:
        - GO_SERVER_URL=https://http://10.240.226.19:8154/go

This is not connecting to the Go server?
However running the agent locally works?

docker run -d -e GO_SERVER_URL=https://10.240.226.19:8154/go gocd/gocd-agent-alpine-3.5:v17.8.0

Thanks

Need more documentation on GOCD_AGENT_DOWNLOAD_URL variable

What is the URL for GOCD_AGENT_DOWNLOAD_URL?

I try to build some gocd-agent docker image according to the README.md:

GOCD_VERSION=17.2 rake build image
rake aborted!
environment GOCD_AGENT_DOWNLOAD_URL not specified!
/home/tuan/src/docker-gocd-agent/Rakefile:21:in `get_var'
/home/tuan/src/docker-gocd-agent/Rakefile:28:in `<top (required)>'
(See full trace by running task with --trace)

AGENT_AUTO_REGISTER_* env vars not applied during run ?

Hi guys,

First of all thanks for your hard work ! I'm currently testing your solution, love it !

I'm currently facing one issue through. I'm using gocd/docker-gocd-agent-alpine-3.5 and when I set environment variables AGENT_AUTO_REGISTER_HOSTNAME and AGENT_AUTO_REGISTER_RESOURCES (I'm not using the others yet) when running my agents, they still show up in GoCD server with their containers ids as agent names and they have no resources tags. I have to set tags manually every time I run an agent.

Has anyone run into the same problem ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.