-
Notifications
You must be signed in to change notification settings - Fork 48
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
Ubuntu Core GG snap? #1689
Comments
Hi, we currently do not officially support snaps for Greengrass v2. Although it may be possible for us to consider it in the future, we don't currently have plans for it. |
So, that implies you also do not support Ubuntu Core (24, 22, etc). That would be how I would interpret this. Right? |
Thank you for your interest in Greengrass snap support. We will take this feedback and prioritize it internally - it's already in our backlog. If you are working with a Technical Account Manager, please make sure to also surface this feature request with them. In the meantime, while we don't have an officially supported snap, we have had success getting Greengrass running on Ubuntu Core. Here's an example snapcraft.yaml that you can use as a reference. Note that version and source should be updated in the example. snapcraft.yaml:
configure hook:
install hook:
We have this exec_loader.sh script referenced in the snapcraft.yaml:
Please let me know if you have any other questions! |
I am. His name is Randhir, Priyanka [email protected] Thank you I will give this a whirl. Since AWS-CLI also is not supported -- are there any instructions here for setup after installation? I would imagine this snap for v2 also covers aws-cil? |
For aws-cli, you may need to reach out on their repository for help setting up. I don't believe we have an example for a GGv2 snap that includes the aws-cli. |
I actually already did. But, isnt aws-cli dependency to GGv2 snap? The only reason I asked was because I assumed it was. |
Greengrass doesn't have a dependency on aws-cli, though you might find it useful to have for development like creating deployments usually that is done from your development device and not your Greengrass device. Are you thinking of the Greengrass CLI component? The Greengrass CLI component is also not required but can be helpful during development as well, but this would be a component that you can deploy once you have Greengrass up and running. |
No. I guess I've been installing aws-cli unnecessarily along with gg. I get it now. |
@patrzhan So I was able to successfully build your snap. I have my own aws-iot-greengrass-v2_2.14.1_arm64.snap. I needed to revise also the local-scripts location and the arch for aarch64 to get the right jdk (i'm using ubuntu desktop 24 arm64 on a pi). However, I have several custom greengrass components. One in particular interacts with the serial port (/dev/ttyS0) relying also on using GPIO operations. I also need to enable I2C and disable serial console and enable serial hardware(I do this all normally with raspi-config). How would you recommend I configure all of this in the snap (interfaces?) so my custom component works properly? |
You could use also Yocto to build an image that has that settings to I2C etc. settings and Greengrass included. Just add another solution to the problem - here is an example image for Greengrass for Raspberry Pi: https://github.com/aws4embeddedlinux/meta-aws-demos/blob/master/meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/README.md |
@thomas-roos This is interesting and thank you for sending. But, it seems to abandon Ubuntu Core and all its (run time, deployment, maintenance) goodness. I think. |
You can use the free yocto goodness instead 😉 |
@patrzhan I've added a few interfaces: willthio@localhost:/$ snap connections aws-iot-greengrass-v2 How exactly do I run this and configure (e.g. my aws credentials) etc? |
willthio@localhost:/var/snap/aws-iot-greengrass-v2/current/greengrass/v2$ sudo snap get aws-iot-greengrass-v2 So, I'm taking guesses :) I found the v1 had some sort of tar that contained certs and config.....I'm trying to guess what these are. Looking for some help in how to configure this! |
I'm not personally familiar with the snap, but some notes we have mention to use manual installation with these instructions: Greengrass manual provisioningIn order to run Greengrass you would need to follow the manual instruction guide here: https://docs.aws.amazon.com/greengrass/v2/developerguide/manual-installation.html
Note: You will skip Continue following the manual provisioning guide
Once you have this config.yaml created on your device, copy the file to the user's home directory.
|
I will give this a shot! |
One quick question as I ponder this before I do it. When installing GG the "normal outside snap" way the core device is automatically created w/in AWS IoT along with adding then the core device to a group. For instance, that is what the following will do when you install gg outside of snap: sudo -E java -Droot="/greengrass/v2" -Dlog.store=FILE This is what I need to do -- but it seems what you are showing is more 'hard-coded' for the thing-core-name (etc)? |
Yeah, in manual provisioning you'll create those resources yourself and then configure GG via the config file you're adding. You'd be able to set it as whichever thing name you create as long as you have the correct certificates downloaded. |
Yeah, I see. It works but just a lot more work. I'll be testing this today. Thank you. |
Ok. First issue. The instructions you gave me was for a thing but not a core device. When you create a core device on the AWS IoT console it creates the config.yaml and you can download all the certs but the core device is not visible/active until you run the following command per the AWS IoT console: sed -i 's|{{config_dir}}|/greengrass/v2|g; s|{{nucleus_component}}|aws.greengrass.Nucleus|g' /greengrass/v2/config.yaml && sudo -E java -Droot="/greengrass/v2" -Dlog.store=FILE -jar ./GreengrassInstaller/lib/Greengrass.jar --init-config /greengrass/v2/config.yaml --component-default-user ggc_user:ggc_group --setup-system-service true I never had to do this -- I mean the core device was just created for me. Do I need to setup greengrass the old way first -- create and install the core device and THEN setup the config.yaml so the snap runs using the core device? |
A Greengrass core device is a thing. Creating a thing is all you need to do. Then just launch Greengrass. The core device will be created automatically when Greengrass successfully connects to AWS IoT |
I know its a thing also of course. I'll try this with the Snap. @MikeDombo |
Here is what I get now -- I don't get far enough to see the core device creation due to the following error. Any idea? 2025-02-18T17:48:36.582Z [WARN] (main) oshi.software.os.linux.LinuxOperatingSystem: Did not find udev library in operating system. Some features may not work.. {} 2025-02-18T17:48:36.590Z [ERROR] (main) com.aws.greengrass.easysetup.GreengrassSetup: Error while trying to setup Greengrass Nucleus. {} |
Here is the log in its entirety 2025-02-18T20:59:32.594Z [WARN] (main) oshi.software.os.linux.LinuxOperatingSystem: Did not find udev library in operating system. Some features may not work.. {} 2025-02-18T20:59:32.601Z [ERROR] (main) com.aws.greengrass.easysetup.GreengrassSetup: Error while trying to setup Greengrass Nucleus. {} 2025-02-18T20:59:32.607Z [WARN] (Thread-1) com.aws.greengrass.lifecyclemanager.Kernel: Shutting down Nucleus due to external signal. {} 2025-02-18T20:59:33.414Z [ERROR] (main) com.aws.greengrass.easysetup.GreengrassSetup: Error while trying to setup Greengrass Nucleus. {} 2025-02-18T20:59:33.417Z [WARN] (Thread-1) com.aws.greengrass.lifecyclemanager.Kernel: Shutting down Nucleus due to external signal. {} 2025-02-18T20:59:34.405Z [ERROR] (main) com.aws.greengrass.easysetup.GreengrassSetup: Error while trying to setup Greengrass Nucleus. {} 2025-02-18T20:59:34.408Z [WARN] (Thread-1) com.aws.greengrass.lifecyclemanager.Kernel: Shutting down Nucleus due to external signal. {} 2025-02-18T20:59:35.159Z [ERROR] (Serialized listener processor) com.aws.greengrass.dependency.Context: run-on-publish-queue-error. {} 2025-02-18T20:59:35.162Z [WARN] (Thread-1) com.aws.greengrass.lifecyclemanager.Kernel: Shutting down Nucleus due to external signal. {} 2025-02-18T20:59:36.164Z [ERROR] (main) com.aws.greengrass.easysetup.GreengrassSetup: Error while trying to setup Greengrass Nucleus. {} 2025-02-18T20:59:36.167Z [WARN] (Thread-1) com.aws.greengrass.lifecyclemanager.Kernel: Shutting down Nucleus due to external signal. {} |
More from journalctl (apparmor denials?) Feb 18 20:59:34 localhost systemd[1]: Started snap.aws-iot-greengrass-v2.greengrass.service - Service for snap application aws-iot-greengrass-v2.greengrass. |
The issue related to permissions above was resolved by installing the snap using '--devmode'. However, I am now having issues with the loader: 2025-02-19T14:39:30.245Z [INFO] (main) com.aws.greengrass.util.platforms.Platform: Getting platform instance com.aws.greengrass.util.platforms.unix.linux.LinuxPlatform.. {} This appears to also be a permissions issue but one that is not resolved by '--devmode' |
Can you try installing on a fresh system? Doing this seemed to mitigate this loader script error in the past, but otherwise I wouldn't be sure for other workarounds yet. |
@patrzhan I re-built/burned a brand new Core22 on a CM4. Same error (and I assume the subsequent ones are just domino effect errors) root@ubuntu:/var/snap/aws-iot-greengrass-v2/x1/greengrass/v2/logs# cat greengrass.log 2025-02-21T14:00:19.217Z [WARN] (Serialized listener processor) com.aws.greengrass.lifecyclemanager.KernelAlternatives: Failed to setup initial launch directory. Expecting loader script at: /var/snap/aws-iot-greengrass-v2/x1/greengrass/v2/alts/current/distro/bin/loader. {} 2025-02-21T14:00:19.226Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: No ongoing deployment detected. Proceed as default. {} 2025-02-21T14:00:29.460Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=aws.greengrass.Nucleus} 2025-02-21T14:00:29.710Z [ERROR] (main) com.aws.greengrass.dependency.Context: class-inject-error. {class=mqttClient} 2025-02-21T14:00:29.712Z [ERROR] (main) com.aws.greengrass.dependency.Context: class-post-inject-error. {class=class com.aws.greengrass.deployment.IotJobsHelper} 2025-02-21T14:00:29.722Z [ERROR] (main) com.aws.greengrass.dependency.Context: class-inject-error. {class=mqttClient} 2025-02-21T14:00:29.736Z [ERROR] (main) com.aws.greengrass.dependency.Context: class-post-inject-error. {class=class com.aws.greengrass.deployment.ShadowDeploymentListener} 2025-02-21T14:00:29.739Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=FleetStatusService} 2025-02-21T14:00:29.743Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=TelemetryAgent} 2025-02-21T14:00:29.766Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/var/snap/aws-iot-greengrass-v2/current/greengrass/v2/config/effectiveConfig.yaml} 2025-02-21T14:00:29.789Z [INFO] (DeploymentService-lifecycle) com.aws.greengrass.deployment.DeploymentService: service-set-state. {serviceName=DeploymentService, currentState=NEW, newState=INSTALLED} |
@patrzhan The fix for this appeared to be to run sudo fsck -n -f. Then reboot the machine. Still not out of the woods now. Now I get this error: |
Above was related to bad paths in config. I have it running now. On to getting my custom greengrass components running. |
@patrzhan Right now your snapcraft.yaml uses Core20 and Java8. That seems old? |
Like I mentioned earlier, we don't currently have an officially supported snap, and the example I provided is one from a while ago, so it isn't particularly recent. |
@patrzhan Here is my revised fully WORKING snapcraft.yaml. Base 22, java17, builds my own Python which my custom components later use. Has plugs that relate to my business problem (e.g. serial ports, etc). But it works. (stand by for YAML.......it it not letting me put it here as code) |
Describe the bug
Searching for Ubuntu Core Snap for Greengrass v2?
To Reproduce
[Steps to reproduce the behavior. If possible, provide a minimal amount of code that causes the bug.]
(https://snapcraft.io/aws-iot-greengrass)
Only v1 available and it is retired?
Expected behavior
Install greengrass v2 for Ubuntu Core using Snap (Ubuntu Core only supports Snap)
Actual behavior
Not available
Environment
Additional context
Add any other context about the problem here.
E.g. what is the impact of the bug?
The text was updated successfully, but these errors were encountered: