profile
viewpoint

arsing/azure-iot-mqtt 1

An Azure IoT client library

arsing/openssl-pkcs11-demo 1

Proof-of-concept of using an HSM to generate and store key pairs, then using those key pairs to create a CA certificate, client certificate and server certificate for TLS

arsing/cbindgen 0

A project for generating C bindings from Rust code

arsing/cross 0

"Zero setup" cross compilation and "cross testing" of Rust crates

arsing/cryptoauthlib 0

Library for interacting with the Crypto Authentication secure elements

arsing/hyper-uds 0

An implementation of `hyper::service::Service` (for clients) and `hyper::server::accept::Accept` (for servers) that uses Unix Domain Sockets

arsing/iotedge 0

The IoT Edge OSS project

arsing/libiothsm2 0

Prototype of libiothsm v2

arsing/mio 0

Metal IO library for Rust

arsing/mio-uds 0

Unix Domain Sockets for mio

push eventarsing/libiothsm2

Arnav Singh

commit sha 0f4f2b9e787e0e963912ebe2776dbbf42ab8ec99

WIP

view details

push time in 4 days

pull request commentAzure/iotedge

Use BTreeMap instead of HashMap for config.yaml's HMAC

@ancaantochi FYI. This removes the function you added in https://github.com/Azure/iotedge/commit/0e6a402fecf9f11c3f8afff7713352ddc165a234 to sort agent.env at serialization time, by changing ModuleSpec::env to be a BTreeMap directly.

damonbarry

comment created time in 4 days

Pull request review commentAzure/iotedge

Use BTreeMap instead of HashMap for config.yaml's HMAC

 use serde_json::Value; // We do not want to restrict the properties that the user can set in their create options, because future versions of Docker can add new properties // that we don't define here. //-// So this type has a `#[serde(flatten)] HashMap` field to collect all the extra properties that we don't have a struct field for.+// So this type has a `#[serde(flatten)] BTreeMap` field to collect all the extra properties that we don't have a struct field for. // // But if an existing field references another type under `crate::models::`, then that would still be parsed lossily, so we would have to also add-// a `#[serde(flatten)] HashMap` field there. And if that type has fields that reference types under `crate::models::` ...+// a `#[serde(flatten)] BTreeMap` field there. And if that type has fields that reference types under `crate::models::` ... // // To avoid having to do this for effectively the whole crate, instead we've just commented out the fields we don't use in our code. //+// Note: We're using BTreeMap instead of HashMap because iotedged stores an HMAC of its local config (whose object representation uses this struct)

s/an HMAC of/a hash of/g

HMAC takes a hash and signs it with a key. We just do a hash.

damonbarry

comment created time in 4 days

Pull request review commentAzure/iotedge

