danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Fix ktls detection #377

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

Currently cachegrand relies on reading the /proc file to check if the ULP TLS is available for kTLS but inside a docker container (or a container in general) this is not possible as often the /proc filesystem is not exposed at all.

To avoid this issue this PR changes the mechanism to check out if kTLS is available and tries to setup and establish a connection on a random port (trying multiple times to find one free).

Now kTLS is correctly detected inside a docker container (or a container in general) correctly if kTLS is enabled in the host machine.

Although unrelated, the PR also changes how the docker image is built to uncomment ca_certificate_chain_path to load the ca certificate as well.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 83.33% and project coverage change: +0.06 :tada:

Comparison is base (82aeaa5) 78.38% compared to head (20299d3) 78.44%.

:exclamation: Current head 20299d3 differs from pull request most recent head 22c86a6. Consider uploading reports for the commit 22c86a6 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #377 +/- ## ========================================== + Coverage 78.38% 78.44% +0.06% ========================================== Files 184 184 Lines 12925 12946 +21 ========================================== + Hits 10131 10155 +24 + Misses 2794 2791 -3 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `78.44% <83.33%> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/danielealbano/cachegrand/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano) | Coverage Δ | | |---|---|---| | [src/storage/db/storage\_db\_snapshot.c](https://codecov.io/gh/danielealbano/cachegrand/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL3N0b3JhZ2UvZGIvc3RvcmFnZV9kYl9zbmFwc2hvdC5j) | `43.77% <33.33%> (ø)` | | | [src/network/network\_tls.c](https://codecov.io/gh/danielealbano/cachegrand/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL25ldHdvcmsvbmV0d29ya190bHMuYw==) | `72.46% <88.46%> (+1.09%)` | :arrow_up: | | [src/fiber/fiber\_scheduler.c](https://codecov.io/gh/danielealbano/cachegrand/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL2ZpYmVyL2ZpYmVyX3NjaGVkdWxlci5j) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://codecov.io/gh/danielealbano/cachegrand/pull/377/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.