summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRina Fujino <18257209+rina23q@users.noreply.github.com>2022-04-26 15:00:06 +0200
committerRina Fujino <18257209+rina23q@users.noreply.github.com>2022-04-26 15:00:06 +0200
commit224cb2f75bc0d897d2a266895eae48fc7107e83e (patch)
treedaca3d154535ac4f3840371ff462347689201d75
parentf5b2f5b224831cf47b454c202026c85aa1d0c7de (diff)
parent42dcd4ec556dba3ec2987895bd79c566c3c6546a (diff)
Merge branch 'main' into feature/1030/configuration-management
-rw-r--r--.github/workflows/ci_pipeline.yml1384
-rw-r--r--.github/workflows/doc-check.yml52
-rw-r--r--Cargo.lock111
-rwxr-xr-xci/ci_run_all_plugin_tests.sh9
-rwxr-xr-xci/ci_run_all_sm_tests.sh3
-rwxr-xr-xci/ci_run_all_tests.sh3
-rwxr-xr-xci/report/build.sh12
-rwxr-xr-xci/report/build_local.sh12
-rwxr-xr-xci/report/download_workflow_artifact.py235
-rwxr-xr-xci/report/final_result.py33
-rwxr-xr-xci/report/report_builder.py207
-rw-r--r--configuration/contrib/tedge_upgrade/upgrade_tedge_0.6.sh10
-rwxr-xr-xconfiguration/debian/tedge/postinst11
-rw-r--r--configuration/debian/tedge/postrm18
-rw-r--r--configuration/debian/tedge_agent/postinst22
-rw-r--r--configuration/debian/tedge_agent/postrm28
-rw-r--r--configuration/debian/tedge_mapper/postinst15
-rw-r--r--configuration/debian/tedge_mapper/postrm11
-rw-r--r--configuration/init/systemd/tedge-agent.service2
-rw-r--r--configuration/init/systemd/tedge-mapper-az.service2
-rw-r--r--configuration/init/systemd/tedge-mapper-c8y.service2
-rw-r--r--configuration/init/systemd/tedge-mapper-collectd.service2
-rw-r--r--crates/common/batcher/Cargo.toml2
-rw-r--r--crates/common/certificate/Cargo.toml2
-rw-r--r--crates/common/clock/Cargo.toml2
-rw-r--r--crates/common/download/Cargo.toml2
-rw-r--r--crates/common/flockfile/Cargo.toml2
-rw-r--r--crates/common/json_writer/Cargo.toml2
-rw-r--r--crates/common/logged_command/Cargo.toml20
-rw-r--r--crates/common/logged_command/src/lib.rs3
-rw-r--r--crates/common/logged_command/src/logged_command.rs (renamed from crates/core/plugin_sm/src/logged_command.rs)19
-rw-r--r--crates/common/mqtt_channel/Cargo.toml2
-rw-r--r--crates/common/tedge_config/Cargo.toml2
-rw-r--r--crates/common/tedge_config/src/settings.rs22
-rw-r--r--crates/common/tedge_config/src/tedge_config.rs36
-rw-r--r--crates/common/tedge_config/tests/test_tedge_config.rs5
-rw-r--r--crates/common/tedge_users/Cargo.toml2
-rw-r--r--crates/common/tedge_users/src/lib.rs1
-rw-r--r--crates/common/tedge_utils/Cargo.toml2
-rw-r--r--crates/core/agent_interface/Cargo.toml2
-rw-r--r--crates/core/c8y_api/Cargo.toml2
-rw-r--r--crates/core/c8y_smartrest/Cargo.toml2
-rw-r--r--crates/core/c8y_translator/Cargo.toml2
-rw-r--r--crates/core/c8y_translator/fuzz/Cargo.lock8
-rw-r--r--crates/core/plugin_sm/Cargo.toml3
-rw-r--r--crates/core/plugin_sm/src/lib.rs1
-rw-r--r--crates/core/plugin_sm/src/plugin.rs2
-rw-r--r--crates/core/tedge/Cargo.toml4
-rw-r--r--crates/core/tedge/src/cli/config/config_key.rs6
-rw-r--r--crates/core/tedge/src/main.rs27
-rw-r--r--crates/core/tedge_agent/Cargo.toml2
-rw-r--r--crates/core/tedge_agent/src/agent.rs24
-rw-r--r--crates/core/tedge_agent/src/main.rs4
-rw-r--r--crates/core/tedge_agent/src/state.rs2
-rw-r--r--crates/core/tedge_mapper/Cargo.toml3
-rw-r--r--crates/core/tedge_mapper/src/az/mapper.rs17
-rw-r--r--crates/core/tedge_mapper/src/c8y/mapper.rs140
-rw-r--r--crates/core/tedge_mapper/src/collectd/mapper.rs10
-rw-r--r--crates/core/tedge_mapper/src/core/component.rs6
-rw-r--r--crates/core/tedge_mapper/src/main.rs6
-rw-r--r--crates/core/tedge_watchdog/Cargo.toml9
-rw-r--r--crates/core/thin_edge_json/Cargo.toml2
-rw-r--r--crates/tests/mqtt_tests/Cargo.toml2
-rw-r--r--crates/tests/sawtooth_publisher/Cargo.toml2
-rw-r--r--docs/src/SUMMARY.md1
-rw-r--r--docs/src/howto-guides/002_installation.md13
-rw-r--r--docs/src/howto-guides/022_c8y_fragments.md55
-rw-r--r--docs/src/howto-guides/README.md8
-rw-r--r--docs/src/howto-guides/images/c8y_custom_fragments.pngbin0 -> 46102 bytes
-rw-r--r--docs/src/supported-platforms.md3
-rw-r--r--docs/src/tutorials/connect-c8y.md7
-rwxr-xr-xget-thin-edge_io.sh2
-rw-r--r--plugins/log_request_plugin/Cargo.toml2
-rw-r--r--plugins/log_request_plugin/src/smartrest.rs7
-rw-r--r--plugins/tedge_apama_plugin/Cargo.toml2
-rw-r--r--plugins/tedge_apt_plugin/Cargo.toml2
-rw-r--r--plugins/tedge_dummy_plugin/Cargo.toml2
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_negative/pysystest.xml28
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_negative/run.py70
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_positive/pysystest.xml29
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_positive/run.py100
81 files changed, 2417 insertions, 512 deletions
diff --git a/.github/workflows/ci_pipeline.yml b/.github/workflows/ci_pipeline.yml
new file mode 100644
index 00000000..417ee964
--- /dev/null
+++ b/.github/workflows/ci_pipeline.yml
@@ -0,0 +1,1384 @@
+name: ci_pipeline
+
+# All in one ci pipeline
+# Note that the jobs system-test_offsite_{abcd} , install-and-use-rpi_m32sd10{abcd}
+# are there four times and are almost identical. They only differ in a character
+# a,b,c,d that we use to select a runner.
+#
+# TODO: Reduce complexity by moving functionality to bash scripts
+# TODO: Think about automated generation of this workflow, there is
+# duplicated code, especially in the later sections
+# TODO: Smoke testing on Azure is disabled, we should check if it works out
+# with 4 runners in parallel or enable only one
+
+on:
+ push:
+ branches: [main]
+ workflow_dispatch:
+ branches: [main]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ cargo-fmt:
+ name: Run cargo fmt
+ runs-on: Ubuntu-20.04
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Cargo fmt --version
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: fmt
+ args: --version
+
+ - name: Cargo fmt
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: fmt
+ args: -- --check
+
+ python-black:
+ name: Python static checks
+ runs-on: Ubuntu-20.04
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Run black
+ uses: rickstaa/action-black@v1
+ with:
+ black_args: ". --check"
+
+ cargo-clippy:
+ name: Run cargo clippy
+ runs-on: Ubuntu-20.04
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: enable toolchain via github action
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.58.1
+ components: rustfmt, clippy
+ override: true
+
+ - name: Enable cache
+ # https://github.com/marketplace/actions/rust-cache
+ uses: Swatinem/rust-cache@v1
+
+ - name: Cargo clippy --version
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ toolchain: 1.58.1
+ command: clippy
+ args: --version
+
+ - name: Cargo clippy
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ toolchain: 1.58.1
+ command: clippy
+
+ cargo-test:
+ name: Run cargo test
+ runs-on: Ubuntu-20.04
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: enable toolchain via github action
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.58.1
+ override: true
+
+ - name: Enable cache
+ # https://github.com/marketplace/actions/rust-cache
+ uses: Swatinem/rust-cache@v1
+
+ - name: Cargo version
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: version
+
+ - name: Cargo build dummy plugin
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: build
+ args: -p tedge_dummy_plugin
+
+ - name: Cargo test
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: test
+ args: --no-fail-fast
+
+
+###############################################################################
+
+ build_amd64:
+ name: Build tedge and mapper Debian packages for amd64
+ runs-on: Ubuntu-20.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: enable toolchain via github action
+ # https://github.com/actions-rs/toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.58.1
+ override: true
+
+ - name: Enable cache
+ # https://github.com/marketplace/actions/rust-cache
+ uses: Swatinem/rust-cache@v1
+
+ - name: Install cargo-deb
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: install
+ args: cargo-deb --version 1.34.2
+
+ - name: Build tedge debian package
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: deb
+ args: -p tedge
+
+ - name: Build tedge_mapper debian package
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: deb
+ args: -p tedge_mapper
+
+ - name: Build tedge_apt_plugin debian package
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: deb
+ args: -p tedge_apt_plugin
+
+ - name: Build tedge_apama_plugin debian package
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: deb
+ args: -p tedge_apama_plugin
+
+ - name: Build tedge_agent debian package
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: deb
+ args: -p tedge_agent
+
+ - name: Build tedge_logfile_request_plugin debian package
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: deb
+ args: -p tedge_logfile_request_plugin
+
+ - name: build sawtooth-publisher for amd64
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: build
+ args: --release -p sawtooth_publisher
+
+ - name: Upload artifacts as zip
+ # https://github.com/marketplace/actions/upload-a-build-artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: debian-packages-amd64
+ path: target/debian/*.deb
+
+ - name: upload amd64 sawtooth-publisher as zip
+ # https://github.com/marketplace/actions/upload-a-build-artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: sawtooth_publisher_amd64
+ path: target/release/sawtooth_publisher
+
+ - name: Build tedge_dummy_plugin
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: build
+ args: --release -p tedge_dummy_plugin
+
+ - name: upload dummy-plugin
+ # https://github.com/marketplace/actions/upload-a-build-artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: tedge_dummy_plugin_amd64
+ path: target/release/tedge_dummy_plugin
+
+ build_matrix_arm:
+ name: Build tedge and mapper Debian for armv7
+ runs-on: Ubuntu-20.04
+ strategy:
+ matrix:
+ # Add only arm targets here as we use a custom strip binary!
+ target:
+ [
+ aarch64-unknown-linux-gnu,
+ aarch64-unknown-linux-musl,
+ arm-unknown-linux-gnueabihf,
+ armv7-unknown-linux-gnueabihf,
+ armv7-unknown-linux-musleabihf,
+ ]
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+
+ - name: enable toolchain via github action
+ # https://github.com/actions-rs/toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: 1.58.1
+ target: ${{ matrix.target }}
+ override: true
+
+ - name: Enable cache
+ # https://github.com/marketplace/actions/rust-cache
+ uses: Swatinem/rust-cache@v1
+
+ - name: install cargo-deb
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: install
+ args: cargo-deb --version 1.34.2
+
+ - name: install cargo-strip
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ command: install
+ args: cargo-strip
+
+ - name: build cross release for target
+ uses: actions-rs/cargo@v1
+ # https://github.com/marketplace/actions/rust-cargo
+ with:
+ use-cross: true
+ command: build
+ args: --release --target=${{ matrix.target }}
+
+ - name: apt update
+ run: sudo apt update
+
+ # armv7 uses `arm-linux-gnueabihf-strip`; aarch64 uses `aarch64-linux-gnu-strip`
+ # It appears `aarch64-linux-gnu-strip` seems to work explicitly on other arm bins but not other way around.
+ - name: Install binutils to add `strip` for striping arm binaries
+ run: sudo apt-get --assume-yes install binutils-arm-linux-gnueabihf binutils-aarch64-linux-gnu
+
+ - name: Strip tedge
+ run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge
+
+ - name: Strip tedge_mapper
+ run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge_mapper || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge_mapper
+
+ - name: Strip tedge_agent
+ run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge_agent || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge_agent
+
+ - name: Strip tedge_apt_plugin
+ run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge_apt_plugin || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge_apt_plugin
+
+ - name: Strip tedge_apama_plugin
+ run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge_apama_plugin || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge_apama_plugin
+
+ - name: Strip tedge_logfile_request_plugin
+ run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge_logfile_request_plugin || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge_logfile_request_plugin
+
+ -