canonical / layer-filebeat

Filebeat is a lightweight log shipper. This is the source for the filebeat charm in the Juju charm store.
Other
3 stars 27 forks source link

Enable TLS in filebeat #101

Closed VariableDeclared closed 1 year ago

VariableDeclared commented 1 year ago

Add TLS Support to the filebeat charm

Depends on PR for elastic beats layer

Thanks, Peter

VariableDeclared commented 1 year ago

hey @agileshaw any advice on the focal/jammy build issue?

agileshaw commented 1 year ago

Hi @VariableDeclared . Apologize for the late reply.

This is a known issue with Jinja and MarkupSafe2 in focal. A workaround can be found here: https://github.com/juju/charm-tools/pull/650

VariableDeclared commented 1 year ago

hey @agileshaw had a look, but that fix is not merged - I cannot see a workaround there, what's your suggestion?

Adding the arguement is not yet working:

2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 :: usage: charm-build [-h] [-l LOG_LEVEL] [-f] [-o OUTPUT_DIR] [-d BUILD_DIR]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [-C CACHE_DIR] [-s SERIES] [--hide-metrics]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [--interface-service INTERFACE_SERVICE] [-i LAYER_INDEX]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [--no-local-layers] [-n NAME] [--write-lock-file]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [--use-lock-file-branches] [--ignore-lock-file] [-r] [-R]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [-w WHEELHOUSE_OVERRIDES] [-W] [-v] [--debug] [-c]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [--charm-file] [--binary-wheels]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [--binary-wheels-from-source] [--use-python-from-snap]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [--description]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 ::                    [charm]
2022-12-06 17:13:53.433 :: 2022-12-06 17:13:52.940 :: charm-build: error: unrecognized arguments: --upgrade-buildvenv-core-deps
agileshaw commented 1 year ago

Since the issue only seems to appear on focal, I think we can use jammy as build base (so you don't need to change back the metadata.yaml). Please attach the log of a jammy-built charm and test its behavior with some simple bundle (e.g. https://git.launchpad.net/charm-graylog/tree/src/tests/functional/tests/bundles/base-graylog.yaml). If everything checks out, that's a +1 from my book.

I'm also adding @esunar as a reviewer.

lathiat commented 1 year ago

The fix here may work: https://discourse.charmhub.io/t/install-or-update-python-packages-before-packing-a-charm/5158 https://github.com/canonical/charmcraft/issues/551

parts:
  charm:
    charm-python-packages:
      # https://github.com/canonical/charmcraft/issues/551
      - setuptools
VariableDeclared commented 1 year ago

hey @lathiat it appears at some point this arg was removed:

➜  filebeat-charm git:(lma-improvements/graylog-tls) ✗ charmcraft version
Bad charmcraft.yaml content:
- extra field 'charm-python-packages' not permitted in 'parts.charm' configuration
Full execution log: '/home/pjds/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221209-145322.062198.log'
➜  filebeat-charm git:(lma-improvements/graylog-tls) ✗ vi charmcraft.yaml
➜  filebeat-charm git:(lma-improvements/graylog-tls) ✗ charmcraft version
2.1.0
VariableDeclared commented 1 year ago

Following up on my last comment - the issue is related to the charm plugin and reactive plugin. In this case we're using reactive which doesn't appear to support this arguement.