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

Deploy remote rework #536

Closed

Commits on Dec 17, 2021

  1. src: deploy: Apply code pattern to basic functions

    We are trying to make the kw follow some basic patterns. For this
    reason, this commit creates the deploy_main function and moves the parse
    function to the bottom of the file.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    5d5ec57 View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2021

  1. src: deploy: Update deploy paths

    This commit is preparation work to make the deploy feature slightly more
    generic by using better paths. Additionally, it moves those paths to a
    set of variables that can be easily updated, enabling us to give the
    user the option to set up the path they want in the config file.
    
    Closes: kworkflow#470.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Dec 31, 2021
    Configuration menu
    Copy the full SHA
    8ecdbbd View commit details
    Browse the repository at this point in the history
  2. src: deploy: Introduce automatic setup to the target machine

    Currently, kw expect that users conduct the following basic setup in the
    target machine:
    
    1. Setup ssh connection to the root
    2. Install required package (such as rsync)
    3. Run any specific distro setup
    
    This commit introduces the `deploy --setup`, which will run all of the
    above basic configurations in the target machine. Now, the user only
    needs to guarantee the ssh via password the first time.
    
    Closes: kworkflow#481.
    Closes: kworkflow#220.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Dec 31, 2021
    Configuration menu
    Copy the full SHA
    5449e72 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2022

  1. src: plugins: kernel_install: Introduce bootloader helper

    We want to make our deploy more generic, and one step for achieving this
    goal consists in adding bootloader detection. This commit introduces a
    function for handling the device and partition discovery which can be
    used to identify the disk bootloader and even provide essential info to
    users.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    bc04c4b View commit details
    Browse the repository at this point in the history
  2. src: plugins: kernel_install: Add helper to identify available disks

    This commit introduces a helper that identifies all hard disk types
    available in the system and saves them in a list. This can be useful for
    scanning each of the devices available in the system.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    18a8a2b View commit details
    Browse the repository at this point in the history
  3. src: plugins: kernel_install: Add helper to detect partition type

    If the target system uses MBR, there is a good chance that the first 4
    bytes inform the partition table type. For this reason, this commit
    introduces a function that checks those bytes. It is important to
    highlight that we also added a couple of binary files to the sample
    folder for validating the new function and other news that will be
    implemented.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    0b84cdf View commit details
    Browse the repository at this point in the history
  4. src: plugins: kernel_install: Inspect MBR partition helper

    This commit introduces a new function that tries to identify the
    bootloader information based on the MBR partition. Notice that this is
    heavily inspired in the bootscriptinfo.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    9e586dc View commit details
    Browse the repository at this point in the history
  5. src: plugins: kernel_install: Add bootloader dection function

    Based on the standard set of files used by some bootloader this commit
    introduces a dedicated function for searching for these files and report
    the bootloader type.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    877bf07 View commit details
    Browse the repository at this point in the history
  6. src: deploy: collect info function

    This function is responsible for collecting basic information from the
    target machine in order to provide data that kw can use to check if it
    can deploy the new kernel.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    24c8216 View commit details
    Browse the repository at this point in the history
  7. src: plugins: kernel_install: Isolate bootloader logic

    kw deploy has to deal with generating rootfs and bootloader updates.
    Unfortunately, the logic that handles the kernel update is very tangled
    and mixes multiple steps spread around kernel plugin functions. This
    commit starts to untangle this code by decoupling:
    
    1. Bootloader logic;
    2. Specific bootloader file type (e.g., now we have grub.sh);
    3. Move specific logic for generating rootfs to the distro file (e.g.,
       arch.sh or debian.sh);
    4. Isolate VM updates in their specific functions;
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    1406f42 View commit details
    Browse the repository at this point in the history
  8. src: plugis: kernel_install: Fix vm deploy

    While conducting this massive code refactor, I took the strategy of
    first focusing on local and remote deploy even if it means breaking vm
    support. This commit represents a fix to the vm deploy, which means that
    kw vm is working again for Debian and Arch VM. Note that we still need
    to bring much more improvements to the VM parts; this commit is far away
    from being ideal for vm deploy.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    c3d5c8a View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2022

  1. tests: deploy_test: Rework tests

    The deploy test is one of the oldest files that we have inside kw, and
    it has a lot of technical debt. This commit is mostly focused on
    modernizing this test by cleanup and reorganizing it.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    9717f1b View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2022

  1. tests: deploy_test: Increase test coverage

    Our deploy code is not very well covered, and the tests have technical
    debt. This commit is mostly focused on testing new areas of the deploy
    feature and changing some other parts of the code.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    203fe39 View commit details
    Browse the repository at this point in the history
  2. tests: plugins: kernel_install: Expand plugins test

    Plugins for kernel_install are outdated or do not cover important parts
    of the code; this commit reduces this gap by modernizing and adding more
    tests.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    a9adb18 View commit details
    Browse the repository at this point in the history
  3. github: workflow: unit_test: Add system update

    When I tried to push the deploy refactor, I got the following error:
    
    Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/pillow/python3-pil_7.0.0-4ubuntu0.4_amd64.deb  404  Not Found
    
    It looks like this is an update issue.
    
    Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
    rodrigosiqueira committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    ff70e00 View commit details
    Browse the repository at this point in the history