From 28031ae6c93ec8b9427a9c91b60acc88cad8b80a Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Mon, 22 Nov 2021 16:46:30 +0000 Subject: [PATCH 1/6] fix: revert privileged containers and add rockpi builds - revert privileged containers based on discussion in #253 - add rockpi builds to testnet and production actions using build matrix - with rockpi versions, change the i2c bus to i2c-7 in docker-compose - remove hard coded balena cli version and change to env variable --- .github/workflows/push-to-prod.yml | 83 ++++++--------------------- .github/workflows/push-to-testnet.yml | 16 +++++- docker-compose.yml | 6 +- 3 files changed, 36 insertions(+), 69 deletions(-) diff --git a/.github/workflows/push-to-prod.yml b/.github/workflows/push-to-prod.yml index 05b33eae..ebbfc24b 100644 --- a/.github/workflows/push-to-prod.yml +++ b/.github/workflows/push-to-prod.yml @@ -5,79 +5,32 @@ on: # Only run workflow for pushes to specific branches branches: - production +env: + balena-cli: v12.52.1 jobs: - outdoor-868: + build-prod: runs-on: ubuntu-latest + strategy: + matrix: + sbc: [raspi, rockpi] + frequency: [470, 868, 915] + variant: [indoor, outdoor] steps: - name: Checkout uses: actions/checkout@v2 + - name: Change i2c bus for RockPi + if: matrix.sbc == rockpi + run: | + sed -i -E "s/\/dev\/i2c-1:\/dev\/i2c-1/\/dev\/i2c-7:\/dev\/i2c-7/g" docker-compose.yml + ROCKPI="-rockpi" + echo "ROCKPI=$ROCKPI" >> $GITHUB_ENV - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 + uses: nebraltd/balena-cli-action@${{ env.balena-cli }} if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-outdoor-868 --logs --debug --nocache --build" - - indoor-868: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 - if: success() - with: - balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-indoor-868 --logs --debug --nocache --build" - - outdoor-915: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 - if: success() - with: - balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-outdoor-915 --logs --debug --nocache --build" - - indoor-915: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 - if: success() - with: - balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-indoor-915 --logs --debug --nocache --build" - - outdoor-470: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 - if: success() - with: - balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-outdoor-470 --logs --debug --nocache --build" - - indoor-470: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 - if: success() - with: - balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-indoor-470 --logs --debug --nocache --build" + balena_command: "deploy nebraltd/helium-${{ matrix.variant }}-${{ matrix.frequency }}${{ env.ROCKPI }} --logs --debug --nocache --build" open-fleet: runs-on: ubuntu-latest @@ -85,7 +38,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 + uses: nebraltd/balena-cli-action@${{ env.balena-cli }} if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} @@ -97,7 +50,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 + uses: nebraltd/balena-cli-action@${{ env.balena-cli }} if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} diff --git a/.github/workflows/push-to-testnet.yml b/.github/workflows/push-to-testnet.yml index 9fb81a41..be0888cb 100644 --- a/.github/workflows/push-to-testnet.yml +++ b/.github/workflows/push-to-testnet.yml @@ -6,15 +6,27 @@ on: branches: - master +env: + balena-cli: v12.52.1 + jobs: testnet: runs-on: ubuntu-latest + strategy: + matrix: + sbc: [raspi, rockpi] steps: - name: Checkout uses: actions/checkout@v2 + - name: Change i2c bus for RockPi + if: matrix.sbc == rockpi + run: | + sed -i -E "s/\/dev\/i2c-1:\/dev\/i2c-1/\/dev\/i2c-7:\/dev\/i2c-7/g" docker-compose.yml + ROCKPI="-rockpi" + echo "ROCKPI=$ROCKPI" >> $GITHUB_ENV - name: Balena Deploy - uses: nebraltd/balena-cli-action@v12.51.1 + uses: nebraltd/balena-cli-action@${{ env.balena-cli }} if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} - balena_command: "deploy nebraltd/helium-testnet --logs --debug --nocache --build" + balena_command: "deploy nebraltd/helium-testnet${{ env.ROCKPI }} --logs --debug --nocache --build" diff --git a/docker-compose.yml b/docker-compose.yml index 04c506c9..9af7d791 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,7 +50,8 @@ services: - dbus:/session/dbus cap_add: - SYS_RAWIO - privileged: true + devices: + - /dev/i2c-1:/dev/i2c-1 restart: on-failure environment: - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/session/dbus/session_bus_socket @@ -67,7 +68,8 @@ services: - "80:5000" cap_add: - SYS_RAWIO - privileged: true + devices: + - /dev/i2c-1:/dev/i2c-1 labels: io.balena.features.sysfs: 1 From 04818f1bf252c99870dd75a09ffdeb63e539143c Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Mon, 22 Nov 2021 18:34:08 +0000 Subject: [PATCH 2/6] feat: bump hm-diag for RockPi support bump hm-diag to pull in https://github.com/NebraLtd/hm-diag/pull/238 --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9af7d791..84613b03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - dbus-session - diagnostics environment: - - FIRMWARE_VERSION=2021.11.21.2 + - FIRMWARE_VERSION=2021.11.21.2-1 - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket - DBUS_SESSION_BUS_ADDRESS=unix:path=/session/dbus/session_bus_socket privileged: true @@ -58,9 +58,9 @@ services: - RELEASE_BUMPER=foobar diagnostics: - image: nebraltd/hm-diag:7e26f35 + image: nebraltd/hm-diag:b30bd8a environment: - - FIRMWARE_VERSION=2021.11.21.2 + - FIRMWARE_VERSION=2021.11.21.2-1 volumes: - pktfwdr:/var/pktfwd - miner-storage:/var/data @@ -87,7 +87,7 @@ services: - dbus:/session/dbus environment: - DBUS_ADDRESS=unix:path=/session/dbus/session_bus_socket - - FIRMWARE_VERSION=2021.11.21.2 + - FIRMWARE_VERSION=2021.11.21.2-1 volumes: miner-storage: From ab5693c51ef2dab0a9f5e934c87f1a4343627e22 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Mon, 22 Nov 2021 21:24:12 +0000 Subject: [PATCH 3/6] fix: bump pktfwd and correct if statements - bump pktfwd to bring in sx1302 fixes - correct if statements in previous commits --- .github/workflows/push-to-prod.yml | 2 +- .github/workflows/push-to-testnet.yml | 2 +- docker-compose.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-to-prod.yml b/.github/workflows/push-to-prod.yml index ebbfc24b..9127b49a 100644 --- a/.github/workflows/push-to-prod.yml +++ b/.github/workflows/push-to-prod.yml @@ -20,7 +20,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Change i2c bus for RockPi - if: matrix.sbc == rockpi + if: matrix.sbc == 'rockpi' run: | sed -i -E "s/\/dev\/i2c-1:\/dev\/i2c-1/\/dev\/i2c-7:\/dev\/i2c-7/g" docker-compose.yml ROCKPI="-rockpi" diff --git a/.github/workflows/push-to-testnet.yml b/.github/workflows/push-to-testnet.yml index be0888cb..f3a80e99 100644 --- a/.github/workflows/push-to-testnet.yml +++ b/.github/workflows/push-to-testnet.yml @@ -19,7 +19,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Change i2c bus for RockPi - if: matrix.sbc == rockpi + if: matrix.sbc == 'rockpi' run: | sed -i -E "s/\/dev\/i2c-1:\/dev\/i2c-1/\/dev\/i2c-7:\/dev\/i2c-7/g" docker-compose.yml ROCKPI="-rockpi" diff --git a/docker-compose.yml b/docker-compose.yml index 84613b03..84e31955 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: stop_signal: SIGINT packet-forwarder: - image: nebraltd/hm-pktfwd:e067bef + image: nebraltd/hm-pktfwd:8d8de7d depends_on: - helium-miner restart: always From 9f349708cc5210ab24fe52153644f10557857cc9 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Mon, 22 Nov 2021 23:27:11 +0000 Subject: [PATCH 4/6] add space --- .github/workflows/push-to-prod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-to-prod.yml b/.github/workflows/push-to-prod.yml index 9127b49a..322c39dd 100644 --- a/.github/workflows/push-to-prod.yml +++ b/.github/workflows/push-to-prod.yml @@ -5,6 +5,7 @@ on: # Only run workflow for pushes to specific branches branches: - production + env: balena-cli: v12.52.1 From 35bf8f3d1111a358eab541d77286db97a836c55d Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Sun, 28 Nov 2021 14:11:39 +0000 Subject: [PATCH 5/6] Update push-to-prod.yml --- .github/workflows/push-to-prod.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/push-to-prod.yml b/.github/workflows/push-to-prod.yml index 322c39dd..c9ff6168 100644 --- a/.github/workflows/push-to-prod.yml +++ b/.github/workflows/push-to-prod.yml @@ -6,9 +6,6 @@ on: branches: - production -env: - balena-cli: v12.52.1 - jobs: build-prod: runs-on: ubuntu-latest @@ -27,7 +24,7 @@ jobs: ROCKPI="-rockpi" echo "ROCKPI=$ROCKPI" >> $GITHUB_ENV - name: Balena Deploy - uses: nebraltd/balena-cli-action@${{ env.balena-cli }} + uses: nebraltd/balena-cli-action@v12.54.5 if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} @@ -39,7 +36,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Balena Deploy - uses: nebraltd/balena-cli-action@${{ env.balena-cli }} + uses: nebraltd/balena-cli-action@v12.54.5 if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} @@ -51,7 +48,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Balena Deploy - uses: nebraltd/balena-cli-action@${{ env.balena-cli }} + uses: nebraltd/balena-cli-action@v12.54.5 if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}} From abb86696635952629e0ac524edc09ca04d010f79 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Sun, 28 Nov 2021 14:12:11 +0000 Subject: [PATCH 6/6] Update push-to-testnet.yml --- .github/workflows/push-to-testnet.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/push-to-testnet.yml b/.github/workflows/push-to-testnet.yml index f3a80e99..d7ce1bb4 100644 --- a/.github/workflows/push-to-testnet.yml +++ b/.github/workflows/push-to-testnet.yml @@ -6,9 +6,6 @@ on: branches: - master -env: - balena-cli: v12.52.1 - jobs: testnet: runs-on: ubuntu-latest @@ -25,7 +22,7 @@ jobs: ROCKPI="-rockpi" echo "ROCKPI=$ROCKPI" >> $GITHUB_ENV - name: Balena Deploy - uses: nebraltd/balena-cli-action@${{ env.balena-cli }} + uses: nebraltd/balena-cli-action@v12.54.5 if: success() with: balena_api_token: ${{secrets.BALENA_API_TOKEN}}