Giter Site home page Giter Site logo

Comments (8)

jsternberg avatar jsternberg commented on July 18, 2024 1

This might be a crazy idea, but is there a way we could add either as a feature in the dockerfile or a feature to telegraf to attempt an install of uninstalled tools? Maybe add it as an optional feature that is enabled in the docker version.

If telegraf could say, "I'm on debian, let me try to install the tool automatically with apt-get" then that would solve this issue and it seems like an optional feature that could be added to certain plugins. That way, I could just say, "Enable automatic installation through an environment variable" and a user wouldn't have to worry about adding an extra layer unless they wanted more efficiency through layer caching.

How difficult would that be to add to the plugin interface, advertise it, and then tell people to contribute to plugins for auto installation?

from influxdata-docker.

danielnelson avatar danielnelson commented on July 18, 2024 1

I wouldn't be opposed to the idea @ackstorm23 suggested, where an environment variable could trigger docker run to install dependencies before running telegraf, but I wouldn't want this to be part of telegraf itself. What do you think about this idea @gianarb?

from influxdata-docker.

gianarb avatar gianarb commented on July 18, 2024 1

Hello

It looks a good approach, probably we can use a bash script as a command:

CMD ["./entrypoint.sh"]

The entrypoint.sh is executed every run, it means that we can check OS and install what we need. We can also set envars or change the arguments that we use to configure influxd.

The bad point here is only the time required to run a container, it depends on the complexity of the entrypoint.sh script.

from influxdata-docker.

danielnelson avatar danielnelson commented on July 18, 2024

Would it solve your problem if instead of adding this tool to the image, you created a new layer on top of the image with the ipmi tools?

See also #11

from influxdata-docker.

ackstorm23 avatar ackstorm23 commented on July 18, 2024

That may work, though you will continue to find users who are looking to have not have to create their own layers to make it work. They want telegraf (and it's featureset) to "just work".

Based on the influxdb docker, I was hoping there would be similar intent where you can specify
" -e INFLUXDB_GRAPHITE_ENABLED=true" to enable a normally disabled part of the application.

https://hub.docker.com/_/influxdb/

Would it not also be possible to add "TELEGRAF_IPMI_SENSOR_ENABLED=false" as a default, and allow users to opt-in with =true? This would be a big time saver for anyone looking to use the docker image with the IPMI plugin, no fuss.

If you dont opt-in, the package is skipped, keeping the docker image compact.

If you dont want to manage the remote retrieval of IPMI then allow us to specify "TELEGRAF_IPMITOOL_PKG_URL=http://whatever" and we can update it ourselves if the package url changes.

from influxdata-docker.

danielnelson avatar danielnelson commented on July 18, 2024

I am assuming the InfluxDB option simply enables the service within the configuration file. Are you suggesting that part of the docker run step would include fetching and installing the ipmi tools before starting Telegraf?

One thing to keep in mind is that many plugins require external tools, and it is probably not feasible to provide support for all of them.

from influxdata-docker.

jcberthon avatar jcberthon commented on July 18, 2024

You can effectively add the installation steps inside the entrypoint.sh shell but this has the following shortcomings:

  • each time the container is recreated, the install could pick up a different version of the plugin. Hence for repeatability this is not best.
  • after a container creation, it will takes several seconds (more likely minutes) in order to install the plugins and before telegraf is actually run. Users might be surprised.
  • Adding that many steps which could fail (no internet connection, etc.) before telegraf is actually run could give a wrong impression of the quality of telegraf to users

I understand that the easiest it is the better sometimes, but in this case I'm more a proponent of good documentation which would tell users: if you want to use ping, ntp, ipmi, etc. you need to install the dependencies iputils-ping, ntp, ipmi_sensor, etc. respectively. And show users how to do it, example (for ntp + ping inputs plugins):

FROM telegraf:1.4.0

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ntp iputils-ping \
    && apt-get clean -q \
    && rm -Rf /var/lib/apt/lists/*

Currently that my setup at home. I have a small GitLab CI job which builds automatically for me the image each time I change the base image. And I can trigger an Ansible role which does the deployment on my machines. Example Ansible:

- name: (re-)Create telegraf container
  become: true
  docker_container:
    detach: yes
    image: "gitlab-registry.lan.berthon.eu/infra/services/telegraf:{{ ansible_date_time.date | regex_replace('-') }}"
    memory: 512MB
    memory_swap: 1GB
    name: telegraf
    restart_policy: always
    restart_retries: 3
    state: started
    volumes:
      - /var/etc/docker/telegraf/config/:/etc/telegraf/:ro

from influxdata-docker.

powersj avatar powersj commented on July 18, 2024

Hi,

Going through older issues.

As stated above, a user will need to install the software they need and the example Dockerfile above is a great start for anyone coming along to figure this out.

Closing this one out. Thanks!

from influxdata-docker.

Related Issues (20)

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.