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

feat: extended linux package support #2138

Merged
merged 6 commits into from
Aug 10, 2023
Merged

Conversation

reubenmiller
Copy link
Contributor

Proposed changes

Add support for the following linux packages:

  • apk (Alpine Linux, used a lot when building docker images)
  • deb (Debian, this already existing)
  • rpm (RHEL/CentOS/Fedora/OpenSUSE/Rockylinux)
  • tarball (tar.gz file containing just the thin-edge.io binaries)

Try out the new installation method (for test purposes only)

Packages for armv7, aarch64 and x86_64 were published to a development repository to test out the new installation script. You can test it out for yourself using the following command:

curl -fsSL https://thin-edge.io/install.sh | sudo sh -s

If you don't have sudo installed and are running it as root, then you can drop the sudo part.

curl -fsSL https://thin-edge.io/install.sh | sh -s

Key Changes

  • Switch from cargo-deb to nfpm
  • Generate package type: apk, rpm, deb and tarballs
  • Include virtual packages (e.g. tedge-full and tedge-minimal) to make it easier for users to install all the thin-edge.io components (and make future renaming of some packages much easier)
  • Publish all packages (including tarballs) to the Cloudsmith repository (thanks to our generous OSS sponsors Cloudsmith)
  • New install.sh script which installs thin-edge.io from the Cloudsmith repositories and falls back to installing the tarballs if no package manager is found (though currently it only installs the latest version, and can't be used to install a specific version)

Note

Currently the integration tests (tests/RobotFramework/tests/installation/install_on_linux.robot) which test the installation using the install.sh script are not run automatically. The tests can be run on demand during QA. This is because the tests require the packages to be already published to the cloudsmith repo. In addition some docker related networking issues seem to cause the tests to be unreliable.

Minor changes

  • Use packaging to handling adding and removing symlinks (reduces logic required in maintainer scripts)
  • maintainer scripts are always created, even if they are doing essentially nothing. This is to enable usage of fixed scripts, otherwise the nfpm configuration would have to be made dynamic (which would further complicate things)
    • preinst, postinst, prerm nad postrm
  • offload service management to the linux scripts/snippets (e.g. systemd enable/restart etc.). Avoid where possible to add systemd specific commands in the common maintainer script snippets
  • rpm package uses a systemd preset file to control which services should be enable and disabled by default. This is preferred as it allows users to also control it using the systemd presets mechanism
  • Remove usage of pre-depends dependency as it is harder to maintain across different package formats and is generally less flexible
  • Move suggested packages from the thin-edge components to the virtual packages
  • Decoupling tedge-agent to the c8y-bridge configuration by removing the conditional logic where the service was only started if the c8y-bridge.conf file existed.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@reubenmiller reubenmiller added theme:packaging Theme: Packaging and release artefact topics improvement User value theme:installation Theme: Installation topics labels Aug 9, 2023
@reubenmiller reubenmiller temporarily deployed to Test Pull Request August 9, 2023 11:38 — with GitHub Actions Inactive
@reubenmiller
Copy link
Contributor Author

The integration tests needed to be triggered manually due to a change in the workflow, the integration test result is visible here: https://github.com/thin-edge/thin-edge.io/actions/runs/5808419548

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

  • just release produces the expected packages.
  • The integration tests are green (when launched manually).

@reubenmiller reubenmiller temporarily deployed to Test Pull Request August 9, 2023 19:06 — with GitHub Actions Inactive
@reubenmiller reubenmiller force-pushed the feat-linux-packaging branch 2 times, most recently from cb44875 to feedcf3 Compare August 10, 2023 10:06
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #2138 (3d1828c) into main (e482390) will increase coverage by 0.0%.
Report is 1 commits behind head on main.
The diff coverage is n/a.

❗ Current head 3d1828c differs from pull request most recent head aa33154. Consider uploading reports for the commit aa33154 to get more accurate results

Additional details and impacted files

see 6 files with indirect coverage changes

@reubenmiller reubenmiller temporarily deployed to Test Pull Request August 10, 2023 14:21 — with GitHub Actions Inactive
@reubenmiller
Copy link
Contributor Author

The integration tests were manually triggered on the server and the results are viewable here:
https://github.com/thin-edge/thin-edge.io/actions/runs/5822207126/job/15786757181

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement User value theme:installation Theme: Installation topics theme:packaging Theme: Packaging and release artefact topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants