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

Implement standardized build pipeline based on existing repos #27

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

pritamghanghas
Copy link
Contributor

@pritamghanghas pritamghanghas commented Mar 18, 2022

  • clean and fix start-gateway.sh
  • introduce gen-region.sh
  • make sure github actions run successfuly

Why

How

References
issue #25

@pritamghanghas pritamghanghas requested a review from a team as a code owner March 18, 2022 13:48
@pritamghanghas pritamghanghas changed the title Dockerfile and workflow testing and cleanup #25 Dockerfile and workflow testing and cleanup Mar 18, 2022
@pritamghanghas pritamghanghas force-pushed the cleanup_and_test branch 2 times, most recently from 3e02179 to 1cbae8f Compare March 18, 2022 14:09

# Move to working directory
WORKDIR /opt/nebra-gatewayrs

ARG SYSTEM_TIMEZONE
ARG GATEWAY_RS_RELEASE
ARG SYSTEM_TIMEZONE=Europe/London
Copy link
Contributor Author

@pritamghanghas pritamghanghas Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other docker files don't set timezone. I think we can remove this to be consistent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you get a warning if this isn't done. We should prob keep this and make that the standard.

# NOTE:: not sure we even need to do this. We should set the right environment or
# get it from hm-pyhelper and it should be correct. We are doing this only to make
# sure that the gateway runs even when the I2C device is not present.
mapfile -t data < <( i2cdetect -y "${I2C_NUM}" )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a separate ticket for making it pull variant information from hm-pyhelper. Region will probably still remain a env variable override. #24

Copy link
Contributor

@marvinmarnold marvinmarnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, small comments. Could you also fill in the PR description according to the template. Link to the corresponding issue, and double check all AC.

@@ -0,0 +1,3 @@
enabled: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vpetersson we aren't using this anymore. Can we remove?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never got that one to fully work, so we can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

repo: helium/gateway-rs
# keep bumping the excludes, right now we only have alpha to track.
# later we will start tracking beta and finally release
excludes: prerelease, draft
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does helium/gateway-rs have any prerelease and draft releases now? I don't see them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no right now they seem to have alpha only. I kept it as a reminder so that we can add alpha and beta to it when they start releasing those. Seemed like good to have.

.github/workflows/check-latest-release.yml Show resolved Hide resolved
@pritamghanghas pritamghanghas force-pushed the cleanup_and_test branch 2 times, most recently from ee3c647 to 409c974 Compare March 21, 2022 08:38
if: env.UPDATED == 'true'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.MR_BUMP }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't find right information about secrets. hm-miner was using secrets.MINER_UPDATE. is MR_BUMP right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawaj any difference in how to use those secrets?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No difference, just that originally I called it miner update then changed to Mr bump in newer repos

echo "Using ECC for public key."
export GW_KEYPAIR="ecc://i2c-${I2C_NUM}:96&slot=0"
else
echo "gateway-rs deb package provided key /etc/helium_gateway/gateway_key.bin will be used."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this key randomly generated every build? If not, I think we should fail and exit here. Don't want to accidentally try to register a device with publicly available keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is default location where gateway-rs will generate a random key at startup. This is mostly a devtool so that gateway doesn't fail in absence of ecc. I don't think we are supposed to hit this part in production environment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we need to have it use the ECC at all times for production. Maybe have an env variable that can override this for dev?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added an environment variable.

* clean and fix start-gateway.sh
* introduce gen-region.sh
* make sure github actions run successfuly
@pritamghanghas pritamghanghas merged commit d3b1c78 into main Mar 23, 2022
@pritamghanghas pritamghanghas changed the title Dockerfile and workflow testing and cleanup Implement standardized build pipeline based on existing repos Mar 23, 2022
@shawaj shawaj deleted the cleanup_and_test branch March 31, 2022 20:36
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.

4 participants