Code Monkey home page Code Monkey logo

luet's Introduction

luet - Container-based Package manager

Docker Repository on Quay Build and release on push GoDoc codecov

Luet is a multi-platform Package Manager based off from containers - it uses Docker (and others) to build packages. It has zero dependencies and it is well suitable for "from scratch" environments. It can also version entire rootfs and enables delivery of OTA-alike updates, making it a perfect fit for the Edge computing era and IoT embedded devices.

It offers a simple specfile format in YAML notation to define both packages and rootfs. As it is based on containers, it can be also used to build stages for Linux From Scratch installations and it can build and track updates for those systems.

It is written entirely in Golang and where used as package manager, it can run in from scratch environment, with zero dependencies.

asciicast

In a glance

Install

  • Using official installer script:

    $ curl https://luet.io/install.sh | sudo sh
  • Or using bin

    $ bin i github.com/mudler/luet

Test installation:

$ luet --help
$ luet search ...
$ luet install ..

Documentation

Documentation is available, or run luet --help, any subcommand is documented as well, try e.g.: luet build --help.

Dependency solving

Luet uses SAT and Reinforcement learning engine for dependency solving. It encodes the package requirements into a SAT problem, using gophersat to solve the dependency tree and give a concrete model as result.

SAT encoding

Each package and its constraints are encoded and built around OPIUM. Additionally, Luet treats also selectors seamlessly while building the model, adding ALO ( At least one ) and AMO ( At most one ) rules to guarantee coherence within the installed system.

Reinforcement learning

Luet also implements a small and portable qlearning agent that will try to solve conflict on your behalf when they arises while trying to validate your queries against the system model.

To leverage it, simply pass --solver-type qlearning to the subcommands that supports it ( you can check out by invoking --help ).

Authors

Luet is here thanks to our amazing contributors!.

Luet was originally created by Ettore Di Giacinto, [email protected], [email protected].

License

Luet is distributed under the terms of GPLv3, check out the LICENSE file.

luet's People

Contributors

davidcassany avatar dependabot[bot] avatar frelon avatar geaaru avatar ibuildthecloud avatar itxaka avatar jimmykarily avatar ludea avatar marvinhatesoceans avatar mauromorales avatar mudler avatar santhoshdaivajna avatar trappiz avatar yozachar avatar zdyxry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luet's Issues

Feature: luet uninstall --force

We need a parameter that tells luet to:

  • Uninstall forcefully a package
  • Uninstall only a package without considering their deps (--nodeps)

Package compression

Packages currently are handled as tars, but a compression mechanism that allows to switch between types would be prefered.

Package checksum

The artifact mechanism needs to consume and generate checksums

Add support for downgrade and upgrade of packages with different heuristics

Currently luet upgrade upgrades a system to the latest available packages, not taking care of downgrades of any sort. E.g. if a package is downgraded from a repository, the client will refuse to downgrade to that version, but will prefer the local installed one.

The idea is to implement a command like luet upgrade --purge/--sync for:

  • permit downgrade of packages related to a removed repository (example: foo-1.0@removed-repo and foo-0.2.0@active-repo)

  • permit downgrade of packages no more available from a specific repository for an error server side

  • permit to upgrade of packages with the same version but with different build date (an option could be --sync-by-date)

Feature: luet database

We should have a command to:

  • Remove packages from system forcefully (delete only the entry from DB if necessary, with --force flag)
  • Add packages in system forcefully (even accepting the metadata yaml as source, with a list of e.g. files that belongs to the package)

Feature: luet reinstall

We should handle reinstalls as well by cli, the mechanism is not exposed yet to the CLI.

Equivalent to: luet replace pack --for pack --nodeps

luet search --installed shows the same package

With luet 0.5 luet search --installed . shows always the same entry of the packages installed:


$ sudo LUET_NOLOCK=true luet install system/luet-develop system/container-diff
 Using config file: /etc/luet/.luet.yaml
 Parsing Repository Directory /etc/luet/repos.conf.d ...
๐Ÿšง   Skip dir /etc/luet/repos.conf.d : open /etc/luet/repos.conf.d: no such file or directory
 Sync of the repository main in progress...
 Downloading http://127.0.0.1:8000/repository.yaml
 Downloaded repository.yaml of 0.02 MB ( 24.10 MiB/s )
 Downloading artifact tree.tar.gz from http://127.0.0.1:8000
 Downloaded tree.tar.gz of 0.00 MB ( 2.90 MiB/s )
 Copying file  /tmp/tree018908402/tree.tar.gz to /luet/var/luet/db/packages/tree.tar.gz
 Tree tarball for the repository main downloaded correctly.
 Decompress tree of the repository main...
 ๐Ÿ   Repository main revision: 25 - 2020-02-08 17:02:12 +0100 CET
 Use artifact luet-develop-system-0.5.package.tar.gz from cache.
 Use artifact container-diff-system-0.15.0.package.tar.gz from cache.


$ sudo LUET_NOLOCK=true luet search --installed .
 Using config file: /etc/luet/.luet.yaml
 Parsing Repository Directory /etc/luet/repos.conf.d ...
๐Ÿšง   Skip dir /etc/luet/repos.conf.d : open /etc/luet/repos.conf.d: no such file or directory
 ๐Ÿ“ฆ  system luet-develop 0.5
 ๐Ÿ“ฆ  system luet-develop 0.5


Feature: luet box

As for now, it's easy to compose a new rootfs formed from different specfiles.
The PM can already assemble the image in a portable fashion.

E.g.

 luet build ..

 luet install --system-target /foo --system-db /foo/luet.db

