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

Added automation for light hotspots #414

Merged
merged 3 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 4 additions & 57 deletions .github/workflows/push-to-testnet-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
runs-on: ubuntu-latest
MuratUrsavas marked this conversation as resolved.
Show resolved Hide resolved
strategy:
fail-fast: false
matrix:
sbc: [raspi, rockpi, rak, finestra, sensecap, og, controllino, pisces]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -19,62 +17,11 @@ jobs:
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 360 ) + 1 ]s
- name: Generate Docker Compose for RockPi
if: matrix.sbc == 'rockpi'
- name: Generate Docker Compose
run: |
python gen_docker_compose.py rockpi -o device-compose-files/docker-compose-rockpi.yml
cp device-compose-files/docker-compose-rockpi.yml docker-compose.yml
ROCKPI="-rockpi"
echo "ROCKPI=$ROCKPI" >> $GITHUB_ENV
- name: Generate Docker Compose for RaspberryPi & RAK & Other RasPi based vendors
if: matrix.sbc == 'raspi' || matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino'
run: |
python gen_docker_compose.py rpi -o device-compose-files/docker-compose-rpi.yml
cp device-compose-files/docker-compose-rpi.yml docker-compose.yml
- name: Generate Docker Compose for Pisces
if: matrix.sbc == 'pisces'
run: |
python gen_docker_compose.py pisces -o device-compose-files/docker-compose-pisces.yml
cp device-compose-files/docker-compose-pisces.yml docker-compose.yml
- name: Balena Deploy (Nebra ROCK Pi)
python gen_docker_compose.py -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
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"
- 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"
- 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"
- name: Push updated docker compose file (ROCK Pi)
if: matrix.sbc == 'rockpi' && success()
uses: test-room-7/action-update-file@v1
with:
branch: master
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
file-path: device-compose-files/docker-compose-rpi.yml
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
github-token: ${{ secrets.MR_BUMP }}
balena_command: "deploy nebraltd/helium-light-test --logs --debug --nocache --build --draft"
65 changes: 5 additions & 60 deletions .github/workflows/push-to-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ on:
push:
# Only run workflow for pushes to specific branches
branches:
- master
paths-ignore:
- 'device-compose-files/**'
- light-hotspot

jobs:
testnet:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sbc: [raspi, rockpi, rak, finestra, sensecap, og, controllino, pisces]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -24,62 +20,11 @@ jobs:
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
- name: Random sleep (balena API workaround)
run: sleep $[ ( $RANDOM % 360 ) + 1 ]s
- name: Generate Docker Compose for RockPi
if: matrix.sbc == 'rockpi'
- name: Generate Docker Compose
run: |
python gen_docker_compose.py rockpi -o device-compose-files/docker-compose-rockpi.yml
cp device-compose-files/docker-compose-rockpi.yml docker-compose.yml
ROCKPI="-rockpi"
echo "ROCKPI=$ROCKPI" >> $GITHUB_ENV
- name: Generate Docker Compose for RaspberryPi & RAK & Other RasPi based vendors
if: matrix.sbc == 'raspi' || matrix.sbc == 'rak' || matrix.sbc == 'og' || matrix.sbc == 'sensecap' || matrix.sbc == 'finestra' || matrix.sbc == 'controllino'
run: |
python gen_docker_compose.py rpi -o device-compose-files/docker-compose-rpi.yml
cp device-compose-files/docker-compose-rpi.yml docker-compose.yml
- name: Generate Docker Compose for Pisces
if: matrix.sbc == 'pisces'
run: |
python gen_docker_compose.py pisces -o device-compose-files/docker-compose-pisces.yml
cp device-compose-files/docker-compose-pisces.yml docker-compose.yml
- name: Balena Deploy (Nebra ROCK Pi)
python gen_docker_compose.py -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
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"
- 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"
- 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"
- name: Push updated docker compose file (ROCK Pi)
if: matrix.sbc == 'rockpi' && success()
uses: test-room-7/action-update-file@v1
with:
branch: master
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
file-path: device-compose-files/docker-compose-rpi.yml
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
github-token: ${{ secrets.MR_BUMP }}
balena_command: "deploy nebraltd/helium-light-test --logs --debug --nocache --build"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
MuratUrsavas marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
with:
with:
ref: ${{ github.ref }}
- run: |
LATEST_GA=${{ github.event.client_payload.tag }}
Expand All @@ -18,11 +18,11 @@ jobs:

echo "We're not on the latest Helium gateway-rs release. Updating to $LATEST_GA with SHA $SHORT_SHA."
sed -i -E "s/FIRMWARE_VERSION=.*/FIRMWARE_VERSION=$LATEST_GA/g" settings.ini
sed -i -E "s/GATEWAY_VERSION=.*/GATEWAY_VERSION=$SHORT_SHA/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 Gatewayrs to latest GA ${{ env.LATEST_GA }}
commit-message: Update Gateway-rs to latest GA ${{ env.LATEST_GA }}
branch: gatewayrs-bump/${{ env.LATEST_GA }}
delete-branch: true
base: master
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,3 @@ dmypy.json
# Cython debug symbols
cython_debug/
.vscode/

device-compose-files/test_file.yml
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Repo: [github.com/NebraLtd/hm-gatewayrs](https://github.com/NebraLtd/hm-gatewayr

This container is the actual Helium Gateway-rs software (from upstream), with the required configuration files added.

Gatewayrs container requires two IP ports exposed as default.
MuratUrsavas marked this conversation as resolved.
Show resolved Hide resolved
- [1680](https://github.com/helium/gateway-rs/blob/d6e140fc8f102d2e1008ddf6d58cef32c4f60392/src/settings.rs#L18): For connecting to packet-forwarder.
- [4467](https://github.com/helium/gateway-rs/blob/d6e140fc8f102d2e1008ddf6d58cef32c4f60392/src/settings.rs#L22): For connecting to gRPC API over WAN.

Both of these ports can be changed via settings (toml) file.

# Quick Start

This is a guide to help you get started with the repository and get it running on your local device. This guide is focused on pushing the repository onto a Raspberry Pi using Balena.
Expand All @@ -54,7 +60,7 @@ You may notice that after cloning the repo that you are missing a docker-compose

*Note for generating the file for local tests: The repo's short Git SHA is fetched from GitHub pipeline automatically while working with standard procedure. But if you need to test your working copy locally, you need to create an environment variable first via running following command on Linux:*

```sh
```sh
$ export FIRMWARE_SHORT_HASH=$(git rev-parse --short HEAD)
```

Expand Down
105 changes: 0 additions & 105 deletions device-compose-files/docker-compose-pisces.yml

This file was deleted.

Loading