-
Notifications
You must be signed in to change notification settings - Fork 45
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
(nucleus): component config file access #1567
Comments
Hi, Using environment variables is the correct way to do this. Trying to pass it over the command line instead will have a lot of issues with length and shell escaping. Having a unique feature to write config as a file does not seem necessary given the ability to use environment variables which you may then choose to save to a file. In greengrass, files are artifacts, so the other way to do this is to have any static content as artifacts and not component configuration. |
You may also use Greengrass IPC to read configuration. https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-component-configuration.html#ipc-operation-getconfiguration This would be my recommendation. Write a python (or language of your choice) component which pulls the config using IPC and then writes to a file and invokes the shop floor functionality. |
Well unfortunately using environment variables does not work for big configs :-( I make it work now with following setup. Lifecycle:
Install:
RequiresPrivilege: true # to access /greengrass/v2/bin/greengrass-cli
Script: |
apt install jq -y
COMPONENT_NAME="$(basename $PWD)"
/greengrass/v2/bin/greengrass-cli component details --name "${COMPONENT_NAME}" \
| grep "^ *Configuration: *" | sed 's/ *Configuration: *//' \
| jq -r '."sfc-config"' > sfc-config.json
Run:
Setenv:
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-armhf
RequiresPrivilege: true # /greengrass/v2/config/effectiveConfig.yaml (Permission denied)
Script: |
export SFC_DEPLOYMENT_DIR='{artifacts:decompressedPath}/greengrass-sfc-playground/sfc-modules'
alias sfc-main='{artifacts:decompressedPath}/greengrass-sfc-playground/sfc-main/bin/sfc-main'
sfc-main -config sfc-config.json |
Feature Description
It would be awesome if there would be away to access the whole or even parts of a component config as a json file.
Use Case
Why do you need this feature?
I need to have a quite big config (> 1048576 characters as a pretty json) Related SFC issue
Proposed Solution
My current approach was to read the recent component config from
/greengrass/v2/config/effectiveConfig.yaml
(see example below), however it turns out that these component configs are not reflecting the most recent config of a component :-(Other
I'm using AWS shopfloor-connectivity as a Greengrass component. Therefore I'd like to configure SFC by a Greengrass config field. Related SFC issue
I'm facing two issues right now.
sfc-main -config sfc-config.json
Argument list too long at java.lang.ProcessBuilder.start
because of system limitgetconf ARG_MAX
The text was updated successfully, but these errors were encountered: