summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build-workflow.yml248
-rw-r--r--.github/workflows/ci_pipeline.yml1298
-rw-r--r--.github/workflows/hosted-post-merge_version_update.yml2
-rw-r--r--.github/workflows/pull-request-checks.yml19
-rw-r--r--Cargo.lock716
-rw-r--r--README.md7
-rwxr-xr-xci/build_scripts/build_for_amd64.sh21
-rwxr-xr-xci/build_scripts/build_for_arm.sh34
-rwxr-xr-xci/installation_scripts/clean_up_rpi.sh14
-rwxr-xr-xci/installation_scripts/install_for_amd64.sh17
-rwxr-xr-xci/installation_scripts/install_for_arm.sh24
-rwxr-xr-xci/integration_test/cargo_test_for_amd64.sh8
-rwxr-xr-xci/package_list.sh32
-rwxr-xr-xci/test_build.sh22
-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.toml6
-rw-r--r--crates/common/flockfile/Cargo.toml2
-rw-r--r--crates/common/flockfile/src/unix.rs2
-rw-r--r--crates/common/json_writer/Cargo.toml2
-rw-r--r--crates/common/logged_command/Cargo.toml4
-rw-r--r--crates/common/mqtt_channel/Cargo.toml2
-rw-r--r--crates/common/mqtt_channel/src/session.rs4
-rw-r--r--crates/common/tedge_config/Cargo.toml3
-rw-r--r--crates/common/tedge_config/src/models/file_path.rs6
-rw-r--r--crates/common/tedge_users/Cargo.toml12
-rw-r--r--crates/common/tedge_users/src/lib.rs28
-rw-r--r--crates/common/tedge_users/src/unix.rs225
-rw-r--r--crates/common/tedge_users/src/windows.rs37
-rw-r--r--crates/common/tedge_utils/Cargo.toml11
-rw-r--r--crates/common/tedge_utils/src/file.rs85
-rw-r--r--crates/common/tedge_utils/src/fs.rs4
-rw-r--r--crates/common/tedge_utils/src/fs_notify.rs574
-rw-r--r--crates/common/tedge_utils/src/lib.rs3
-rw-r--r--crates/core/agent_interface/Cargo.toml2
-rw-r--r--crates/core/c8y_api/Cargo.toml2
-rw-r--r--crates/core/c8y_api/src/http_proxy.rs2
-rw-r--r--crates/core/c8y_smartrest/Cargo.toml2
-rw-r--r--crates/core/c8y_smartrest/src/error.rs6
-rw-r--r--crates/core/c8y_smartrest/src/operations.rs12
-rw-r--r--crates/core/c8y_smartrest/src/smartrest_serializer.rs12
-rw-r--r--crates/core/c8y_translator/Cargo.toml2
-rw-r--r--crates/core/plugin_sm/Cargo.toml3
-rw-r--r--crates/core/tedge/Cargo.toml4
-rw-r--r--crates/core/tedge/src/cli/certificate/cli.rs2
-rw-r--r--crates/core/tedge/src/cli/certificate/create.rs34
-rw-r--r--crates/core/tedge/src/cli/certificate/error.rs4
-rw-r--r--crates/core/tedge/src/cli/certificate/remove.rs5
-rw-r--r--crates/core/tedge/src/cli/connect/c8y_direct_connection.rs18
-rw-r--r--crates/core/tedge/src/cli/connect/cli.rs12
-rw-r--r--crates/core/tedge/src/cli/connect/command.rs5
-rw-r--r--crates/core/tedge/src/cli/connect/error.rs5
-rw-r--r--crates/core/tedge/src/cli/disconnect/cli.rs10
-rw-r--r--crates/core/tedge/src/command.rs3
-rw-r--r--crates/core/tedge/src/main.rs13
-rw-r--r--crates/core/tedge/src/system_services/manager.rs7
-rw-r--r--crates/core/tedge/src/system_services/managers/general_manager.rs10
-rw-r--r--crates/core/tedge_agent/Cargo.toml4
-rw-r--r--crates/core/tedge_agent/src/agent.rs2
-rw-r--r--crates/core/tedge_agent/src/restart_operation_handler.rs20
-rw-r--r--crates/core/tedge_mapper/Cargo.toml3
-rw-r--r--crates/core/tedge_mapper/src/c8y/converter.rs8
-rw-r--r--crates/core/tedge_mapper/src/c8y/dynamic_discovery.rs12
-rw-r--r--crates/core/tedge_mapper/src/c8y/error.rs1
-rw-r--r--crates/core/tedge_mapper/src/c8y/mapper.rs2
-rw-r--r--crates/core/tedge_mapper/src/core/error.rs3
-rw-r--r--crates/core/tedge_mapper/src/core/mapper.rs29
-rw-r--r--crates/core/tedge_mapper/src/main.rs7
-rw-r--r--crates/core/tedge_watchdog/Cargo.toml2
-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--crates/tests/tedge_test_utils/Cargo.toml5
-rw-r--r--crates/tests/tedge_test_utils/src/fs.rs24
-rw-r--r--docs/src/SUMMARY.md1
-rw-r--r--docs/src/references/references.md3
-rw-r--r--docs/src/references/tedge.md2
-rw-r--r--docs/src/references/thin-edge-config-files.md144
-rwxr-xr-xget-thin-edge_io.sh2
-rw-r--r--plugins/c8y_configuration_plugin/Cargo.toml2
-rw-r--r--plugins/c8y_configuration_plugin/src/main.rs73
-rw-r--r--plugins/c8y_log_plugin/Cargo.toml2
-rw-r--r--plugins/c8y_log_plugin/src/config.rs3
-rw-r--r--plugins/c8y_log_plugin/src/logfile_request.rs8
-rw-r--r--plugins/c8y_log_plugin/src/main.rs91
-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
89 files changed, 1712 insertions, 2406 deletions
diff --git a/.github/workflows/build-workflow.yml b/.github/workflows/build-workflow.yml
index e2a38ce4..551f4d6c 100644
--- a/.github/workflows/build-workflow.yml
+++ b/.github/workflows/build-workflow.yml
@@ -7,17 +7,18 @@ on:
env:
CARGO_TERM_COLOR: always
+ RUSTFLAGS: -D warnings
jobs:
- build_amd64:
- name: Build tedge and mapper Debian packages for amd64
+ build-amd64:
+ name: Build for amd64
runs-on: Ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- - name: enable toolchain via github action
+ - name: Enable toolchain via github action
# https://github.com/actions-rs/toolchain
uses: actions-rs/toolchain@v1
with:
@@ -28,75 +29,8 @@ jobs:
# 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.38.1
-
- - 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_watchdog debian package
- uses: actions-rs/cargo@v1
- # https://github.com/marketplace/actions/rust-cargo
- with:
- command: deb
- args: -p tedge_watchdog
-
- - name: Build c8y_log_plugin debian package
- uses: actions-rs/cargo@v1
- # https://github.com/marketplace/actions/rust-cargo
- with:
- command: deb
- args: -p c8y_log_plugin
-
- - name: Build c8y_configuration_plugin debian package
- uses: actions-rs/cargo@v1
- # https://github.com/marketplace/actions/rust-cargo
- with:
- command: deb
- args: -p c8y_configuration_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: Build packages for amd64
+ run: ./ci/build_scripts/build_for_amd64.sh
- name: Upload artifacts as zip
# https://github.com/marketplace/actions/upload-a-build-artifact
@@ -105,34 +39,12 @@ jobs:
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
+ build-arm-matrix:
+ name: Build for ${{ matrix.target }}
runs-on: Ubuntu-20.04
-
strategy:
matrix:
- # Currently only arm targets, as we use a custom strip binary !
+ # Add only arm targets here as we use a custom strip binary!
target:
[
aarch64-unknown-linux-gnu,
@@ -143,10 +55,10 @@ jobs:
]
steps:
- - name: checkout
+ - name: Checkout
uses: actions/checkout@v2
- - name: enable toolchain via github action
+ - name: Enable toolchain via github action
# https://github.com/actions-rs/toolchain
uses: actions-rs/toolchain@v1
with:
@@ -158,152 +70,24 @@ jobs:
# 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.38.1
-
- - 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
-