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

Static x86_64 builds #1

Open
philwhineray opened this issue Feb 10, 2017 · 2 comments
Open

Static x86_64 builds #1

philwhineray opened this issue Feb 10, 2017 · 2 comments

Comments

@philwhineray
Copy link
Member

I have added a static x86_64 build using alpine and linux in commit 05f7bcb which can be the foundation for some generic packaging.

@ktsaou I will not have any more time to work on this until next week at the earliest but the binaries are built statically and appear to run as expected.

If you follow the readme instructions you should be able to get the build-x86_64-static.sh to run without much trouble.

The result of make install currently goes to build/x86_64-static/netdata/opt on the host, given the prefix used for configure and the DESTDIR for make install within the container.

What is left to do:

  1. Update x86_64-static/netdata/docker-build.sh to make a package of some kind and settle any options to ./configure.
  2. Update build-x86_64-static.sh to copy the packages from under build/x86_64-static/netdata on the to the output/packages folder.
  3. Wait until a master build succeeds on travis
  4. Create a tag and watch the results appear in a github release!

Of these, 1 is almost all of the work, of course...

@ktsaou
Copy link
Member

ktsaou commented Feb 12, 2017

This is very nice! I used it and it is awesome!
Very nice work!

In order for a static netdata to be installed, I guess the following have to be made:

  1. Add user netdata to the system
  2. Add group netdata to the system
  3. Add user netdata to various groups that might already exist to the system (docker, varnish, nginx, haproxy, adm)
  4. Install logrotate file
  5. Install systemd service or init file
  6. Chown/chmod netdata files
  7. setcap or setuid to root apps.plugin
  8. If the installation path already has a netdata installation, check all the config files and keep the ones that have been edited.
  9. generate the netdata-uninstaller.sh script
  10. generate the netdata-updater.sh script

All the above, in addition to compiling netdata are handled by netdata-installer.sh, so I'll split it in 2 parts to avoid having to maintainer 2 installers.

Questions:

  1. netdata requires fping 3.15+ to run (the nice folks at fping accepted my PR, so fping can become a netdata plugin!). I guess we can compile fping the same way and install it in /opt/netdata.

  2. Shall we link netdata to /usr/sbin/netdata, /etc/netdata to /opt/netdata/etc/netdata ? This will allow people to use the same instructions found everywhere...

  3. I would love to ship firehol, fireqos, iprange and the rest of our tools with this binary release.

  4. I would love people to install netdata with just a curl command. So, the flow could be something like this:

    1. curl installer.sh >/tmp/netdata.sh && sh /tmp/netdata.sh - this script will just run uname -m to get the machine architecture and uname -s to find the kernel type (linux, freebsd, etc) and will execute:
    2. curl installer-${ARCH}-${KERNEL}.sh >/tmp/netdata-${ARCH}-${KERNEL}.sh && sh /tmp/netdata-${ARCH}-${KERNEL}.sh. This one will be the binary release, built with makeself.
    3. makeself should be instructed to unzip the file in /opt/netdata and call /opt/netdata/installer/makeself-installer.sh which will execute the 10 steps I described at the beginning.
    4. special care has to be given to etc/ directory. I think we should ship it as etc.new/ and the installer will copy the files while keeping the ones that have been edited by the user.

@philwhineray @simonnagl what do you think?

@simonnagl
Copy link
Member

Sounds reasonable to me. Let's mention that I have no experience with makeself.

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

3 participants