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

community integration build fails with: config file not found #4142

Open
landorg opened this issue Sep 11, 2019 · 6 comments
Open

community integration build fails with: config file not found #4142

landorg opened this issue Sep 11, 2019 · 6 comments

Comments

@landorg
Copy link

landorg commented Sep 11, 2019

Describe what happened:
Tried to build an agent with a community integration installed as described here: https://docs.datadoghq.com/agent/guide/community-integrations-installation-with-docker-agent/?tab=docker

Step 13/14 : RUN agent integration install -r -w /dist/*.whl
 ---> Running in 2a91392d199c
Cannot setup config, exiting: unable to load Datadog config file: Config File "datadog" Not Found in "[/etc/datadog-agent]"Error: unable to load Datadog config file: Config File "datadog" Not Found in "[/etc/datadog-agent]"
Usage:

Describe what you expected:
successful build

Steps to reproduce the issue:
Dockerfile:

FROM python:2.7 AS wheel_builder
WORKDIR /wheels

RUN pip install "datadog-checks-dev[cli]"
RUN git clone https://github.com/DataDog/integrations-extras.git

RUN ddev config set extras ./integrations-extras
RUN ddev -e release build redis_sentinel

FROM datadog/agent:latest
COPY --from=wheel_builder /wheels/integrations-extras/redis_sentinel/dist/ /dist
RUN agent integration install -r -w /dist/*.whl

docker build .

Workaround:
Dockerfile:

...
COPY --from=wheel_builder /wheels/integrations-extras/redis_sentinel/dist/ /dist

RUN mkdir -p /dd
RUN /bin/cp /etc/datadog-agent/datadog-kubernetes.yaml /dd/datadog.yaml

RUN agent integration install -r -c /dd -w /dist/*.whl
RUN rm -r /dd
@gjwnc
Copy link

gjwnc commented Oct 3, 2019

I have the same issue and had a look at a running datadog container without integrations. It seems, that datadog symlinks the /etc/datadog-agent/datadog-docker.yaml to /etc/datadog-agent/datadog.yaml at container up.

In my case I just symlinked during build and removed the link afterwards, e.g. for the ping integration:

RUN ln -s /etc/datadog-agent/datadog-docker.yaml /etc/datadog-agent/datadog.yaml && \
         agent integration install -r -w /integrations-extras/ping/dist/*.whl && \
         rm /etc/datadog-agent/datadog.yaml

Note: I'm actually using RUN build.sh with a custom script, so above example might have wrong syntax, but the idea is just symlinking and then removing again.

@mataberat
Copy link

Is this issue has been resolved?

@landorg
Copy link
Author

landorg commented Jan 14, 2020

no but the workaround from @gjwnc works. Maybe add it to the docs or sth

@mataberat
Copy link

no but the workaround from @gjwnc works. Maybe add it to the docs or sth

It also works on my side.

I adding this line

COPY datadog.yaml.example /etc/datadog-agent/datadog.yaml

@ngraef
Copy link

ngraef commented Nov 10, 2020

This was fixed in agent v7.23.0/6.23.0. You can now do RUN agent integration install [...] without first copying or symlinking a config file.

@gjwnc
Copy link

gjwnc commented Dec 2, 2020

I tried to update the docker container we used and I could not install the integrations in an agent v6.23.1 container.

The reason seems to be that datadog-checks-dev is not compatible with python 2.7 because the python code uses f-string formating which is a python 3 feature.

The following Dockerfile builds successfully:

FROM datadog/agent:7.23.1

RUN mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf.bak
RUN apt-get update && apt-get install -y iproute2 net-tools git iputils-ping
RUN mv /etc/ssl/openssl.cnf.bak /etc/ssl/openssl.cnf

RUN pip3 install "datadog-checks-dev[cli]"

RUN git clone https://github.com/DataDog/integrations-extras.git

RUN ddev config set extras /integrations-extras
RUN ddev -e release build ping

RUN agent integration install -r -w /integrations-extras/ping/dist/*.whl

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

No branches or pull requests

5 participants