dd-agent
dd-agent copied to clipboard
FreeBSD package for datadog-agent
Presumably using pkg_create.
@loris @PFdB Any input for this? How do you package our agent?
http://www.freebsd.org/doc/en/articles/contributing-ports/article.html
I could try to make a port but I would need more details about all the dependencies and special steps for installation.
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.
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 did you make any progress? If you have a git repo somewhere, I can check it out. I rolled ports a couple times before.
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 what's missing with the starting part?
mostly configuration with py-supervisord in case you already have this installed. My first attempt was to go without this initially.
@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.
I am a little confused by the dependency for py-docker. Do you know what that is for?
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.
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
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.
:+1: I updated port with this patch and it builds successfully now.
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.
@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
Updated with init script.
@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 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 :)
@till Did you get a chance to test the port?
@urosgruber Is there a package you guys are testing? I'd be willing to test as well.
@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 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
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.
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.
Just opened PR for FreeBSD port https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208560
Using this package, the installed rc.d script for the agent doesn't start dogstatsd.py. Was it left out on purpose? Thanks!
@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.
@themartorana actually ignore the first reason :) ddagent runs in foreground