-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
config: fix compilation with FLB_HAVE_STATIC_CONF
#8912
Conversation
c8fed63
to
6ba95dc
Compare
579efd1
to
f0330f3
Compare
f0330f3
to
578a450
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to push any updates to the package builds?
I notice the CentOS 7 one PR check was updated but not the actual package build.
dockerfiles/Dockerfile.centos7
Outdated
@@ -16,13 +16,15 @@ RUN yum -y update && \ | |||
COPY . /src/ | |||
WORKDIR /src/build | |||
|
|||
ARG EXTRA_BUILD_ARGS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need rolling to all the package builds as well?
I would probably make a named variable for it rather than a generic one, e.g. FLB_STATIC_CONF
, to make it more obvious to control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need rolling to all the package builds as well?
I'd say not - this is a build flag that requires a local build from source/Git. It can't be enabled in a packaged build (assuming I'm understanding packaged build correctly). The config option makes fluentbit embed the configuration files into the binary rather than looking for them from disk - so it's not something that can be distributed.
The goal here was to have a test that ensure it still works (it's broken a few times in the past) - and the Centos7 build just seemed (arbitrarily) like an easy place to put it. Open to putting it somewhere else instead though :-) We've run into a few small compile bugs when -DFLB_STATIC_CONF
has been enabled, so this would prevent those compile bugs into the future :-)
I would probably make a named variable for it rather than a generic one, e.g. FLB_STATIC_CONF, to make it more obvious to control.
Great call :-) Thanks for the suggestion :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always add another container build to verify static builds directly and do this in parallel then as well.
This one was added to primarily verify the legacy target compilation worked so hijacking it for something else does not seem right or obvious.
I would add a new CI job just for this I think for one of the faster targets, you can just invoke the packaging build with FLB_ARGS set for it too I think to pass them in:
Line 16 in 8aee285
FLB_ARG=${FLB_ARG:-} |
We could also make a static compilation test for all of the packaging builds via a matrix too in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion!
I've probably not quite done what you're suggesting yet (I haven't quite grokked call-build-linux-packages.yaml
yet) but did reuse build.sh :-) For now I've left it in pr-compile-check.yaml
(although it does lightly feel like a rationally named workflow file? 🤔 )
2b1a6e1
to
b87670a
Compare
b87670a
to
044dcce
Compare
run: ./build.sh | ||
env: | ||
FLB_DISTRO: ubuntu/20.04 | ||
FLB_ARG: --build-arg=FLB_STATIC_CONF=yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work unfortunately if FLB_STATIC_CONF is defined in the packaging dockerfiles as an argument though so we need to add it there too. Personally I'd just extended ./packaging/build.sh
to support FLB_STATIC_CONF directly and add it to the dockerfiles too, that way everyone can use it directly as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've started looking into this, thanks Pat :-)
One curiousity is that FLB_STATIC_CONF
needs the folder of config to point at, which isn't super practical via the packaging Dockerfiles to my mind. Perhaps something like mounting that config in (e.g. using secrets) could be a thing? 🤔
044dcce
to
76d84ce
Compare
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Signed-off-by: Bryce Gibson <[email protected]>
This it to verify compilation. It's not trivial to use this flag otherwise because a user needs to put their config in the Docker images 🤔 Signed-off-by: Bryce Gibson <[email protected]>
76d84ce
to
94a9f68
Compare
The
FLB_STATIC_CONF
build config is broken in 3.0.6 (and has been for a while).FLB_CF_BUF_SIZE
was removed in f50a02e. My understanding is that it was renamed toFLB_DEFAULT_CF_BUF_SIZE
, so make that code reference it instead.A typo didn't update the
s
variable tostate
in eabc1a1.Attempting to add a test for this config option - not sure if this is how this should be implemented, but thought it might be of interest :-)
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.