Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dd agent #23682

Closed
wants to merge 2 commits into from
Closed

Update dd agent #23682

wants to merge 2 commits into from

Conversation

mbbx6spp
Copy link
Contributor

Motivation for this change

dd-agent is currently broken on master and 17.03. This happened when this PR was merged, this broke dd-agent's dependency on docker python package in NixOS (it depends on 1.10.x, and 2.x changes symbols around): https://github.com/NixOS/nixpkgs/pull/22201/files

I also added missing python package dependencies in dd-agent for python-etcd and consul.

As a separate commit I also updated the dd-agent package sources from 5.5.2 -> 5.11.2 and create appropriate git logs as per contributing guide for each.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Output from nox-review:

<redacted>
Result in /run/user/1000/nox-review-0i73b82r
total 0
lrwxrwxrwx 1 spotter users 67 Mar  9 20:42 result -> /nix/store/1374i67agihx6n5c1374awvsr08l77rf-python2.7-docker-1.10.6
lrwxrwxrwx 1 spotter users 59 Mar  9 20:42 result-2 -> /nix/store/m2kbqm0l4xqy3bzvngacvraaj6l6978g-dd-agent-5.11.2
lrwxrwxrwx 1 spotter users 67 Mar  9 20:42 result-3 -> /nix/store/wpmiy1wckhmj12zg0m8idg01z5pkpwkf-python3.5-docker-1.10.6

@mention-bot
Copy link

@mbbx6spp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @offlinehacker, @rbvermaa, @edolstra and @FRidh to be potential reviewers.

@FRidh
Copy link
Member

FRidh commented Mar 10, 2017

Thanks. Could you put the docker_1_10.nix expression in pkgs/tools/networking/dd-agent/ and import it straight into the dd-agent expression? As long as there's no other applications that need that specific version I don't think we should make it public.

@mbbx6spp
Copy link
Contributor Author

mbbx6spp commented Mar 10, 2017

Thanks for the speedy review. @FRidh I kept the two commits format of the PR, both should still work as expected. I removed the older pythonPackages.docker_1_10 package from being public and embedded in the package lambda's let. Let me know if there are any other changes.

As a last sanity check I did the following:

  1. I removed docker_1_10 from buildInputs list in the dd-agent package lambda.
$ dd-agent -h
Traceback (most recent call last):
  File "/nix/store/g4xqhraqc3q78yp2a639v6j9yrbjmpwh-dd-agent-5.11.2/bin/.dd-agent-wrapped", line 13, in <module>
    from config import get_version, initialize_logging  # noqa
  File "/nix/store/g4xqhraqc3q78yp2a639v6j9yrbjmpwh-dd-agent-5.11.2/agent/config.py", line 29, in <module>
    from utils.service_discovery.config import extract_agent_config
  File "/nix/store/g4xqhraqc3q78yp2a639v6j9yrbjmpwh-dd-agent-5.11.2/agent/utils/service_discovery/config.py", line 9, in <module>
    from utils.service_discovery.sd_backend import SD_BACKENDS
  File "/nix/store/g4xqhraqc3q78yp2a639v6j9yrbjmpwh-dd-agent-5.11.2/agent/utils/service_discovery/sd_backend.py", line 9, in <module>
    from utils.service_discovery.sd_docker_backend import SDDockerBackend
  File "/nix/store/g4xqhraqc3q78yp2a639v6j9yrbjmpwh-dd-agent-5.11.2/agent/utils/service_discovery/sd_docker_backend.py", line 10, in <module>
    from docker.errors import NullResource, NotFound
ImportError: No module named docker.errors
?=1 | Error
  1. Added it back:
$ vim pkgs/tools/networking/dd-agent/default.nix
?=0 | OK

$ nix-env -f . -iA dd-agent
replacing old ‘dd-agent-5.11.2’
installing ‘dd-agent-5.11.2’
?=0 | OK

$ dd-agent -h
Please supply a configuration file at /etc/dd-agent/datadog.conf or in the directory where the Agent is currently deployed.
?=3 | Error

@FRidh
Copy link
Member

FRidh commented Mar 10, 2017

Thank you. I've pushed this to master. I made some minor changes in 35f9f63. While in Nixpkgs we typically pass in individual packages, in the case of Python we pass the whole package set in order to prevent any accidental mixing.

@FRidh FRidh closed this Mar 10, 2017
@mbbx6spp
Copy link
Contributor Author

Any chance it can get backported to 17.03?

@FRidh
Copy link
Member

FRidh commented Mar 10, 2017

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants