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

Add additional gcloud miscellaneous tooling #491

Merged
merged 3 commits into from
Nov 9, 2022

Conversation

noursaidi
Copy link
Collaborator

@noursaidi noursaidi commented Oct 31, 2022

Included more of my scripts including

  • record permanent history of IoT Core configs
  • save copy of raw message into GCS
  • Save message log and telemetry into BQ
  • save hardware and software from state messages into BQ
  • log connection and disconnection events into BQ
  • basic pubsub mirror script

Also moved deploy scripts into their own directory

All have been tested/deployed in my projects, however here I have modified slightly to fix unnecesary cloud function logs and service account issues, but have not (at least at time of writing) tested the modified versions work. Also atm they also all use the app engine default credentials which might not have sufficient permissions in some projects, although creating a service account per cloud function is very quick to do.

Copy link
Collaborator

@johnrandolph johnrandolph left a comment

Choose a reason for hiding this comment

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

No comments on the .js

FUNCTION_NAME=gcloud_iot_config
ENTRY_POINT=storeConfig
TOPIC=config_updates
BUCKET=$PROJECT_ID-iot-configs
Copy link
Collaborator

Choose a reason for hiding this comment

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

${PROJECT_ID}-iot-configs here and anywhere else that a literal and a variable are adjacent?


**NOTE**
- Requires **Cloud Logging** on devices or registry be set to `INFO` or more.
- IoT Core has a default log entries limit of 2000 per second. If a regsitry has `DEBUG` level logging, this may very quickly be exceeding, and will result in missing connection or disconnection log events
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: registry

except futures.TimeoutError:
continue
except (futures.CancelledError, KeyboardInterrupt):
future.cancel()
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you want to fall through here?

#!/bin/bash

if (( $# < 4 )); then
echo $0 PROJECT_ID DATASET_ID LOCATION TRIGGER_TOPIC [--drop]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this script support --drop ? maybe remove it?

@noursaidi noursaidi merged commit 2930608 into faucetsdn:master Nov 9, 2022
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.

None yet

3 participants