-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Detect in kickstart script if we publish native packages for the platform #21262
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
base: master
Are you sure you want to change the base?
Conversation
…form. This allows more intelligent fallback behavior, insisting on using native packages if they are being published (and are actually available) and only falling back if they aren’t. It also means that users installing on platforms we still have packages available for but no longer publish packages for will end up with static installs instead of native package installs. This change includes a new option for the kickstart script called `--install-type`, which can be used to specify the install type to use. It supports five possible values currently, `native`, `static`, `build`, `auto`, and `any`. The first three are equivalent to the existing `--native-only`, `--static-only`, and `--build-only` options. The `any` value indicates to use our existing fallback behavior (try each install type in order until we find one that works). The `auto` value, which is the new default, acts like `native` if the script detects that we publish native packages for the platform, and `any` otherwise. This is dependent on a flag file on the repository server that is generated by our package upload processing code for platforms that we publish native packages for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the installer script to rename NETDATA_FORCE_METHOD to NETDATA_REQUESTED_INSTALL_TYPE for improved clarity, and adds a new --install-type option along with enhanced logic to detect whether native packages are published for a platform.
Key changes:
- Renames
NETDATA_FORCE_METHODvariable toNETDATA_REQUESTED_INSTALL_TYPEthroughout the script - Adds support for
autoandanyas new install type values - Implements a check for whether native packages are currently published for a platform
- Adds a new
--install-type <type>option to the help documentation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --native-only Only install if native binary packages are available. | ||
| --static-only Only install if a static build is available. | ||
| --build-only Only install using a local build. | ||
| --install-type <type> Specify what installation type to use (native, static, build, auto, or any). |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --install-type option is documented in the help text, but there is no corresponding handler in the parse_args() function (around lines 2547-2549 where other similar options are parsed). Users attempting to use --install-type <type> will encounter an 'Unrecognized option' fatal error. Add a case handler in parse_args() to accept this option and set NETDATA_REQUESTED_INSTALL_TYPE to the provided value, along with validation to ensure the value is one of: native, static, build, auto, or any.
packaging/installer/kickstart.sh
Outdated
| *) warning "Could not install native binary packages, falling back to alternative installation method." ;; | ||
| case "${NETDATA_REQUESTED_INSTALL_TYPE}" in | ||
| native|auto) fatal "Could not install using native binary packages. If you want to install anyway, re-run this script with the option --install-type=any" F0301 ;; | ||
| *) warning "Could not using install native binary packages, falling back to alternative installation method." ;; |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected grammatical error from 'Could not using install' to 'Could not install using'.
| *) warning "Could not using install native binary packages, falling back to alternative installation method." ;; | |
| *) warning "Could not install using native binary packages, falling back to alternative installation method." ;; |
With this change, the script now also checks for the presence of repository metadata for the repository that would be used to install Netdata. If the other checks pass but this one fails, a different error message is show indicating that packages aren’t available yet, but will be soon, with the stable install message providing info on how to install anyway.
Summary
This allows more intelligent fallback behavior, insisting on using native packages if they are being published (and are actually available) and only falling back if they aren’t. It also means that users installing on platforms we still have packages available for but no longer publish packages for will end up with static installs instead of native package installs.
This change includes a new option for the kickstart script called
--install-type, which can be used to specify the install type to use. It supports five possible values currently,native,static,build,auto, andany. The first three are equivalent to the existing--native-only,--static-only, and--build-onlyoptions. Theanyvalue indicates to use our existing fallback behavior (try each install type in order until we find one that works). Theautovalue, which is the new default, acts likenativeif the script detects that we publish native packages for the platform, andanyotherwise.The actual checking done for
autoinvolves confirming that:.github/data/distros.yaml).If either of the first two checks fail when in
automode, the install itself will fall back to using static builds like it does currently.If the third check fails when in
automode, the install will fail with an error message indicating that packages have not yet been published for this platform, but are expected to be published soon. For nightlies it asks the user to try again tomorrow (which will almost always work), while for stable builds it suggests the possibility of using a nightly build or a static build for the install.If all three checks pass when in
automode but the package install fails, the install will fail with an error message indicating that the package couldn’t be installed despite appearing to be available, and suggests that the user should look into what’s wrong with their system, or try withanymode to install regardless.Test Plan
Requires some manual testing to confirm that the changes behave as expected.