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 MQTT trigger and tests #175

Merged
merged 8 commits into from
Aug 26, 2024

Conversation

kate-goldenring
Copy link
Collaborator

closes #111

This should be merged first and then ideally a release of the trigger cut: spinkube/spin-trigger-mqtt#29

Adds an MQTT test which contains a deployment for an MQTT broker and a spin app that is triggered by the the broker.

Signed-off-by: Kate Goldenring <[email protected]>
@kate-goldenring
Copy link
Collaborator Author

@Mossaka have you seen these build errors before?

@devigned
Copy link
Contributor

Looks like it's failing trying to find OpenSSL:

  -- The C compiler identification is GNU 9.2.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/local/bin/x86_64-linux-musl-gcc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- CMake version: 3.23.1
  -- CMake system name: Linux
  -- Timestamp is 2024-07-31T18:11:49Z
  -- Configuring incomplete, errors occurred!
  See also "/target/x86_64-unknown-linux-musl/release/build/paho-mqtt-sys-2d67149a03469667/out/build/CMakeFiles/CMakeOutput.log".

  --- stderr
  fatal: not a git repository (or any parent up to mount point /home/runner)
  Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
  CMake Error at /usr/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
    system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
    OPENSSL_INCLUDE_DIR)
  Call Stack (most recent call first):
    /usr/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    /usr/local/share/cmake-3.23/Modules/FindOpenSSL.cmake:578 (find_package_handle_standard_args)
    src/CMakeLists.txt:194 (find_package)


  thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

@kate-goldenring
Copy link
Collaborator Author

@devigned yeah it has to do with how the paho-mqtt lib pulls in openssl. I am adding in their workaroud now: https://github.com/eclipse/paho.mqtt.rust?tab=readme-ov-file#fully-static-builds-with-musl

@rajatjindal
Copy link
Member

rajatjindal commented Aug 21, 2024

we had similar issue in Spin when adding MQTT support, and static builds were fixed using this PR: https://github.com/fermyon/spin/pull/2307/files

could we please see if that fix helps in this case here. unfortunately the CI logs for that PR are gone, so can't really verify the exact error msg.

@kate-goldenring
Copy link
Collaborator Author

@rajatjindal thank you! that got me past the build errors.

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

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

Once CI is happy, LGTM.

Thank you!

@kate-goldenring
Copy link
Collaborator Author

After many iterations on the e2e test configuration we are all green 🎉
@devigned @Mossaka @jsturtevant this is ready for a final review

Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

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

lgtm!

@kate-goldenring kate-goldenring merged commit d6946c2 into spinkube:main Aug 26, 2024
8 checks passed
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.

Support for the MQTT trigger
4 participants