Skip to content
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

feat: allow override of key location and remove old version support #227

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

shawaj
Copy link
Member

@shawaj shawaj commented Mar 11, 2023

Issue

How

This is a quick and hacky fix to the issue described here NebraLtd/helium-syncrobit#2 (comment)

The idea is to allow a device level environment variable SWARM_KEY_URI_OVERRIDE in balenaCloud to override the key location in the assigned variant without needing to define a new variant. This is useful for testing new devices or in instances like this Syncrobit one to provide a quick fix until we have implemented a "proper" fix to this issue.

This additionally changes the following:

  • we hard code the gateway_mfr_rs version in the test and production python package build actions, so there is no need to support old versions of gateway-mfr-rs
  • due to removing the above, there is also no need to keep the KEY_STORAGE_BUS key in the hardware variants as this is not used anywhere else that I'm aware of (we should double check this in config, diag, miner, packet forwarder and multiplexer containers just to be 100% sure)

Screenshots

References

Relates-to: NebraLtd/helium-syncrobit#2
Relates-to: #221
Relates-to: #222

Checklist

  • Tests added
  • Cleaned up commit history (rebase!)
  • Documentation added
  • Thought about variable and method names

@shawaj shawaj changed the title feat: allow override of key location feat: allow override of key location and remove old version support Mar 11, 2023
@shawaj shawaj force-pushed the shawaj/keyoverride branch from b5e21c8 to 75f640d Compare March 11, 2023 20:32
@shawaj shawaj marked this pull request as ready for review March 11, 2023 20:34
@shawaj shawaj requested a review from a team as a code owner March 11, 2023 20:34
@shawaj shawaj force-pushed the shawaj/keyoverride branch from 77156e1 to 211181f Compare March 11, 2023 21:16
This is a quick and hacky fix to the issue described here NebraLtd/helium-syncrobit#2 (comment)

The idea is to allow a device level environment variable `SWARM_KEY_URI_OVERRIDE` in balenaCloud to override the key location in the assigned variant without needing to define a new variant. This is useful for testing new devices or in instances like this Syncrobit one to provide a quick fix until we have implemented a "proper" fix to this issue.

This additionally changes the following:
- we hard code the gateway_mfr_rs version in the [test](https://github.com/NebraLtd/hm-pyhelper/blob/master/.github/workflows/publish-to-pypi-test.yml) and [production](https://github.com/NebraLtd/hm-pyhelper/blob/master/.github/workflows/publish-to-pypi.yml) python package build actions, so there is no need to support old versions of gateway-mfr-rs
- due to removing the above, there is also no need to keep the KEY_STORAGE_BUS key in the hardware variants as this is not used anywhere else that I'm aware of **(we should double check this in config, diag, miner, packet forwarder and multiplexer containers just to be 100% sure)**
  - [Used as a fallback in diag](https://github.com/NebraLtd/hm-diag/blob/23c66980f75568a4cecb18c5375a08cd67bff550/hw_diag/utilities/hardware.py#L200) but not required

Relates-to: NebraLtd/helium-syncrobit#2
Relates-to: #221
Relates-to: #222
@shawaj shawaj force-pushed the shawaj/keyoverride branch from 5026742 to bef8272 Compare March 13, 2023 19:55
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@shawaj shawaj merged commit f10b6bc into master Mar 13, 2023
@shawaj shawaj deleted the shawaj/keyoverride branch March 13, 2023 20:37
shawaj added a commit to NebraLtd/hm-miner that referenced this pull request Mar 14, 2023
- add override of swarm key location via environment variable
- additionally make the indentation in file the same everywhere
- add helium OG specific config

Relates-to: NebraLtd/helium-syncrobit#2
Relates-to: NebraLtd/hm-pyhelper#227
Relates-to: NebraLtd/hm-diag#503
@vstrong-info
Copy link

Thank you @shawaj
Is it as easy as to add this variable to a specific miner in Balena Cloud? What Service does it need to be added to?
In this example, I put value of 1 but it may be 0, 1, 2, 3 or 4 - the slot number - and then see which one brings miner online?
image
Thank you in advance.

@shawaj
Copy link
Member Author

shawaj commented Mar 16, 2023

Thank you @shawaj Is it as easy as to add this variable to a specific miner in Balena Cloud? What Service does it need to be added to? In this example, I put value of 1 but it may be 0, 1, 2, 3 or 4 - the slot number - and then see which one brings miner online? image Thank you in advance.

No it's not that simple. Also the update hasn't made it into production yet we are still testing it. Once it's there we will document it :-)

@vstrong-info
Copy link

@shawaj There are two devices with this issue in my fleet that I shared with you, if you want to test the patch on them.
UUID - fc777aa2ee7382a8e13784746e703b6f
UUID - 7710b75d7364a77375ec9d6f541ab6a2
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants