Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

*: Data collection from FCOS machines #31

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Commits on Sep 19, 2019

  1. src/identity: Add a module that collects platform id

    Collects ignition platform id from /proc/cmdline in the varriable
    `ignition.platform.id=` and stores the collected data inside the
    `identity::Identity` struct.
    
    Also adds different grains of data collection level: minimum and
    full, depending on the passed toml configuration.
    
    Signed-off-by: Allen Bai, abai@redhat.com
    Allen Bai committed Sep 19, 2019
    Configuration menu
    Copy the full SHA
    c1ae43c View commit details
    Browse the repository at this point in the history
  2. *: Update according to reviews

    Changes the use of term "metrics", deduplicates match pattern and
    uses maplit::hashmap! macro.
    Allen Bai committed Sep 19, 2019
    Configuration menu
    Copy the full SHA
    1d92353 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2c66d08 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2019

  1. identity/os_release.rs: Collect CoreOS alpha version

    Picks up CoreOS alpha version information from `/.coreos-aleph-version.json`.
    
    Signed-off-by: Allen Bai, abai@redhat.com
    Allen Bai committed Sep 24, 2019
    Configuration menu
    Copy the full SHA
    140e9e0 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2019

  1. Configuration menu
    Copy the full SHA
    9f95f1d View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2019

  1. os_release.rs: Change name alpha to aleph

    Allen Bai committed Sep 30, 2019
    Configuration menu
    Copy the full SHA
    ade473b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da6a36c View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2019

  1. *: cleanup redundant code imported from Afterburn

    Allen Bai committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    b35c9a1 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2019

  1. src/agent: merge minimal and full under the same module, agent

    src/full: add hardware data collection
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 15, 2019
    Configuration menu
    Copy the full SHA
    c50cb84 View commit details
    Browse the repository at this point in the history
  2. minimal/mock_tests: add mock test for minimal agent

    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 15, 2019
    Configuration menu
    Copy the full SHA
    7a05d4f View commit details
    Browse the repository at this point in the history
  3. full/mock_tests: add mock tests for full agent

    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 15, 2019
    Configuration menu
    Copy the full SHA
    4013ebf View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2019

  1. full/lsmem: allow "yes"/"no" for field removable

    .travis.yml: test inside ubi container instead of ubuntu vm
    
    Allows "yes"/"no" values for `removable` field of `lsmem --json`, because of
    different implementations, the field type might be different. However, in an
    FCOS machine this will be true/false. This change is mainly to accommodate testing
    environment.
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    d209da0 View commit details
    Browse the repository at this point in the history
  2. src: format with rustfmt

    Signed-off-by: Allen Bai <abai@redhat.com>
    
    agent/full: only collect hw info on bare metals
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    
    full/network: collect network info with `nmcli`
    
    Collects network data with format `[key[\s]+value\n]+`,
    to see example run `nmcli device show`. Parse the data
    as key:value pairs stored in a HashMap.
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    b0cc858 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2019

  1. src/full: add module for extracting container runtime info

    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    6a5e8f1 View commit details
    Browse the repository at this point in the history
  2. agent/minimum: set default value for identity instead of returning error

    tests: add tests to print minimum and full agent with test config file
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    ec203b0 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2019

  1. main.rs: serialize the Agent struct and POST as json

    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    e650f00 View commit details
    Browse the repository at this point in the history
  2. *: add some documentation for each module

    Dockerfile: install dependency, openssl-devel
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    5267871 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2019

  1. utl/clock: add clock module to record time intervals

    Since reporting will happen daily or monthly, we are keeping
    track of time intervals between reports. Two threads are spawned
    for tracking daily and monthly reporting. Daily thread will check
    timestamp every 12 hours, otherwise put to sleep. Monthly thread
    will check every 15 days, otherwise put to sleep.
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    80e7275 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. full/container_runtime: rewrite to use pgrep instead of calling run…

    …time
    
    Previously we are using individual container runtimes to extract container
    information, e.g. calling `podman container ls` to count running containers.
    It would create two problems:
      - podman failed when trying to create `/.config/containers` since root dir
        is read-only and dynamic user does not have its own home dir
      - successful calls do not make sense either since counting running containers
        under the dynamic user is not useful
    Hence, switch to count containers by calling `pgrep` and count the running
    processes of each container runtime.
    
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    4387efa View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2019

  1. systemd: use LogsDirecoty= to persist data

    Previously used `StateDirectory=` to persist pinger specific
    data across bootups. It turns out that systemd does not allow
    sharing state directory across different dynamic users. An example
    would be:
    
    ```
    $ systemd-run --pty --property=DynamicUser=yes --property=StateDirectory=wuff /bin/sh
    $ systemd-run --pty --property=DynamicUser=yes --property=StateDirectory=wuff /bin/sh
    ```
    
    Reference: http://0pointer.net/blog/dynamic-users-with-systemd.html
    Signed-off-by: Allen Bai <abai@redhat.com>
    Allen Bai committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    ecf60b2 View commit details
    Browse the repository at this point in the history