New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement device management subcommand #7844

Merged
merged 8 commits into from Aug 31, 2018

Conversation

Projects
None yet
5 participants
@theotherjimmy
Contributor

theotherjimmy commented Aug 21, 2018

Description

This series implements the device-managment/dev-mgmt/dm mbed cli
subcommand. This subcommand is much like all of manifest tool, except it
also removes a few difficulties with using the manifest tool with an
Mbed OS project. In particular:

  • mbed dm init will pull create/find and download a developer
    certificate for you
  • mbed dm update will automatially populate the payload feild with
    the most recently built "application" side of a managed BL mode project

Note: mbed dm subcommand implemented by ARMmbed/mbed-cli#735

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:fw-update-integration branch from 3f03171 to a6163cb Aug 21, 2018

@cmonr cmonr self-requested a review Aug 22, 2018

app_name, output_ext
))
options.payload = open(payload_name, "rb")
return func(options)

This comment has been minimized.

@cmonr

cmonr Aug 22, 2018

Contributor

Very interesting pattern for wrapping a function call.

@cmonr

cmonr approved these changes Aug 22, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 22, 2018

@theotherjimmy Can you think of anyone else who should probably review this PR?

@cmonr cmonr added the needs: review label Aug 22, 2018

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Aug 22, 2018

@bridadan Maybe would be a good candidate

@bridadan

Looks good! I think a few comments sprinkled throughout some of the more obscure bits would help for future maintenance/readability, but otherwise good!

from tools.options import extract_mcus
class MbedExtendedArgs(MainArgumentParser):

This comment has been minimized.

@bridadan

bridadan Aug 22, 2018

Contributor

So this class is basically "eating up" the unused arguments that mbed-cli will always provide? Do you think you could add a few code comments describing what this class is doing for other maintainers?

This comment has been minimized.

@theotherjimmy

theotherjimmy Aug 23, 2018

Contributor

This class is not doing that. It's removing the required-ness of the "payload" parameter and adding another way to specify the payload as a build artefact.

This comment has been minimized.

@bridadan

bridadan Aug 24, 2018

Contributor

Ok, I guess my initial feedback about the code comments still stands then. But that's just for folks who poke at this code, not for the use of the feature (aka not a blocker).

with open("mbed_cloud_dev_credentials.c", "w") as fout:
fout.write(dev_cert_info.header_file)
return func(options)
return inner

This comment has been minimized.

@bridadan

bridadan Aug 22, 2018

Contributor

This is awesome! Nice 👍

theotherjimmy added a commit to theotherjimmy/Handbook that referenced this pull request Aug 23, 2018

@cmonr cmonr added risk: G needs: CI and removed needs: review labels Aug 24, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 24, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Aug 24, 2018

Build : SUCCESS

Build number : 2887
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7844/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 26, 2018

/morph test

1 similar comment
@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 27, 2018

/morph test

@@ -15,3 +15,5 @@ pyelftools>=0.24
jsonschema>=2.6
future>=0.16.0
six>=1.11.0
git+https://github.com/armmbed/manifest-tool.git@v1.4.5
mbed-cloud-sdk==2.0.0

This comment has been minimized.

@0xc0170

0xc0170 Aug 27, 2018

Member

This is causing test to fail to initialize. Please review the test results (find them via the log, they did not report back as it fails really early)

Collecting mbed-cloud-sdk==2.0.0 (from -r requirements.txt (line 19))
python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:369: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning

This comment has been minimized.

@theotherjimmy

theotherjimmy Aug 29, 2018

Contributor

https://pypi.org/project/mbed-cloud-sdk/

It exists, why is CI failing to install it?

This comment has been minimized.

@cmonr

cmonr Aug 29, 2018

Contributor

@0xc0170 Fwiw, I was unable to reproduce the failure. pip install -r requirements when using this PR head worked fine.

This comment has been minimized.

@cmonr

cmonr Aug 29, 2018

Contributor

Ah! Got the log:

pip install -r requirements.txt
Collecting git+https://github.com/armmbed/manifest-tool.git@v1.4.5 (from -r requirements.txt (line 18))
  Cloning https://github.com/armmbed/manifest-tool.git (to revision v1.4.5) to /tmp/pip-req-build-x1310E
Requirement already satisfied: colorama>=0.3.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1)) (0.3.9)
Requirement already satisfied: PySerial>=2.7 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2)) (3.4)
Requirement already satisfied: PrettyTable>=0.7.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3)) (0.7.2)
Requirement already satisfied: Jinja2>=2.7.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4)) (2.10)
Requirement already satisfied: IntelHex>=1.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5)) (2.1)
Requirement already satisfied: junit-xml in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6)) (1.8)
Requirement already satisfied: pyYAML in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 7)) (3.12)
Requirement already satisfied: requests in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 8)) (2.2.1)
Requirement already satisfied: mbed-ls>=0.2.13 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 9)) (1.3.5)
Requirement already satisfied: mbed-host-tests>=1.1.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 10)) (1.3.0)
Requirement already satisfied: mbed-greentea>=0.2.24 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 11)) (1.3.2)
Requirement already satisfied: beautifulsoup4>=4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 12)) (4.6.0)
Requirement already satisfied: fuzzywuzzy>=0.11 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 13)) (0.16.0)
Requirement already satisfied: pyelftools>=0.24 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 14)) (0.24)
Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 15)) (2.6.0)
Requirement already satisfied: future>=0.16.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 16)) (0.16.0)
Requirement already satisfied: six>=1.11.0 in ./.env/lib/python2.7/site-packages (from -r requirements.txt (line 17)) (1.11.0)
Collecting mbed-cloud-sdk==2.0.0 (from -r requirements.txt (line 19))
/redacted/.env/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:369: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
/redacted/.env/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement mbed-cloud-sdk==2.0.0 (from -r requirements.txt (line 19)) (from versions: )
No matching distribution found for mbed-cloud-sdk==2.0.0 (from -r requirements.txt (line 19))

@0xc0170 0xc0170 added needs: work and removed needs: CI labels Aug 27, 2018

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:fw-update-integration branch from b2bfddc to a6163cb Aug 28, 2018

@0xc0170 0xc0170 added the risk: A label Aug 29, 2018

@0xc0170 0xc0170 removed the risk: G label Aug 29, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 29, 2018

Retriggering to get CI information.

/morph test

Added secure urllib3 python requirement
This pulls in additional packages requiured for SSL verification for Py2
Ref: https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 29, 2018

/morph test

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 29, 2018

/morph test

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 29, 2018

/morph build

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 29, 2018

Because of course we would have license issues...

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Aug 30, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Aug 30, 2018

Build : SUCCESS

Build number : 2961
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7844/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 30, 2018

/morph test

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 30, 2018

CI error

/morph test

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Aug 30, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 30, 2018

Seems like Ci is not triggering the build, one more try and then I'll run it manually

/morph test

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 30, 2018

/morph test

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit b6f0ee2 into ARMmbed:master Aug 31, 2018

14 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0.0%) RAM(+0.0%)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud_client_smoke_test Test job: successful
Details
travis-ci/astyle Passed, 558 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9113 cycles (-334 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment