-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add light hotspot automation #411
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -10,34 +10,6 @@ jobs: | |||
fail-fast: false | ||||
matrix: | ||||
sbc: [raspi, rockpi, rak, pisces, og, sensecap, finestra, controllino] | ||||
frequency: [470, 868, 915] | ||||
variant: [indoor, outdoor] | ||||
exclude: | ||||
- sbc: rak | ||||
- sbc: pisces | ||||
- sbc: og | ||||
- sbc: sensecap | ||||
- sbc: finestra | ||||
- sbc: controllino | ||||
include: | ||||
- sbc: pisces | ||||
variant: indoor | ||||
frequency: 868 | ||||
- sbc: rak | ||||
variant: indoor | ||||
frequency: 868 | ||||
- sbc: og | ||||
variant: indoor | ||||
frequency: 868 | ||||
- sbc: sensecap | ||||
variant: indoor | ||||
frequency: 868 | ||||
- sbc: finestra | ||||
variant: indoor | ||||
frequency: 868 | ||||
- sbc: controllino | ||||
variant: indoor | ||||
frequency: 868 | ||||
steps: | ||||
- name: Checkout | ||||
uses: actions/checkout@v2 | ||||
|
@@ -62,7 +34,7 @@ jobs: | |||
- name: Generate Docker Compose for RAK and Non-Nebra RasPi | ||||
if: matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino' | ||||
run: | | ||||
python gen_docker_compose.py rpi -o docker-compose.yml | ||||
python gen_docker_compose.py rpi -o docker-compose.yml | ||||
cp balena/balena.yml.${{ matrix.sbc }} balena.yml | ||||
- name: Generate Docker Compose for Pisces | ||||
if: matrix.sbc == 'pisces' | ||||
|
@@ -74,13 +46,13 @@ jobs: | |||
if: matrix.sbc == 'rockpi' && success() | ||||
with: | ||||
balena_api_token: ${{secrets.BALENA_API_TOKEN}} | ||||
balena_command: "deploy nebraltd/helium-${{ matrix.variant }}-${{ matrix.frequency }}${{ env.ROCKPI }} --logs --debug --nocache --build --draft" | ||||
balena_command: "deploy nebraltd/helium${{ env.ROCKPI }} --logs --debug --nocache --build --draft" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remind me where env.ROCKPI is being set and what values it takes on? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
- name: Balena Deploy (Nebra RasPi) | ||||
uses: nebraltd/[email protected] | ||||
if: matrix.sbc == 'raspi' && success() | ||||
with: | ||||
balena_api_token: ${{secrets.BALENA_API_TOKEN_1}} | ||||
balena_command: "deploy nebraltd/helium-${{ matrix.variant }}-${{ matrix.frequency }} --logs --debug --nocache --build --draft" | ||||
balena_command: "deploy nebraltd/helium-light-hotspot --logs --debug --nocache --build --draft" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was for production, not testnet. |
||||
- name: Balena Deploy (RAK and Non-Nebra RasPi) | ||||
uses: nebraltd/[email protected] | ||||
if: ( matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino' ) && success() | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,34 +13,6 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
sbc: [raspi, rockpi, rak, pisces, og, sensecap, finestra, controllino] | ||
frequency: [470, 868, 915] | ||
variant: [indoor, outdoor] | ||
exclude: | ||
- sbc: rak | ||
- sbc: pisces | ||
- sbc: og | ||
- sbc: sensecap | ||
- sbc: finestra | ||
- sbc: controllino | ||
include: | ||
- sbc: pisces | ||
variant: indoor | ||
frequency: 868 | ||
- sbc: rak | ||
variant: indoor | ||
frequency: 868 | ||
- sbc: og | ||
variant: indoor | ||
frequency: 868 | ||
- sbc: sensecap | ||
variant: indoor | ||
frequency: 868 | ||
- sbc: finestra | ||
variant: indoor | ||
frequency: 868 | ||
- sbc: controllino | ||
variant: indoor | ||
frequency: 868 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -63,7 +35,7 @@ jobs: | |
- name: Generate Docker Compose for RAK and Non-Nebra RasPi | ||
if: matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino' | ||
run: | | ||
python gen_docker_compose.py rpi -o docker-compose.yml | ||
python gen_docker_compose.py rpi -o docker-compose.yml | ||
cp balena/balena.yml.${{ matrix.sbc }} balena.yml | ||
- name: Generate Docker Compose for Pisces | ||
if: matrix.sbc == 'pisces' | ||
|
@@ -75,13 +47,13 @@ jobs: | |
if: matrix.sbc == 'rockpi' && success() | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN}} | ||
balena_command: "deploy nebraltd/helium-${{ matrix.variant }}-${{ matrix.frequency }}${{ env.ROCKPI }} --logs --debug --nocache --build" | ||
balena_command: "deploy nebraltd/helium${{ env.ROCKPI }} --logs --debug --nocache --build" | ||
- name: Balena Deploy (Nebra RasPi) | ||
uses: nebraltd/[email protected] | ||
if: matrix.sbc == 'raspi' && success() | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN_1}} | ||
balena_command: "deploy nebraltd/helium-${{ matrix.variant }}-${{ matrix.frequency }} --logs --debug --nocache --build" | ||
balena_command: "deploy nebraltd/helium-light-hotspot --logs --debug --nocache --build" | ||
- name: Balena Deploy (RAK and Non-Nebra RasPi) | ||
uses: nebraltd/[email protected] | ||
if: ( matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino' ) && success() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,19 +41,19 @@ jobs: | |
if: matrix.sbc == 'rockpi' && success() | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN}} | ||
balena_command: "deploy nebraltd/helium-testnet${{ env.ROCKPI }} --logs --debug --nocache --build --draft" | ||
balena_command: "deploy nebraltd/helium-light-testnet${{ env.ROCKPI }} --logs --debug --nocache --build --draft" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about consolidating all of these into a single There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need more than one testnet for light? Probably overkill just for testing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also it should be helium-light-test fleet that already exists Take a look at the light-hotspot-software repo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That could be possible. Let me think about our reasons to keep it separate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was my idea. We'll need to have separate fleets for every device type. I thought it has to mimic the same environment for testing. Also this is a one time setup. Otherwise, we'll be chasing different things for each device on testnet. That could need more effort than this one. At least this was my humble opinion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
OK. I can use helium-light-test. But AFAIK we had abondoned light-sotspot-software and using light-hotspot branch of helium-miner-software? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes we are, but essentially we are migrating from that older repo to this one to make it easier for us to merge this to master branch when it goes live. So it needs to be done in a way which can easily be merged with master further down the line. Also, we aren't going to move devices to new fleets for light. We will just update the existing fleets with the newer software, when the time comes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. |
||
- name: Balena Deploy (Nebra RasPi) | ||
uses: nebraltd/[email protected] | ||
if: matrix.sbc == 'raspi' && success() | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN_1}} | ||
balena_command: "deploy nebraltd/helium-testnet --logs --debug --nocache --build --draft" | ||
balena_command: "deploy nebraltd/helium-light-testnet --logs --debug --nocache --build --draft" | ||
- name: Balena Deploy (RAK and other non-Nebra RasPi) | ||
uses: nebraltd/[email protected] | ||
if: success() && (matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino' || matrix.sbc == 'pisces') | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN_2}} | ||
balena_command: "deploy nebraltd/helium-testnet-${{ matrix.sbc }} --logs --debug --nocache --build --draft" | ||
balena_command: "deploy nebraltd/helium-light-testnet-${{ matrix.sbc }} --logs --debug --nocache --build --draft" | ||
- name: Push updated docker compose file (ROCK Pi) | ||
if: matrix.sbc == 'rockpi' && success() | ||
uses: test-room-7/action-update-file@v1 | ||
|
@@ -68,13 +68,13 @@ jobs: | |
with: | ||
branch: master | ||
file-path: device-compose-files/docker-compose-rpi.yml | ||
commit-msg: Update Raspberry Pi docker compose output | ||
commit-msg: Update Raspberry Pi docker compose output | ||
github-token: ${{ secrets.MR_BUMP }} | ||
- name: Push updated docker compose file (Pisces) | ||
if: matrix.sbc == 'pisces' && success() | ||
uses: test-room-7/action-update-file@v1 | ||
with: | ||
branch: master | ||
file-path: device-compose-files/docker-compose-pisces.yml | ||
commit-msg: Update Pisces P100 docker compose output | ||
commit-msg: Update Pisces P100 docker compose output | ||
github-token: ${{ secrets.MR_BUMP }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
# Only run workflow for pushes to specific branches | ||
branches: | ||
- master | ||
- light-hotspot | ||
paths-ignore: | ||
- 'device-compose-files/**' | ||
|
||
|
@@ -46,40 +46,40 @@ jobs: | |
if: matrix.sbc == 'rockpi' && success() | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN}} | ||
balena_command: "deploy nebraltd/helium-testnet${{ env.ROCKPI }} --logs --debug --nocache --build" | ||
balena_command: "deploy nebraltd/helium-light-testnet${{ env.ROCKPI }} --logs --debug --nocache --build" | ||
- name: Balena Deploy (Nebra RasPi) | ||
uses: nebraltd/[email protected] | ||
if: matrix.sbc == 'raspi' && success() | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN_1}} | ||
balena_command: "deploy nebraltd/helium-testnet --logs --debug --nocache --build" | ||
balena_command: "deploy nebraltd/helium-light-testnet --logs --debug --nocache --build" | ||
- name: Balena Deploy (RAK and other non-Nebra RasPi) | ||
uses: nebraltd/[email protected] | ||
if: success() && (matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino' || matrix.sbc == 'pisces') | ||
with: | ||
balena_api_token: ${{secrets.BALENA_API_TOKEN_2}} | ||
balena_command: "deploy nebraltd/helium-testnet-${{ matrix.sbc }} --logs --debug --nocache --build" | ||
balena_command: "deploy nebraltd/helium-light-testnet-${{ matrix.sbc }} --logs --debug --nocache --build" | ||
- name: Push updated docker compose file (ROCK Pi) | ||
if: matrix.sbc == 'rockpi' && success() | ||
uses: test-room-7/action-update-file@v1 | ||
with: | ||
branch: master | ||
branch: light-hotspot | ||
file-path: device-compose-files/docker-compose-rockpi.yml | ||
commit-msg: Update ROCK Pi docker compose output | ||
github-token: ${{ secrets.MR_BUMP }} | ||
- name: Push updated docker compose file (Nebra RasPi, RAK and other RasPi based vendors) | ||
if: (matrix.sbc == 'raspi' || matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino') && success() | ||
uses: test-room-7/action-update-file@v1 | ||
with: | ||
branch: master | ||
branch: light-hotspot | ||
file-path: device-compose-files/docker-compose-rpi.yml | ||
commit-msg: Update Raspberry Pi docker compose output | ||
commit-msg: Update Raspberry Pi docker compose output | ||
github-token: ${{ secrets.MR_BUMP }} | ||
- name: Push updated docker compose file (Pisces) | ||
if: matrix.sbc == 'pisces' && success() | ||
uses: test-room-7/action-update-file@v1 | ||
with: | ||
branch: master | ||
branch: light-hotspot | ||
file-path: device-compose-files/docker-compose-pisces.yml | ||
commit-msg: Update Pisces P100 docker compose output | ||
commit-msg: Update Pisces P100 docker compose output | ||
github-token: ${{ secrets.MR_BUMP }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Update Gateway-rs (Testnet) | ||
on: | ||
repository_dispatch: | ||
types: [gatewayrs-update] | ||
jobs: | ||
gatewayrs-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
- run: | | ||
LATEST_GATEWAYRS=${{ github.event.client_payload.tag }} | ||
LONG_SHA=${{ github.event.client_payload.sha }} | ||
SHORT_SHA=$( echo ${LONG_SHA:0:7} ) | ||
echo "LATEST_GATEWAYRS=$LATEST_GATEWAYRS" >> $GITHUB_ENV | ||
echo "LONG_SHA=$LONG_SHA" >> $GITHUB_ENV | ||
|
||
echo "We're not on the latest Helium Gateway-rs release. Updating to $LATEST_GATEWAYRS with SHA $SHORT_SHA." | ||
sed -i -E "s/FIRMWARE_VERSION=.*/FIRMWARE_VERSION=$LATEST_GATEWAYRS/g" settings.ini | ||
sed -i -E "s/GATEWAYRS_VERSION=.*/GATEWAYRS_VERSION=$SHORT_SHA/g" settings.ini | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
commit-message: Update gateway-rs to latest public gateway-rs release ${{ env.LATEST_GATEWAYRS }} | ||
branch: gatewayrs-bump/${{ env.LATEST_GATEWAYRS }} | ||
delete-branch: true | ||
base: master | ||
title: "release(testnet): Update gateway-rs to latest public gateway-rs release ${{ env.LATEST_GATEWAYRS }}" | ||
body: | | ||
Update gateway-rs to latest public gateway-rs release ${{ env.LATEST_GATEWAYRS }} | ||
|
||
Ref NebraLtd/hm-gatewayrs@${{ env.LONG_SHA }} | ||
draft: false |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,40 +5,35 @@ services: | |
gateway-config: | ||
image: nebraltd/hm-config:{{CONFIG_VERSION}} | ||
depends_on: | ||
- helium-miner | ||
- gateway-rs | ||
- diagnostics | ||
- dbus-session | ||
environment: | ||
- FIRMWARE_VERSION={{FIRMWARE_VERSION}} | ||
- FIRMWARE_SHORT_HASH={{ENV.FIRMWARE_SHORT_HASH}} | ||
- DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket | ||
- DBUS_SESSION_BUS_ADDRESS=unix:path=/session/dbus/session_bus_socket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. System bus is still required I believe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. This was a thing I'd like to discuss while the PR is open. |
||
privileged: true | ||
network_mode: host | ||
cap_add: | ||
- NET_ADMIN | ||
volumes: | ||
- miner-storage:/var/data | ||
- dbus:/session/dbus | ||
labels: | ||
io.balena.features.sysfs: 1 | ||
io.balena.features.kernel-modules: 1 | ||
io.balena.features.dbus: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. System bus still needed I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
stop_signal: SIGINT | ||
|
||
packet-forwarder: | ||
image: nebraltd/hm-pktfwd:{{PKTFWD_VERSION}} | ||
depends_on: | ||
- helium-miner | ||
- gateway-rs | ||
restart: always | ||
privileged: true | ||
volumes: | ||
- pktfwdr:/var/pktfwd | ||
environment: | ||
- FIRMWARE_VERSION={{FIRMWARE_VERSION}} | ||
|
||
helium-miner: | ||
image: nebraltd/hm-gatewayrs:{{GATEWAY_VERSION}} | ||
gateway-rs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment about why this can't be changed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It shouldn't be a problem, but I'm not sure. I've removed the dependency, but will make sure packet-forwarder doesn't fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will have to keep helium-miner. it will need changes at too many places. Not important right now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it would need changing in packet forwarder and in hm-pyhelper and not worth the effort. Also having it called helium-miner is still technically correct |
||
image: nebraltd/hm-gatewayrs:{{GATEWAYRS_VERSION}} | ||
expose: | ||
- "1680" | ||
- "4467" | ||
|
@@ -48,20 +43,17 @@ services: | |
- {{I2C_DEVICE}}:{{I2C_DEVICE}} | ||
restart: on-failure | ||
environment: | ||
- DBUS_SYSTEM_BUS_ADDRESS=unix:path=/session/dbus/session_bus_socket | ||
- FIRMWARE_VERSION={{FIRMWARE_VERSION}} | ||
- I2C_DEVICE={{I2C_DEVICE}} | ||
|
||
diagnostics: | ||
image: nebraltd/hm-diag:{{DIAGNOSTICS_VERSION}} | ||
depends_on: | ||
- helium-miner | ||
- dbus-session | ||
- gateway-rs | ||
environment: | ||
- FIRMWARE_VERSION={{FIRMWARE_VERSION}} | ||
- FIRMWARE_SHORT_HASH={{ENV.FIRMWARE_SHORT_HASH}} | ||
- DIAGNOSTICS_VERSION={{DIAGNOSTICS_VERSION}} | ||
- DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still required There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure about that. @pritamghanghas What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. system bus is still needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need it for Bluetooth / LTE / WiFi |
||
volumes: | ||
- pktfwdr:/var/pktfwd | ||
- miner-storage:/var/data | ||
|
@@ -79,19 +71,7 @@ services: | |
labels: | ||
io.balena.features.sysfs: 1 | ||
io.balena.features.procfs: 1 | ||
io.balena.features.dbus: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
dbus-session: | ||
image: balenablocks/dbus:rpi-0.0.2 | ||
restart: always | ||
volumes: | ||
- dbus:/session/dbus | ||
environment: | ||
- DBUS_ADDRESS=unix:path=/session/dbus/session_bus_socket | ||
- FIRMWARE_VERSION={{FIRMWARE_VERSION}} | ||
- FIRMWARE_SHORT_HASH={{ENV.FIRMWARE_SHORT_HASH}} | ||
|
||
volumes: | ||
miner-storage: | ||
pktfwdr: | ||
dbus: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to touch the prod workflows? Won't those be unchanged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're removing indoor outdoor variants and all frequencies. So, not needed to keep all of matrix rows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we had decided that fleet reorganization will be separate ticket. if that matter has been settled, then its good.