dd-agent icon indicating copy to clipboard operation
dd-agent copied to clipboard

FreeBSD package for datadog-agent

Open alq666 opened this issue 12 years ago • 48 comments

Presumably using pkg_create.

alq666 avatar Jan 21 '13 21:01 alq666

@loris @PFdB Any input for this? How do you package our agent?

alq666 avatar Jan 21 '13 21:01 alq666

http://www.freebsd.org/doc/en/articles/contributing-ports/article.html

nambrosch avatar Feb 23 '13 20:02 nambrosch

I could try to make a port but I would need more details about all the dependencies and special steps for installation.

urosgruber avatar Aug 04 '15 10:08 urosgruber

since the original post the ports tree has been semi-deprecated, pkg-ng has taken it's place.

https://wiki.freebsd.org/pkgng

this might be more convenient to maintain, actually.

nambrosch avatar Aug 09 '15 04:08 nambrosch

I submited py-ntplib because it's missing in ports collection atm (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202525). I have working port dd-agent localy but I need to make proper config and agent patches. For now I need to manually copy the config and run daemons, but with some help of FreeBSD guys I will have this ready in this month. I'll post shar file when ready if anyone want to test and give a feedback before submited.

urosgruber avatar Sep 05 '15 18:09 urosgruber

@urosgruber did you make any progress? If you have a git repo somewhere, I can check it out. I rolled ports a couple times before.

till avatar Oct 29 '15 11:10 till

I manage to get in the first port. The main dd-agent is almost ready. I can attach patch here and you can try on you end? Btw didn't get finish the starting part. But the build and everything works.

urosgruber avatar Oct 29 '15 11:10 urosgruber

@urosgruber what's missing with the starting part?

till avatar Oct 29 '15 11:10 till

mostly configuration with py-supervisord in case you already have this installed. My first attempt was to go without this initially.

urosgruber avatar Oct 29 '15 12:10 urosgruber

@till I created a repo https://github.com/urosgruber/dd-agent-FreeBSD also there is a new port submission for py-docker (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204162) It's required during build for 5.5.x.

If you can help me with this I would appreciate this on the linked repo. I can open a few issues that I know not done yet.

urosgruber avatar Oct 30 '15 20:10 urosgruber

I am a little confused by the dependency for py-docker. Do you know what that is for?

till avatar Oct 30 '15 20:10 till

No, but It doesn't build unless it's installed. I actually don't anything about docker and would be happy if there is any way around it.

urosgruber avatar Oct 30 '15 20:10 urosgruber

This is the error I get when doing build

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 10, in <module>
    from config import get_version
  File "config.py", line 24, in <module>
    from util import get_os, yLoader
  File "util.py", line 33, in <module>
    from utils.platform import Platform
  File "utils/platform.py", line 5, in <module>
    from utils.dockerutil import get_client
  File "utils/dockerutil.py", line 5, in <module>
    from docker import Client
ImportError: No module named docker
*** Error code 1

https://github.com/DataDog/dd-agent/blob/master/utils/platform.py#L5

urosgruber avatar Oct 30 '15 20:10 urosgruber

I would probably add another patch and return false for def is_ecs_instance(). ECS is probably Elastic Container Service, which is a hosted docker by AWS.

till avatar Oct 30 '15 21:10 till

:+1: I updated port with this patch and it builds successfully now.

urosgruber avatar Oct 31 '15 09:10 urosgruber

Also there is a new PR where I add pkg-message. Could you take a look what would should be added in this file. Also English is not my native so I would appreciate any grammar checks.

urosgruber avatar Oct 31 '15 09:10 urosgruber

@till I updated repo with latest changes I had. So it should install supervisord config as well. Can you try and check if it runs on your end. Use command bellow to run it. I need to make rc.d init script with all the commands.

supervisord -c /usr/local/etc/dd-agent/supervisord.conf -u root

urosgruber avatar Oct 31 '15 16:10 urosgruber

Updated with init script.

urosgruber avatar Oct 31 '15 21:10 urosgruber

@urosgruber is testing this on Monday okay?

On init etc. I haven't seen a port use supervisord to run itself. Seems redundant in a way. But that's too much work to patch. :D I just checked and data dog even uses supervisord via upstart.

On reload: maybe we can use supervisorctl reread or supervisorctl update?

I am also wondering if it should reference supervisord really or use supervisorctl. Just a wild guess, but shouldn't supervisord run by itself (or be enabled via an rc var)? I'll test this tomorrow.

till avatar Oct 31 '15 23:10 till

@till I was also thinking about supervisor. My first attempt was to just copy agent.py to bin and use it in rc.init

About reload. I think it will be released in the next version of dd-agent. it's already in master.

Also one thing I don't like as well is the agent.py and dogstatsd.py creates their pid in /tmp. So I think a bit more patching will be needed :)

urosgruber avatar Nov 01 '15 09:11 urosgruber

@till Did you get a chance to test the port?

urosgruber avatar Nov 04 '15 15:11 urosgruber

@urosgruber Is there a package you guys are testing? I'd be willing to test as well.

evandena avatar Jan 01 '16 02:01 evandena

@evandena can you build from ports yourself? I can create a patch file for you or maybe you can try install from my pkg repo. Still not finished with rc.d

urosgruber avatar Jan 01 '16 14:01 urosgruber

@urosgruber here's where I'm stuck:

===> Generating temporary packing list ===> Creating users and/or groups. ** Cannot find any information about group `datadog' in /usr/ports/GIDs. *** Error code 1

evandena avatar Jan 01 '16 16:01 evandena

You need to add datadog group in /usr/ports/GIDs also need to add user. This needs to be done manually because port is not yet in the system. Just choose on uid and gid that is not yet in the system.

urosgruber avatar Jan 01 '16 18:01 urosgruber

I've updated repo https://github.com/urosgruber/dd-agent-FreeBSD with latest changes. You'll be able to start agent without need for supervisord.

urosgruber avatar Mar 06 '16 17:03 urosgruber

Just opened PR for FreeBSD port https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208560

urosgruber avatar Apr 05 '16 21:04 urosgruber

Using this package, the installed rc.d script for the agent doesn't start dogstatsd.py. Was it left out on purpose? Thanks!

themartorana avatar May 05 '16 03:05 themartorana

@themartorana yes. One reason was dogstatd need to be started with a wrapper, on BSD I think /usr/sbin/daemonwill do the job. The other was more a decision if dogstatd need a special rc.d script or better to include in datadog-agent

I can update the port but I'm waiting for update from python FreeBSD guys what is the best approach on this.

urosgruber avatar May 05 '16 09:05 urosgruber

@themartorana actually ignore the first reason :) ddagent runs in foreground

urosgruber avatar May 05 '16 09:05 urosgruber