The proposal is to combine in a 'wrapper around' way luet box:

  • luet box create "foo" --packages <pkg1> --packages <pkg2>: It creates a
    new box from the given packages. It merely installs on a pre-defined folders
    and reassembles the image
  • luet box delete "foo": delete the box
  • luet box install "foo" <pkg1> <pkg2>: Install packages in the box
  • luet box uninstall "foo" <pkg1> <pkg2>: Uninstall packages in the box
  • luet box upgrade "foo": Upgrades packages in the box
  • luet box run "foo" /my/command: Execute a command in a box
  • luet box shell "foo": Opens up an interactive shell in the box

Note:
To achieve this there is only a functional limitation. The implementation must
provide also a way for finalizers to perform commands in the given
environment(box).

Optimize build cache

We do perform operations that can be skipped in local iterations (e.g. export of image if no changes are detected, etc)

RFC: security

Like for equo sec oscheck could be cool have a features that check the checksum of the files of a specific package

Add --revdeps to build

Build needs also optionally to compute the revdeps and compile them in parallel. We need to have a flag to build which enables this.

Compile should have a wrapper which calculate the revdeps of the packages that will be built, and compile them afterwards.

Package variables for build steps

It would be handy to have some vars pre-populated (such as the package version) and some that the user can define in the build specs

Feature: luet search --revdeps

We have to expose as a flag to the search subcommand the -revdeps option. In this way we can let the user build a list of packages that depends on a specific one.
The feature is already present, each package returns its tree by calling

Revdeps(PackageDatabase) []Package
.

This issue is to expose the feature to the cli and allow for e.g. to : luet search --revdeps <A1>

RFC: Client database

For trace installed/available packages we need a system from client side. The idea is to use a NoSQL/K-V database.
Here, the possibilities are:

Feature: luet install --force

We need a parameter that tells luet to:

  • Install forcefully a package
  • Install only a package without considering their deps (--nodeps)
  • Install only the package deps (--onlydeps)

Feature: luet oscheck

Luet should track also the content of the files which are installed, storing a checksum internally. In this way we can build a command oscheck that:

  • Can compare the checksum in the db with the system command
  • Build a list of packages that can be reinstalled to recover the system

RFC: Client/Server Configuration

Integrate support of Viper/Cobra configuration for both client and build packages commands.

Format supported is YAML (or viper supported format):

Example of a configuration for the client:

logging:
   path: /var/log/luet/luet.log
   level: "info"

general:
   concurrency: 4
   # debug: false

# Environment options are usable
proxy:
    http: xxx
    https: xxxx
    ftp: xxx

cache_repositories:
    -  name: "Local cache node2"
       priority: 3
       mode: "ro"
       urls:
          -  https://mynode2.local/
       type: "http"
       # auth:

    -  name: "Local cache node1"
       priority: 2
       mode: "rw"
       urls:
          -  https://mynode1.local/
       type: "http"
       # auth:
   -  name: "Local dir"
      type: "dir"
      mode: rw
      priority: 1
      path: "/var/cache/luet/"

# Repositories where fetch tree and packages could be defined in the main
# configuration file or under a specific directory.
system_repositories:
    - name: "repo1"
      descr: "Repository 1"
      type: "disk"
      # Optional URL where retrieve API Repository server (that uses same auth credentials)
      api: "https://myrepo.server.org/repo1"
      path: "/mypath/repo1"
      priority: 1
   -  name: "repo2"
      descr: "Repository 2"
      type: "http"
      urls:
         -  "https://myrepo.org/repo2"
         -  "https://mirror.myrepo.org/repo2"
      priority: 2
      auth:
          # Token key (for example Mottainai Api key)
          token: "xxxxxxx"
          # Basic authentication
          #  username: "user"
          # password: "pwd"

List of repositories could be defined under the directory /etc/luet/repositories.d/ in yaml:
Example of repo1:

# cat /etc/luet/repositories.d/repo1.yaml

name: "repo1"
descr: "Repository 1"
type: "disk"
path: "/mypath/repo1"
# type: "http"
# urls:
#   - "https://myrepo/repo1"
priority: 1
enable: true
auth:
   # Token key (for example Mottainai Api key)
   token: "xxxxxxx"
   # Basic authentication
   #  username: "user"
   # password: "pwd"

RFC: Fetching module

Hereinafter, the list of features to implement:

  • Local repositories

  • HTTP/HTTPs repositories

  • Integrate support of aggregate download per repository

  • Integrate support of custom Authentication support (Basic, Token, etc.)

  • Fetching packages from multiple sources (FTP, HTTP, Object Store, Directory)

  • Support incremental download for package revisions

  • Support Proxy Configuration

  • Support --fetchonly option for prepare cache directory to use in offline env

  • Mirror list for repository must be a separated file more easy to update through a package

  • Integrity check / packages verification

Feature: luet tree search

We should have a way to package tree definitions, or alternatively track them from remote urls (git style).
In this way we can cache trees locally, sync them, and make the CLI experience a bit smoother by dropping the tree as a needed option (for create-repo, and build)

Setup tests for load testing

We should have a test suite (integration?) to test building packages from tree converted from Portage.

It is a really good use case to test building load, and performance regression for the SAT solver

Optimize dependencies building of a group of targets

We need to optimize build dependencies which are shared between targets, maybe by also building them before and then start the concurrent builds. we cannot miss --nodeps and --depsonly on the build command while developing this feature.

  • build --nodeps A B C
  • build --onlydeps A B C
  • build --shared A B C (builds the shared deps first, then builds the other concurrently, which probably should be default behavior that can be turned off)
  • We should build first those that have no revdep

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.