Use BTreeMap instead of HashMap for config.yaml's HMAC

 impl ModuleRuntime for DockerModuleRuntime {                             .flat_map(|container| {                                 DockerConfig::new(                                     container.image().to_string(),-                                    ContainerCreateBody::new()-                                        .with_labels(container.labels().clone()),+                                    ContainerCreateBody::new().with_labels(+                                        container+                                            .labels()+                                            .iter()+                                            .map(|(k, v)| (k.to_string(), v.to_string()))+                                            .collect::<BTreeMap<_, _>>(),

Don't need the turbofish. collect()'s return type will be inferred from the with_labels signature.

damonbarry

comment created time in 4 days

Pull request review commentAzure/iotedge

Recognize changes to bootstrap agent config

 impl ModuleRuntime for DockerModuleRuntime {                     .unwrap_or_else(HashMap::new);                 labels.insert(LABEL_KEY.to_string(), LABEL_VALUE.to_string()); 

Just like https://github.com/Azure/iotedge/pull/2305#issuecomment-574785186 , can you not do it in init_agent_spec ?

damonbarry

comment created time in 7 days

Pull request review commentAzure/iotedge

Don't delete provisioning backup when configuration changes

 where     M::Settings: Serialize,     C: CreateCertificate + GetIssuerAlias + MasterEncryptionKey, {-    // Remove all edge containers and destroy the cache (settings and dps backup)+    // Remove all edge containers and delete settings state

I would remove "delete settings state" from this as well, since there's no explicit call to delete the file.

damonbarry

comment created time in 10 days

issue commentMicrosoftDocs/azure-docs

TPM udev rules for `iotedge` security daemon setup incomplete

Yes, this request is correct. There are a few things that have gone wrong here.

The iotedge group is meant for ACLing the management socket, so strictly speaking the iotedged process's user is not required to run in that group. That's why the Debian / Ubuntu packages don't add the iotedge user to the iotedge group.

But the CentOS packages do add the user to the group. This is inconsistent. Furthermore, the service file for all distros set User=iotedge and Group=iotedge, even though that user isn't in that group.

Coming back to this doc, both this doc and the README-TPM.md in the iotedge repo suggest using the group in the udev rule. The rule ought to have OWNER since the iotedge user needs to access the device node. It doesn't strictly need to have GROUP at all, since the other users in the iotedge group don't need to access the device node.

So it should just be KERNEL=="tpm0", SUBSYSTEM=="tpm", OWNER="iotedge", MODE="0600" - note that only OWNER is set and that the MODE is 0600

(Of course, if the user decides they do need some other users to be able to access the tpm, they can make a new group themselves, and add a GROUP and modify the MODE on their own.)

SpaceKatt

comment created time in 14 days

Pull request review commentAzure/iotedge

Prepare for release 1.0.9

 agent:   type: "docker"   env: {}   config:-    image: "mcr.microsoft.com/azureiotedge-agent:1.0.9"+    image: "mcr.microsoft.com/azureiotedge-agent:1.0.9.1"

But anyway, yes you can make this 1.0 too, since it'll only get used for new installs just like with Linux packages. That is, in both Windows and Linux, updating the package leaves the user's existing config.yaml untouched, so there's no point bumping it in every release.

yophilav

comment created time in 19 days

Pull request review commentAzure/iotedge

Prepare for release 1.0.9

 agent:   type: "docker"   env: {}   config:-    image: "mcr.microsoft.com/azureiotedge-agent:1.0.9"+    image: "mcr.microsoft.com/azureiotedge-agent:1.0.9.1"

For windows it is different as upgrade installation will require to reconfigure config.yaml.

This is not true.

So when a docker container is removed

Containers aren't removed as part of running Update-IoTEdge

yophilav

comment created time in 19 days

delete branch arsing/iotedge

delete branch : fix-centos

delete time in 25 days

pull request commentAzure/iotedge

Fixing window package version on master

Fixing window package version on master

The build is fine on master, right? It's only broken on release/* ?

That is correct. The build is fine because we are using 1.0.10~dev version.

Right, so please fix the commit message before you merge it.

Also, I assume you tested this on the release/1.0.9 branch already?

yophilav

comment created time in 25 days

pull request commentAzure/iotedge

Fixing window package version on master

Fixing window package version on master

The build is fine on master, right? It's only broken on release/* ?

yophilav

comment created time in 25 days

Pull request review commentAzure/iotedge

Fixing window package version on master

 jobs:     steps:       - powershell: |           $base_version = Get-Content -Path "$(Build.SourcesDirectory)\edgelet\version.txt"-          $version = ("{0}{1}" -f $base_version, $(Build.BuildNumber))+          if ($base_version -like '*~*') {+            $version = ("{0}{1}" -f $base_version, $(Build.BuildNumber))+          } else {+            $version = $base_version+          }+          echo "base_version=$base_version"

Are you planning to leave these in or are they just for debugging? If you're planning to leave them in, use Write-Host instead of echo.

yophilav

comment created time in 25 days

pull request commentAzure/iotedge

Edgelet build fix for Mac OS

If we don't want zero uptime reporting, we could use libc I guess.

No, it's fine. It's a niche request so it's not worth the effort.

massand

comment created time in a month

issue closedAzure/iotedge

Can't report Json array by using Module twin (properties.reported)?

Hi, I just wanted to make sure if module twin can report Json array or not. The scenario is listing all usb device plugged in edge device and upload the device list to the cloud by using module twin ( properties.reported ) . My test array is :

{"test":[{"k":"1"},{"k":"2"}]}

and I get the error log at edgeHub: image

Environment: Linux Pi 3 iotedge 1.0.9 EdgeHub - Version - 1.0.9.29532150 (1f7cf6a21dfa365c8f21475553c544f4df02dd44) EdgeAgent - Version - 1.0.9.29532150 (1f7cf6a21dfa365c8f21475553c544f4df02dd44)

Thanks.

closed time in a month

LiangJy123

issue commentAzure/iotedge

Can't report Json array by using Module twin (properties.reported)?

Correct, arrays are not supported. This is a limitation of IoT Hub as documented here.

You may want to do what we do for createOptions in Edge Agent's twin, which is to take an arbitrary JSON value (which may include arrays, may have more nesting that IoT Hub allows, etc) and stringify it. Then from IoT Hub's point-of-view it just appears as a string and is allowed. Of course then whatever client accesses the reported property also needs to manually deserialize the string.

LiangJy123

comment created time in a month

issue commentAzure/iotedge

Cannot resolve edgeAgent and edgeHub storage warning

                           "storageFolder": {
                               "value": "C:\\\\Windows\\\\Temp"
                           }

Both instances of this should be be:

                            "storageFolder": {
                                "value": "C:\\Windows\\Temp"
                            }

I also tried docker inspect, on edgeHub the bind is listed and also the environment variable exists. but on edgeHub not affected.

I assume you meant "but on edgeAgent not affected". For that, ensure you config.yaml also has storageFolder set in the agent.env section, like:

agent:
  name: 'edgeAgent'
  type: 'docker'
  env:
    'storageFolder': 'C:\Windows\temp'

Notice again that the \ is not doubled-up, because it's inside a YAML string quoted with '. Only YAML strings quoted with " need \ to be escaped as \\.

mahdighorbanpour

comment created time in a month

pull request commentAzure/iotedge

Remove windows arm32 from diagnostic image

@philipktlin Bear is doing that for 1.0.9, yes? He doesn't need it for master?

lfitchett

comment created time in a month

issue commentAzure/iotedge

Running edgeAgent container as non root

Reading through the code it looks like this might be needed to communicate with moby-runtime using "unix:///var/run/docker.sock".

FYI, Edge Agent does not need to talk to Docker. There is code in Edge Agent to talk to Docker directly ("docker mode") but that is not used. The default mode of operation is for it to talk to iotedged over the management endpoint ("edgelet mode").

clustor

comment created time in a month

issue commentAzure/iotedge

Error calling IotHub for connectivity test - Service rejected the message with status: 429

I talked to Varun and he confirmed that the connection would remain open and be reused in this case. He suggested some part of the call stack ought to be changed to dispose the SDK client if it gets an HTTP 4xx so that it automatically reconnects with a new connection.

AMCN41R

comment created time in a month

push eventarsing/iotedge

Arnav Singh

commit sha 9dfd6a5b5aa393bfcf01a6dc1571c619c3197dde

WIP

view details

push time in a month

Pull request review commentAzure/iotedge

Enable windows host metrics

 impl ModuleRuntime for DockerModuleRuntime {                 })             }); -        #[cfg(not(windows))]-        {-            #[cfg(target_os = "linux")]-            let uptime = {-                let mut info: libc::sysinfo = unsafe { mem::zeroed() };-                let ret = unsafe { libc::sysinfo(&mut info) };-                if ret == 0 {-                    info.uptime.try_into().unwrap_or_default()-                } else {-                    0-                }-            };-            #[cfg(not(target_os = "linux"))]-            let uptime = 0;--            let mut system_info = sysinfo::System::new();-            system_info.refresh_all();-            let current_time = SystemTime::now()-                .duration_since(UNIX_EPOCH)-                .unwrap_or_default()-                .as_secs();-            let start_time = process::id()-                .try_into()-                .map(|id| {-                    system_info-                        .get_process_list()-                        .get(&id)-                        .map(|p| p.start_time())-                        .unwrap_or_default()-                })-                .unwrap_or_default();--            let used_cpu = system_info-                .get_processor_list()-                .iter()-                .find(|p| p.get_name() == "cpu")-                .map_or_else(|| -1.0, |p| p.get_cpu_usage());--            let total_memory = system_info.get_total_memory() * 1000;-            let used_memory = system_info.get_used_memory() * 1000;--            let disks = system_info-                .get_disks()-                .iter()-                .map(|disk| {-                    DiskInfo::new(-                        disk.get_name().to_string_lossy().into_owned(),-                        disk.get_available_space(),-                        disk.get_total_space(),-                        String::from_utf8_lossy(disk.get_file_system()).into_owned(),-                        format!("{:?}", disk.get_type()),-                    )-                })-                .collect();--            let result = docker_stats.map(move |stats: String| {-                SystemResources::new(-                    uptime,-                    current_time - start_time,-                    used_cpu.into(),-                    used_memory,-                    total_memory,-                    disks,-                    stats,-                )-            });+        #[cfg(target_os = "linux")]+        let uptime: u64 = {+            let mut info: libc::sysinfo = unsafe { mem::zeroed() };+            let ret = unsafe { libc::sysinfo(&mut info) };+            if ret == 0 {+                info.uptime.try_into().unwrap_or_default()+            } else {+                0+            }+        };+        #[cfg(windows)]+        let uptime: u64 = unsafe { winapi::um::sysinfoapi::GetTickCount() }.into();

This is in milliseconds whereas the Linux one is in seconds. Should they not be consistent?

lfitchett

comment created time in a month

Pull request review commentAzure/iotedge

Enable windows host metrics

 impl ModuleRuntime for DockerModuleRuntime {                 })             }); -        #[cfg(not(windows))]-        {-            #[cfg(target_os = "linux")]-            let uptime = {-                let mut info: libc::sysinfo = unsafe { mem::zeroed() };-                let ret = unsafe { libc::sysinfo(&mut info) };-                if ret == 0 {-                    info.uptime.try_into().unwrap_or_default()-                } else {-                    0-                }-            };-            #[cfg(not(target_os = "linux"))]-            let uptime = 0;--            let mut system_info = sysinfo::System::new();-            system_info.refresh_all();-            let current_time = SystemTime::now()-                .duration_since(UNIX_EPOCH)-                .unwrap_or_default()-                .as_secs();-            let start_time = process::id()-                .try_into()-                .map(|id| {-                    system_info-                        .get_process_list()-                        .get(&id)-                        .map(|p| p.start_time())-                        .unwrap_or_default()-                })-                .unwrap_or_default();--            let used_cpu = system_info-                .get_processor_list()-                .iter()-                .find(|p| p.get_name() == "cpu")-                .map_or_else(|| -1.0, |p| p.get_cpu_usage());--            let total_memory = system_info.get_total_memory() * 1000;-            let used_memory = system_info.get_used_memory() * 1000;--            let disks = system_info-                .get_disks()-                .iter()-                .map(|disk| {-                    DiskInfo::new(-                        disk.get_name().to_string_lossy().into_owned(),-                        disk.get_available_space(),-                        disk.get_total_space(),-                        String::from_utf8_lossy(disk.get_file_system()).into_owned(),-                        format!("{:?}", disk.get_type()),-                    )-                })-                .collect();--            let result = docker_stats.map(move |stats: String| {-                SystemResources::new(-                    uptime,-                    current_time - start_time,-                    used_cpu.into(),-                    used_memory,-                    total_memory,-                    disks,-                    stats,-                )-            });+        #[cfg(target_os = "linux")]+        let uptime: u64 = {+            let mut info: libc::sysinfo = unsafe { mem::zeroed() };+            let ret = unsafe { libc::sysinfo(&mut info) };+            if ret == 0 {+                info.uptime.try_into().unwrap_or_default()+            } else {+                0+            }+        };+        #[cfg(windows)]+        let uptime: u64 = unsafe { winapi::um::sysinfoapi::GetTickCount() }.into();

Use GetTickCount64. GetTickCount wraps after 50 days.

lfitchett

comment created time in a month

issue commentAzure/iotedge

Error calling IotHub for connectivity test - Service rejected the message with status: 429

At approx. 05:00 UTC yesterday (20th April 2020) a subset of devices on one of our production IoT Hubs stopped communicating.

How many total devices are connected to the IoT Hub? ie how many devices connected to that hub did not have the problem?

Did all the devices that did have the problem all start having it within a few minutes of each other (as your graph indicates)?

Are the two dips in the errors graph because you restarted the Edge Hubs on the ~35 affected devices in two batches?

More logs are available if required.

Please give a larger range, specifically starting from the previous (successful) attempt of "Reauthenticating connected clients" before the one in your post (so that we can see what happened between the last successful attempt and the first unsuccessful one), and ending at the next instance of "Service rejected the message with status: 429" after the one in your post (so that we can see what happened between the first unsuccessful attempt and the second one).

I'm not sure if this is an issue with the edgeHub, or the IoT Hub, however, simply restarting the edgeHub resolved the issue.

One possibility is IoT Hub had poisoned the connection. It seems to me from looking at the code that the client is reused despite errors. Restarting Edge Hub made it create a new connection, so it didn't have the problem any more. I need to check with the code owners.

edgeHub should recover from failed connectivity tests

It seems to me from looking at the code that DeviceConnectivityManager only transitions states if the check times out rather than throws an arbitrary HTTP 4xx. That might be an issue. I need to check with the code owners.

AMCN41R

comment created time in a month

Pull request review commentAzure/iotedge

disable edgelet code coverage

 jobs:       - bash: edgelet/build/linux/clippy.sh         displayName: Clippy -################################################################################-  - job: code_coverage-################################################################################-    displayName: Code Coverage-    dependsOn: check_run_pipeline-    condition: eq(dependencies.check_run_pipeline.outputs['check_files.RUN_PIPELINE'], 'true')-    variables:-      coverage.excludes: "docker-rs*"-      coverage.goal: 68-      rust.toolchain: nightly-2020-04-10-    pool:-      vmImage: "ubuntu-16.04"-    steps:-      - script: |-          echo "##vso[task.setvariable variable=NO_VALGRIND;]true"-          echo "##vso[task.setvariable variable=CARGO_INCREMENTAL;]0"-          echo "##vso[task.setvariable variable=RUSTFLAGS;]-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"-          echo "##vso[task.setvariable variable=IOTEDGE_HOMEDIR;]/tmp"-          echo "##vso[task.setvariable variable=CARGO;]${CARGO_HOME:-"$HOME/.cargo"}/bin/cargo"-        displayName: Set env variables-      - script: |-          echo "$RUST_TOOLCHAIN" > rust-toolchain-        displayName: Override Rust toolchain-        workingDirectory: edgelet-        env:-          RUST_TOOLCHAIN: $(rust.toolchain)-      - script: edgelet/build/linux/install.sh-        displayName: Install Rust-      - script: |-          curl -L https://github.com/mozilla/grcov/releases/download/v0.5.1/grcov-linux-x86_64.tar.bz2 | tar jxf --          curl -L https://raw.github.com/eriwen/lcov-to-cobertura-xml/8c55cd11f80a21e7e46f20f8c81fcde0bf11f5e5/lcov_cobertura/lcov_cobertura.py -o lcov_cobertura.py-        workingDirectory: edgelet-        displayName: Install code coverage tools-      - script: $CARGO build --verbose-        displayName: Build-        workingDirectory: edgelet-      - script: $CARGO test --verbose-        displayName: Test-        workingDirectory: edgelet-      - script: find ./target -type f ! -name '*.gc*' -delete-        displayName: Cleanup build and test artifacts-        workingDirectory: edgelet-      - script: |-          zip -1 target/ccov.zip `find ./target \( -name "*.gc*" \) -print`-          ./grcov target/ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" --ignore-dir "*docker-rs*" > target/lcov.info-          python lcov_cobertura.py target/lcov.info --output ./coverage.xml --demangle --base-dir $(Build.SourcesDirectory)/edgelet -e "${COVERAGE_EXCLUDES}"-        displayName: Assemble code coverage results-        workingDirectory: edgelet-        env:-          COVERAGE_EXCLUDES: $(coverage.excludes)-      - task: PublishCodeCoverageResults@1-        displayName: Publish code coverage results-        inputs:-          codeCoverageTool: cobertura-          summaryFileLocation: "edgelet/coverage.xml"-      - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@5-        displayName: "Check build quality"-        inputs:-          checkCoverage: true-          coverageFailOption: fixed-          coverageType: lines-          coverageThreshold: $(coverage.goal)+# ################################################################################

Add a comment here explaining why it's commented out. Something like

# The CI VMs encounter
#
# >ld returned 1 exit status
#
# ... when running this job for no obvious reason.
#
lfitchett

comment created time in a month

issue commentAzure/iotedge

Idiomatic way to encrypt data from an Azure IoT Edge Module?

To answer the question from before it was closed: No, you cannot decrypt data in one module that was encrypted by another module. That is intentional, since the API is meant to be used to persist secrets that no other module should be able to read.

Hammatt

comment created time in a month

delete branch arsing/iotedge

delete branch : update-k8s-openapi

delete time in a month

Pull request review commentAzure/iotedge

Update k8s-openapi to v0.7.1

 where             },             ..api_authorize::SelfSubjectAccessReview::default()         };-        let params = api_authorize::CreateSelfSubjectAccessReviewOptional::default();          api_authorize::SelfSubjectAccessReview::create_self_subject_access_review(             &subject_access_review,-            params,+            CreateOptional::default(),

I would personally have written Default::default() which is also how it's documented in the k8s-openapi docs. That would've worked even in 0.5.1 and been even more concise :)

arsing

comment created time in a month

Pull request review commentAzure/iotedge

Update k8s-openapi to v0.7.1

 where                 Error::from(err.context(ErrorKind::UrlJoin(self.config.host().clone(), path)))             })             .and_then(|url| {-                // set the full URL on the request including API path-                *req.uri_mut() = url.as_str().parse::<Uri>().context(ErrorKind::Uri(url))?;+                // req is an http 0.2 Request but hyper uses http 0.1, so destructure req and reassemble it.

No, it's just to have a reference to http 0.1. The alternative would've been to add a dep on http:0.1, remove the k8s_openapi::http import, and change all uses of the imported http:: to fully-qualified k8s_openapi::http::

arsing

comment created time in 2 months

push eventarsing/iotedge

Arnav Singh

commit sha b13a85f74e0fcf4daf475f2d6e9054c5234996cf

Update k8s-openapi to v0.7.1 This version requires a lot less CPU and RAM to compile. Since this version uses http:0.2 types, they need extra work to be converted to the http:0.1 types that our codebase uses (via hyper 0.12).

view details

Arnav Singh

commit sha 212fa34bba39ca4bd4a4c5b58a3cdd31e59edd9e

Update Rust code coverage toolchain to nightly-2020-04-10

view details

push time in 2 months

push eventarsing/iotedge

Arnav Singh

commit sha fe6a04abe732ee859b53413353c5e2c2170857dd

Update Rust code coverage toolchain to nightly-2020-04-10

view details

push time in 2 months

push eventarsing/iotedge

Arnav Singh

commit sha 212fa34bba39ca4bd4a4c5b58a3cdd31e59edd9e

Update Rust code coverage toolchain to nightly-2020-04-10

view details

push time in 2 months

PR opened Azure/iotedge

Update k8s-openapi to v0.7.1

This version requires a lot less CPU and RAM to compile.

Since this version uses http:0.2 types, they need extra work to be converted to the http:0.1 types that our codebase uses (via hyper 0.12).

+181 -131

0 comment

6 changed files

pr created time in 2 months

create barncharsing/iotedge

branch : update-k8s-openapi

created branch time in 2 months

push eventarsing/openssl-pkcs11-demo

Arnav Singh

commit sha 985fe07142b4b9f13fe51ac1d4f2ad62fc80862c

Remove unnecessary import.

view details

Arnav Singh

commit sha 9e585457e7d9d0a821a4254634f7cfc6990358ce

Fix openssl error names to be more accurate.

view details

Arnav Singh

commit sha 90cd2285de7c80ed8ae53654959c4e69bb0755ee

impl Debug for FunctionalEngine

view details

push time in 2 months

create barncharsing/iotedge

branch : libiothsm2

created branch time in 2 months

push eventarsing/libiothsm2

Arnav Singh

commit sha 1bba2db8070fb968f2f3e9cc4d7f5747e26b4a63

WIP

view details

push time in 2 months

push eventarsing/libiothsm2

Arnav Singh

commit sha fa9dd9ae0ec66e1d2ad8d06b4935a41fae62fc1e

T

view details

push time in 2 months

Pull request review commentAzure/iotedge

Support bundle fixes into 1.0.9

 where             NaiveDateTime::from_timestamp(state.log_options.since().into(), 0),             Utc,         );-        let since = since_time.format("%F %T").to_string();

Is there a reason this fix was needed for Get-WinEvent but not for Get-EventLog used by write_docker_log_to_file ?

lfitchett

comment created time in 2 months

Pull request review commentAzure/iotedge

[mqttd] Added Dockerfile for ARM

+# -*- mode: dockerfile -*-+#+# An example Dockerfile showing how to build a Rust executable using this+# image, and deploy it with a tiny Alpine Linux container.++# You can override this `--build-arg BASE_IMAGE=...` to use different+# version of Rust or OpenSSL.+ARG BASE_IMAGE=messense/rust-musl-cross:armv7-musleabihf

I assume this ignores the rust-toolchain file?

vadim-kovalyov

comment created time in 2 months

issue commentAzure/iotedge

iotedge check crashes on 1.0.9 under Yocto Linux and Rust 1.41.0

Can't really say anything without backtraces. I assume the yocto build strips debug symbols? If so, please retry with an unstripped binary.

Otherwise, just searching for temp1 or temp{ or "temp" in all our code as well as our deps doesn't find anything, so no idea where that string is coming from and who's slicing it incorrectly. Is it something in your config.yaml?

surlemur

comment created time in 2 months

pull request commenteqrion/cbindgen

Emit documentation on constants

@emilio Any chance you could release a 0.13.2 with this? It's the only reason we still have to cargo install --git for $dayjob. (Also, what's up with that " tag and release?)

arsing

comment created time in 2 months

push eventarsing/libiothsm2

Arnav Singh

commit sha 012d37b53dab6ebc6828b97458f47ce2fe152444

T

view details

push time in 2 months

push eventarsing/libiothsm2

Arnav Singh

commit sha 3d8cfea0bef3e97a4aecf2ba353a4e57bec49091

T

view details

push time in 2 months

push eventarsing/libiothsm2

Arnav Singh

commit sha 90a28fb7f92bbdb40ff8f448c68bef35e32d1fb0

T

view details

push time in 2 months

push eventarsing/openssl-pkcs11-demo

Arnavion

commit sha 11a33556094f4b801bca6fbef7ba6129d9285f4b

Remove unnecessary import.

view details

Arnavion

commit sha ed23b62f8707840581053341ee80f740aad3f3eb

Fix openssl error names to be more accurate.

view details

push time in 2 months

issue commentAzure/iot-edge-v1

[V2] Unable to set azure-iot-edge network as "host" network for BLE Compatibility

Windows does not support host networking, as documented by Docker at https://docs.docker.com/network/host/ So it's expected that it won't work, and is not related to IoT Edge.

Now, as documented at https://docs.microsoft.com/en-us/virtualization/windowscontainers/container-networking/network-drivers-topologies , you could create a new Docker network yourself using the transparent driver. If you then set that network name to be the value of moby_runtime.network in config.yaml, all your modules would be started on this network instead of the default nat network.

However, Moby on Windows has another bug where any non-built-in networks become unusable after a reboot. This is because they get a new ID but all containers remain associated with the old ID, so they don't start. The only mitigation is to delete all containers and let them be recreated, so that they attach to the new ID. This bug is also why IoT Edge itself does not default to using the azure-iot-edge network on Windows like on Linux, and instead uses the built-in nat network. I suspect that any network you create manually would have the same problem.

If the network you create does have that problem, then you will need to follow up with https://github.com/moby/moby/issues

ghost

comment created time in 2 months

delete branch arsing/iotedge

delete branch : rustup

delete time in 2 months

PR opened Azure/iotedge

Reviewers
Fix build for new Rust stable 1.42.0
  • Option<String> -> Option<&str> converstion using new Option::as_deref instead of .as_ref().map(String::as_str)

  • Replace deprecated std::error::Error::description with Display::to_string

  • Replace Iterator::nth(0) with Iterator::next()

  • One of the tests fired a clippy lint aviyt throwing away the error in an Err(_err) match arm. Make the test use the error.

+23 -24

0 comment

4 changed files

pr created time in 2 months

create barncharsing/iotedge

branch : rustup

created branch time in 2 months

pull request commentAzure/iotedge

remove dependency on DockerNAT for Linux containers on Windows

@veyalla You're suggesting to use a script from master with packages from 1.0.9. That is also not expected to work.

veyalla

comment created time in 2 months

pull request commentAzure/iotedge

remove dependency on DockerNAT for Linux containers on Windows

You're trying to use a script from master with a CAB which is 1.0.8. The CAB and the script from different branches are not expected to be compatible.

veyalla

comment created time in 2 months

Pull request review commentAzure/iotedge

remove dependency on DockerNAT for Linux containers on Windows

 function Set-ListenConnectUri([string] $ManagementUri, [string] $WorkloadUri) {     $env:IOTEDGE_HOST = $ManagementUri } -function Set-GatewayAddress {-    $gatewayAddress = (Get-NetIpAddress |-            Where-Object {$_.InterfaceAlias -like '*vEthernet (DockerNAT)*' -and $_.AddressFamily -eq 'IPv4'}).IPAddress+function Set-ListenConnectUriForLinuxContainers {+  # "host.docker.internal" is a well-known address that maps to the Host from inside a container on Docker Desktop.

This should be four-space indentation like the rest of the file.

veyalla

comment created time in 3 months

pull request commentAzure/iotedge

[mqtt] Add simple file-based persistence

I think you need to rebase this on master to get rid of Denis's commits at the beginning of your branch?

myagley

comment created time in 3 months

PR closed Azure/iotedge

Reviewers
Allow Edge attached Hardware accelerators

"device_cgroup_rules" attribute is not allowed to be changed. But this is mandatory setting to be able to access USB based hardware accelerators (like INTEL VPUs). Without this attribute set, only way is to run IoTEdge module with previlidged rights... But using this setting it is not required to give admin previliges and also it allows USB attached dynamic devices.

Here is an example of intel OpenVino docker image (to use intel VPU, FPGA etc. attached to edge devie) https://docs.openvinotoolkit.org/latest/_docs_install_guides_installing_openvino_docker_linux.html as in the above example to run the iotedge module without admin privilages, you will use following container create parameters:

docker run --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb <image_name>

Here there is no way to pass "--device-cgroup-rule". parameter in IoTEdge Hub... Today it allows such manifest:

{ "HostConfig": { "PortBindings": { ... ] }, "DeviceCgroupRules": [ "c 189:* rmw" ], .... }

But above manifest always reflected as "DeviceCgroupRules": null on the edge device...

so above changes hope to solve this issue...

+17 -17

1 comment

1 changed file

mustafakasap

pr closed time in 3 months

pull request commentAzure/iotedge

Allow Edge attached Hardware accelerators

The property will be preserved if you set it. That's why all the properties are commented out in the first place. See the DEVNOTE comment at the top of the file.

mustafakasap

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Fix build errors in mqtt pipeline

+# Copyright (c) Microsoft. All rights reserved.

iotedged needs openssl. mqtt code does not.

Yes, the existing Rust install script also installs openssl, but that doesn't mean we want to install openssl for the mqtt code. It's just going to slow down the build for no reason. You should instead edit the script to make installing openssl optional.

In fact I see you just wholesale copied all the scripts for edgelet to this. Why did you do that? Now we have two copies of identical scripts and have to worry about making fixes to both of them.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Fix build errors in mqtt pipeline

+# Copyright (c) Microsoft. All rights reserved.

Why does it need openssl?

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

Port x509 fix to 1.0.9

 function Initialize-IoTEdge {      Set-ProvisioningMode     Set-Certificates+    if ($DpsX509 -or $ManualX509) {

These don't exist in this branch's script.

kkdawkins

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

 The crate is not published to crates.io yet. Please generate docs locally with `  See the `examples/` directory for examples of a publisher and subscriber, and for how to set a will. +# Fuzz testing++The crate is coming with fuzz tests. ++## Prerequisites++```bash+sudo apt install tmux binutils+cargo install afl

This needs to match the afl dep of the crate, so make this cargo install afl --version '^0.6'. Then it won't break when afl 0.7 is released.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

+#!/bin/bash++set -euo pipefail++tmux attach-session -t mqtt-fuzz && exit 0 || :++DIR=$1+if [ ! -d "$DIR" ]; then+    echo "$DIR does not exist"+fi++cd $DIR++rm -rf in/ in.cmin/ in.tmin/++mkdir in.cmin/+i=0+for f in out/fuzzer*/queue/*; do+    cp "$f" "in.cmin/$i"+    i=$(( i + 1 ))+done++mkdir in.tmin/+cargo afl cmin -i in.cmin/ -o in.tmin/ target/release/mqtt3-fuzz+rm -rf in.cmin/++mkdir in.cmin/+for f in in.tmin/*; do+    cargo afl tmin -i "$f" -o "in.cmin/$(basename $f)" target/release/mqtt3-fuzz+done+rm -rf in.tmin/++mkdir in/+cargo afl cmin -i in.cmin/ -o in/ target/release/mqtt3-fuzz+rm -rf in.cmin/++rm -rf out/++(+sleep 1++tmux set-option -t 'mqtt-fuzz' pane-border-status top

Sorry, remove these three set-option lines too. They're just personal customization (and should belong in ~/.tmux.conf anyway).

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

 The crate is not published to crates.io yet. Please generate docs locally with `  See the `examples/` directory for examples of a publisher and subscriber, and for how to set a will. +# Fuzz testing++The crate is coming with fuzz tests. ++## Prerequisites++```bash+sudo apt install tmux binutils+cargo install afl+```++## Run fuzzer++```bash+echo 'core' | sudo tee /proc/sys/kernel/core_pattern++which gold

I don't think you need gold. In any case, you don't need to test for it here.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

 The crate is not published to crates.io yet. Please generate docs locally with `  See the `examples/` directory for examples of a publisher and subscriber, and for how to set a will. +# Fuzz testing++The crate is coming with fuzz tests. ++## Prerequisites++```bash+sudo apt install tmux binutils+cargo install afl+```++## Run fuzzer++```bash+echo 'core' | sudo tee /proc/sys/kernel/core_pattern++which gold++/build/linux/mqtt-fuzz.sh ../mqtt3-fuzz/

Add some explanation above each command. Something like:

# mqtt-fuzz.sh spawns a tmux session with 6 panes. The first pane is the master afl instance, and the remaining five are slave instances.
# Press any key to start the master instance, wait for it to start running, then press any key in the five slave instances to start them too.

and

# mqtt-fuzz-rerun.sh uses the output of a previous run of mqtt-fuzz.sh or mqtt-fuzz-rerun.sh as the starting corpus.
# Use this if you interrupted a previous run of mqtt-fuzz.sh or mqtt-fuzz-rerun.sh and want to resume from where it left off.
dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

 The crate is not published to crates.io yet. Please generate docs locally with `  See the `examples/` directory for examples of a publisher and subscriber, and for how to set a will. +# Fuzz testing++The crate is coming with fuzz tests. ++## Prerequisites++```bash+sudo apt install tmux binutils+cargo install afl+```++## Run fuzzer++```bash+echo 'core' | sudo tee /proc/sys/kernel/core_pattern++which gold++/build/linux/mqtt-fuzz.sh ../mqtt3-fuzz/++build/linux/mqtt-fuzz-rerun.sh ../mqtt3-fuzz/++echo '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h' | sudo tee /proc/sys/kernel/core_pattern

You don't need to mention this. Or if you do want to mention it, at least say that the user should only do this when they're done with fuzzing and want to restore the original value. Even then, this is just what the default was on my openSUSE machine; it wouldn't necessarily be this on everyone else's.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

 The crate is not published to crates.io yet. Please generate docs locally with `  See the `examples/` directory for examples of a publisher and subscriber, and for how to set a will. +# Fuzz testing++The crate is coming with fuzz tests. ++## Prerequisites++```bash+sudo apt install tmux binutils+cargo install afl+```++## Run fuzzer++```bash+echo 'core' | sudo tee /proc/sys/kernel/core_pattern

Add a comment why this is needed. Something like:

# afl requires dumps to be taken as quickly as possible, so configure kernel to just write the coredump instead of anything fancy.
dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Add afl fuzz testing scripts

 The crate is not published to crates.io yet. Please generate docs locally with `  See the `examples/` directory for examples of a publisher and subscriber, and for how to set a will. +# Fuzz testing++The crate is coming with fuzz tests. ++## Prerequisites++```bash+sudo apt install tmux binutils+cargo install afl+```++## Run fuzzer++```bash+echo 'core' | sudo tee /proc/sys/kernel/core_pattern++which gold++/build/linux/mqtt-fuzz.sh ../mqtt3-fuzz/

This should be build/linux/mqtt-fuzz.sh ? No leading /.

Also if you're going to run this from the mqtt directory, then the path to mqtt3-fuzz would be just mqtt3-fuzz, not ../mqtt3-fuzz

dmolokanov

comment created time in 3 months

push eventarsing/libiothsm2

Arnav Singh

commit sha fefd68b68ebaf16a851c6ce0409cdfa0f5ee2910

T

view details

push time in 3 months

push eventarsing/libiothsm2

Arnav Singh

commit sha f1b60e26d8938715de06cf94b3180a83b3689ce5

T

view details

push time in 3 months

Pull request review commentAzure/iotedge

Install intermediate certs on windows for x509 dps group registration

 function Initialize-IoTEdge {      Set-ProvisioningMode     Set-Certificates+    if($DpsX509) {

$DpsX509 is optional. The cmdlet may be in the DPSX509 parameter set even without that particular switch. You need to look at $PSCmdlet.ParameterSetName just like line 282.

Also, we should do this for ManualX509 too. Just in case.

kkdawkins

comment created time in 3 months

Pull request review commentAzure/iotedge

Install intermediate certs on windows for x509 dps group registration

 function Download-File([string] $Description, [string] $Url, [string] $DownloadF     return $result } +function Import-IntermediateCertChain([string] $DeviceIdentityCertPath){ +    $certificateStore = New-Object System.Security.Cryptography.X509Certificates.X509Store ("CA", "LocalMachine")+    $certificateStore.Open("ReadWrite");++    $certEnd = "END CERTIFICATE"+    +    $certs = New-Object System.Collections.ArrayList+    $currentCert = [System.Text.StringBuilder]::new()+    foreach($line in [System.IO.File]::ReadLines($DeviceIdentityCertPath)) {

Missing space between foreach and (

kkdawkins

comment created time in 3 months

Pull request review commentAzure/iotedge

Install intermediate certs on windows for x509 dps group registration

 function Download-File([string] $Description, [string] $Url, [string] $DownloadF     return $result } +function Import-IntermediateCertChain([string] $DeviceIdentityCertPath){ 

Missing space before the {

kkdawkins

comment created time in 3 months

Pull request review commentAzure/iotedge

Install intermediate certs on windows for x509 dps group registration

 function Download-File([string] $Description, [string] $Url, [string] $DownloadF     return $result } +function Import-IntermediateCertChain([string] $DeviceIdentityCertPath){ +    $certificateStore = New-Object System.Security.Cryptography.X509Certificates.X509Store ("CA", "LocalMachine")+    $certificateStore.Open("ReadWrite");++    $certEnd = "END CERTIFICATE"+    +    $certs = New-Object System.Collections.ArrayList+    $currentCert = [System.Text.StringBuilder]::new()+    foreach($line in [System.IO.File]::ReadLines($DeviceIdentityCertPath)) {+        if ($line -Match $certEnd){+            [void]$currentCert.AppendLine($line)+            [void]$certs.Add($currentCert.ToString())+            [void]$currentCert.Clear()+        }+        else {+            [void]$currentCert.AppendLine($line)+        }+    }++    # Drop the first certificate and add all remaining to certificate store+    $enc = [system.Text.Encoding]::UTF8

system -> System

kkdawkins

comment created time in 3 months

Pull request review commentAzure/iotedge

Install intermediate certs on windows for x509 dps group registration

 function Download-File([string] $Description, [string] $Url, [string] $DownloadF     return $result } +function Import-IntermediateCertChain([string] $DeviceIdentityCertPath){ +    $certificateStore = New-Object System.Security.Cryptography.X509Certificates.X509Store ("CA", "LocalMachine")+    $certificateStore.Open("ReadWrite");

Use the full typed enums instead of strings, please.

kkdawkins

comment created time in 3 months

Pull request review commentAzure/iotedge

Install intermediate certs on windows for x509 dps group registration

 function Download-File([string] $Description, [string] $Url, [string] $DownloadF     return $result } +function Import-IntermediateCertChain([string] $DeviceIdentityCertPath){ +    $certificateStore = New-Object System.Security.Cryptography.X509Certificates.X509Store ("CA", "LocalMachine")+    $certificateStore.Open("ReadWrite");++    $certEnd = "END CERTIFICATE"+    +    $certs = New-Object System.Collections.ArrayList+    $currentCert = [System.Text.StringBuilder]::new()

New-Object System.Text.StringBuilder to be consistent.

kkdawkins

comment created time in 3 months

pull request commentAzure/iotedge

Backport CentOS fixes to 1.0.9

(The devguide commit is there because the openssl sonames commit makes changes on top of it, and rather than resolve the merge conflict I figured it would be useful to c-p the devguide commit on its own worth.)

arsing

comment created time in 3 months

PR opened Azure/iotedge

Reviewers
Backport CentOS fixes to 1.0.9
  • 20b5f1fbd4aa350f2645d3b717e6ef51908feb8a

    Update edgelet devguide. (#2428)

    • Talk about building the packages as an alternative to building the binaries.

      Discussed in https://github.com/Azure/iotedge/pull/2301

    • Building binaries on Windows requires VS / VSBT and cmake.

    • Both OPENSSL_DIR and OPENSSL_ROOT_DIR need to be set for macOS and Windows.

    • Take into account that builds don't necessarily use "stable", but whatever happens to be in the rust-toolchain file.

    • cargo build --all spends time building Kubernetes dependencies. cargo build -p iotedged -p iotedge is sufficient.

    • Talk about how to actually run the binaries.

    • Update some URLs, such as from the merger of the rust-lang-nursery and rust-lang GitHub orgs.

  • 958e4b05622a429bed08547f6e7915bc4a25fe0e

    Fix CentOS arm32v7 and aarch64 packages to depend on correct openssl sonames. (#2518)

    Before this change, these two targets were built using Linaro compilers and against custom-compiled openssl. However the packages built this way ended up depending on libcrypto.so.1.0.0 and libssl.so.1.0.0, whereas CentOS's openssl-libs package provides libcrypto.so.10 and libssl.so.10

    Since CentOS 7 does not ship cross-compiler packages and openssl, this commit changes the build steps to run the native arm32v7 and arm64v8 CentOS Docker containers in qemu instead of cross-compiling.

    Since qemu builds are very slow (2h30m instead of 15m), this commit moves them to a new pipeline job so that it does not block existing downstream jobs like E2E tests that don't need the CentOS packages.

    Lastly, the new job runs on Ubuntu 18.04 hosts instead of Ubuntu 16.04 hosts. Ubuntu 16.04 supports getrandom, but its qemu is just old enough to not implement it, which breaks processes inside the container that require it.

    Fixes #2398

  • fd2dc5a670fc05d2fbc111fd8a3256251869bfe5

    Fix libiothsm-std centos7-amd64 and centos7-aarch64 packages to install to /usr/lib64. (#2625)

    c1e2d5e93bf08d5b2ea7e52ab2bd8957652a7e88 defined CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for all targets, however this breaks GNUInstallDirs.cmake's detection of the system architecture, so it doesn't realize CentOS amd64's libdir is /usr/lib64. Instead it defaults to /usr/lib, which causes the libiothsm-std package to install libiothsm.so to /usr/lib and causes iotedged to fail to find it.

    Before the package.sh refactoring, CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION were only defined for arm32 and aarch64 targets, via 0dac12c17f03261c2a2979d09457327012e44f91. So this commit restores that behavior.

    For CentOS specifically, we also don't want to define CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for the arm32v7 and aarch64 builds anyway, because they're only supposed to be defined when cross-compiling, whereas the CentOS arm32v7 and aarch64 builds run natively (via qemu).

+370 -127

0 comment

4 changed files

pr created time in 3 months

create barncharsing/iotedge

branch : fix-centos

created branch time in 3 months

delete branch arsing/iotedge

delete branch : fix-centos-amd64

delete time in 3 months

push eventarsing/iotedge

dylanbronson

commit sha 6872810cd250fc48a7b48cd6c355258171c160b9

DMReportGenerator bug fix for connectivity test: non-offline cases (#2582) Previously, DirectMethodReportGenerator for connectivity tests did not take into account satellite and cellular cases. So we would see many failures in those cases. This PR allows the DMReportGenerator to account for non-offline cases.

view details

David Robson

commit sha 934840be9f0a56b753214077f3a7ede00f85844e

[k8s] Remove pv name at startup and replace with "useMountSourceForVolumeName" (#2620) Set `useMountSourceForVolumeName` as guidance for converting Docker Volume mounts to Persistent Volume Claims. Set to true to tell the runtime to use the Volume mount source (mount.Source) as the Persistent volume name (volumeName) in the PVC. False (default) will not set volume Name.

view details

David Robson

commit sha 7cbc607ccc483d6e0ab9642be76c8b2d8bc09605

[k8s] Add "Cmd", "Entrypoint", and "WorkingDir" translations (#2629) Make "Cmd", "Entrypoint", and "WorkingDir" of DockerOptions available in CombinedKubernetesConfig, and translate them to k8s options on the module container.

view details

Andrew Smith

commit sha 050f3e808ab8c00b7f0263203a99d341a590f462

Longhaul/Stress: Remove unused env var from analyzer (#2633) There is an unused env var in our deployment templates.

view details

yophilav

commit sha bb8b1fbf3212d53562ea714aaffbf52922841e43

Fixed the TwinTester to use a proper key param casing (#2628) - testStartDelay - testDuration - testResultCoordinatorUrl

view details

Arnav Singh

commit sha 40137337dd6df342abdff95f9fb242aedfb085c8

Fix libiothsm-std centos7-amd64 and centos7-aarch64 packages to install to /usr/lib64 c1e2d5e93bf08d5b2ea7e52ab2bd8957652a7e88 defined CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for all targets, however this breaks GNUInstallDirs.cmake's detection of the system architecture, so it doesn't realize CentOS amd64's libdir is /usr/lib64. Instead it defaults to /usr/lib, which causes the libiothsm-std package to install libiothsm.so to /usr/lib and causes iotedged to fail to find it. Before the package.sh refactoring, `CMAKE_SYSTEM_NAME` and `CMAKE_SYSTEM_VERSION` were only defined for arm32 and aarch64 targets, via 0dac12c17f03261c2a2979d09457327012e44f91. So this commit restores that behavior. For CentOS specifically, we also don't want to define `CMAKE_SYSTEM_NAME` and `CMAKE_SYSTEM_VERSION` for the arm32v7 and aarch64 builds anyway, because they're only supposed to be defined when cross-compiling, whereas the CentOS arm32v7 and aarch64 builds run natively (via qemu).

view details

push time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

-An MQTT v3.1.1 Client implementation in Rust

As discussed, this README is specific to the crate, so you shouldn't delete it.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

 fn main() {         .shutdown_handle()         .expect("couldn't get shutdown handle");     runtime.spawn(async move {-        let () = tokio::signal::ctrl_c()

:(

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

 impl mqtt3::IoSource for IoSource {             // If the connection broke while there were still steps remaining in the TestConnection, then the dropped sender will cause the test             // to receive a futures_channel::oneshot::Canceled error, so the test will panic before this deadline elapses anyway.             Box::pin(async {-                let () = tokio::time::delay_for(std::time::Duration::from_secs(5)).await;+                tokio::time::delay_for(std::time::Duration::from_secs(5)).await;                 unreachable!();             })         }     } }  /// A single connection between a client and a server+#[allow(clippy::type_complexity)]

As discussed, you should be able to move this to the specific field that it complained about instead of applying it to the whole struct.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

 impl PacketMeta for Connect {         let protocol_name = super::Utf8StringDecoder::default()             .decode(&mut src)?             .ok_or(super::DecodeError::IncompletePacket)?;-        if protocol_name != "MQTT" {

As discussed, you should add this and the protocol level check back.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

 stylecop.json *.swp *.swo *.vi++# fuzz+in+out

Missing newline at end-of-file.

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

+# -*- mode: dockerfile -*-+#+# An example Dockerfile showing how to build a Rust executable using this+# image, and deploy it with a tiny Alpine Linux container.++# You can override this `--build-arg BASE_IMAGE=...` to use different+# version of Rust or OpenSSL.+ARG BASE_IMAGE=ekidd/rust-musl-builder:beta

It needs beta ? stable doesn't work?

dmolokanov

comment created time in 3 months

Pull request review commentAzure/iotedge

[mqtt] Import mqtt-broker project

+[package]

Ah, if you're importing this too, then I have a couple of scripts I use locally to run afl that we should add here as a README or something. Remind me when I come in tomorrow.

dmolokanov

comment created time in 3 months

push eventarsing/iotedge

Arnav Singh

commit sha 4d27d0f9d12095730fcbfdc415169ffd86d3d5f5

Only define CMAKE_SYSTEM_{NAME,VERSION} when cross-compiling. In other words, since CentOS 7 arm32 and aarch64 are built natively (under qemu) instead of being cross-compiled, the two variables should not be defined for them.

view details

push time in 3 months

Pull request review commentAzure/iotedge

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64.

 case "$PACKAGE_ARCH" in         ;;      'arm32v7')+        CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1"

I have been enlightened.

CMakeDetermineSystem.cmake

# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
# or it was set via -DCMAKE_SYSTEM_NAME=...
# if that's the case, assume we are crosscompiling
if(CMAKE_SYSTEM_NAME)
 if(NOT DEFINED CMAKE_CROSSCOMPILING)
   set(CMAKE_CROSSCOMPILING TRUE)
 endif()
else()
 set(CMAKE_SYSTEM_NAME      "${CMAKE_HOST_SYSTEM_NAME}")
 set(CMAKE_SYSTEM_VERSION   "${CMAKE_HOST_SYSTEM_VERSION}")
 set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
 set(CMAKE_CROSSCOMPILING FALSE)
endif()

So it should also not be defined for the CentOS arm32 and aarch64 targets since those are being compiled natively. I confirmed that an aarch64 build on my machine with the two not set ends up using /usr/lib64 correctly.


Also, re: the original question of what value to use for CMAKE_SYSTEM_VERSION:

# CMAKE_SYSTEM_VERSION - on unix this is uname -r, for windows it is empty

So this is actually the kernel version. I suppose we could set it to the output of uname -r ourselves, but for the stuff we're building the kernel version doesn't really make a difference. I'm leaning towards just leaving it as 1

arsing

comment created time in 3 months

Pull request review commentAzure/iotedge

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64.

 case "$PACKAGE_ARCH" in         ;;      'arm32v7')+        CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1"

Yeah, CentOS aarch64 does use /usr/lib64, and linux/1 does do the wrong thing for it. So we do need to figure out what exactly is needed to make it work.

arsing

comment created time in 3 months

Pull request review commentAzure/iotedge

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64.

 case "$PACKAGE_ARCH" in         ;;      'arm32v7')+        CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1"

I'll go through the .cmakes again and see what exactly cmake was looking for in these too to determine the libdir. Technically even before the package.sh refactoring we were defining Linux/1 (see Mahesh's commit linked in the commit message), so it shouldn't be worse than what it was back then. Then again, the arm32 and aarch64 packages before the refactoring were broken because of the malformed openssl dependency anyway, so they clearly had never been tested and Linux/1 may never have been right for CentOS at all.

I also need to check what the libdir is on centos aarch64; if it's supposed to be /usr/lib64 then Linux/1 will probably break it too.

arsing

comment created time in 3 months

push eventarsing/iotedge

Andrew Smith

commit sha 39821e9ce76de8f796731a332b585afff82b83ec

IoTEdgeDevOps Dashboard: Fix vsts upload and analyzer status reporting (#2624) We previously made the assumption that release environment pipeline tasks would not be null for an existing deployment. Apparently this is not the case, as the current implementation started throws an argument exception.

view details

Arnav Singh

commit sha 46991a15f5fa6aa147690a40b7f0c19113a87079

Revert cmake to default 2.x package instead of EPEL's 3.x

view details

Arnav Singh

commit sha 13e197a2e8273a8e5991e178cc0a125ba2304ecc

Merge remote-tracking branch 'upstream/master' into fix-centos-amd64

view details

push time in 3 months

pull request commentAzure/iotedge

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64.

CentOS ARM32 build failed because it looks like it doesn't have epel. I think I'll revert the cmake3 part of the change.

arsing

comment created time in 3 months

PR opened Azure/iotedge

Reviewers
Fix libiothsm-std centos7-amd64 package to install to /usr/lib64.

c1e2d5e93bf08d5b2ea7e52ab2bd8957652a7e88 defined CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for all targets, however this breaks GNUInstallDirs.cmake's detection of the system architecture, so it doesn't realize CentOS's libdir is /usr/lib64. Instead it defaults to /usr/lib.

Before the package.sh refactoring, CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION were only defined for arm32 and aarch64 targets, via 0dac12c17f03261c2a2979d09457327012e44f91. So this commit restores that behavior.

Also, darobs believes it would be best to use cmake3 on CentOS instead of the default cmake which is v2.x, so this commit also makes that change.


Keeping as draft PR while I run the packages build.

+15 -4

0 comment

1 changed file

pr created time in 3 months

push eventarsing/iotedge

Arnav Singh

commit sha cc10393dafd0a3568a18c568dc50c2ad1da71710

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64. c1e2d5e93bf08d5b2ea7e52ab2bd8957652a7e88 defined CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for all targets, however this breaks GNUInstallDirs.cmake's detection of the system architecture, so it doesn't realize CentOS's libdir is /usr/lib64. Instead it defaults to /usr/lib. Before the package.sh refactoring, CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION were only defined for arm32 and aarch64 targets, via 0dac12c17f03261c2a2979d09457327012e44f91. So this commit restores that behavior. Also, darobs believes it would be best to use cmake3 on CentOS instead of the default cmake which is v2.x, so this commit also makes that change.

view details

push time in 3 months

push eventarsing/iotedge

Arnav Singh

commit sha 6f1cedfe9260c8bdbaa72878fe9200c8648cc4d9

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64. c1e2d5e93bf08d5b2ea7e52ab2bd8957652a7e88 defined CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for all targets, however this breaks GNUInstallDirs.cmake's detection of the system architecture, so it doesn't realize CentOS's libdir is /usr/lib64. Instead it defaults to /usr/lib. Before the package.sh refactoring, CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION were only defined for arm32 and aarch64 targets, via 0dac12c17f03261c2a2979d09457327012e44f91. So this commit restores that behavior. Also, darobs believes it would be best to use cmake3 on CentOS instead of the default cmake which is v2.x, so this commit also makes that change.

view details

push time in 3 months

push eventarsing/iotedge

Philip Lin

commit sha 39d5b1461aaa12e20357b4e1b6aa242c7b74842f

fix connectivity yaml for arm32 (#2613) fix connectivity yaml for arm32

view details

Arnav Singh

commit sha 8833374bb84c1accb557aa4603b042ce8ec0abfa

Fix libiothsm-std centos7-amd64 package to install to /usr/lib64. c1e2d5e93bf08d5b2ea7e52ab2bd8957652a7e88 defined CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION for all targets, however this breaks GNUInstallDirs.cmake's detection of the system architecture, so it doesn't realize CentOS's libdir is /usr/lib64. Instead it defaults to /usr/lib. Before the package.sh refactoring, CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_VERSION were only defined for arm32 and aarch64 targets, via 0dac12c17f03261c2a2979d09457327012e44f91. So this commit restores that behavior.

view details

push time in 3 months

create barncharsing/iotedge

branch : fix-centos-amd64

created branch time in 3 months

Pull request review commentAzure/iotedge

Import mqtt-broker project

+[package]+name = "mqtt-broker"+version = "0.1.0"+authors = ["Azure IoT Edge Devs"]+edition = "2018"++# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html++[dependencies]+async-trait = "0.1"+failure = "0.1"+futures-util = { version = "0.3", features = ["sink"] }+lazy_static = "1"+tokio = { version = "0.2", features = ["macros", "rt-threaded", "signal", "stream", "sync", "tcp"] }+tokio-io-timeout = "0.4"+tokio-util = { version = "0.2", features = ["codec"] }+tracing = "0.1"+tracing-futures = "0.2"+uuid = { version = "0.8", features = ["v4"] }++mqtt = { git = "https://github.com/myagley/mqtt", branch = "v0.2.x" }

You should import this too.

dmolokanov

comment created time in 3 months

push eventarsing/libiothsm2

Arnav Singh

commit sha cc1ac4d2890e6ced7cf410604f8050aa7c2a6e16

T

view details

push time in 3 months

push eventarsing/openssl-pkcs11-demo

Arnav Singh

commit sha 2a5ded06ced992303fc2ff4fe555ec12db02ae9b

Prefix exported unmangled functions so that they don't collide with other engines built from the same code.

view details

Arnav Singh

commit sha fbb32e66ede2d340084108cb7632b4ef2147b12f

Move EC curve NID<->OID code to openssl2.

view details

push time in 3 months

more