influxdb/Cargo.toml

163 lines
3.8 KiB
TOML
Raw Normal View History

[workspace]
# In alphabetical order
members = [
"arrow_util",
feat(authz): authorization service client and write integration (#7216) * feat(authz): add authorization client. Add a new authz crate to provide the interface for making authorization checks from within IOx. This includes the default client that uses the influxdata.iox.authz.v1 gRPC protocol. This feature is not used by any IOx component yet. * feat: optional authorization on write path Support optionally enabling authorization checks on the /api/v2/write handler. If an authrorizer is configured then the handler will attempt to retrieve a token from the request's Authorization header. If no such token exists then a response with a 401 error code is returned. If the token is not valid, or does not have write permission for the requested namespace then a response with a 403 error is returned. * chore: add unit test for authz in write handler Add unit tests that test the correct functioning of the /api/v2/write handler when an Authorizer is configured. * chore(authz): use lazy connection Change the initialization of the authz client to use a lazy connection. This allows the client to be initialised synchronously. * chore: Run cargo hakari tasks * fix(authz): protolint complaints * fix: authz tests * fix: benches and lint * chore: Update clap_blocks/src/authz.rs Co-authored-by: Marko Mikulicic <mkm@influxdata.com> * chore: Update authz/src/lib.rs Co-authored-by: Marko Mikulicic <mkm@influxdata.com> * chore: Update clap_blocks/src/authz.rs Co-authored-by: Marko Mikulicic <mkm@influxdata.com> * chore: review suggestions * chore: review suggestions Apply a number of suggestions from review comments. The main behavioural change is that if the authz service is configured applictions will perform a probe request to ensure it can communicate before continuing startup. * chore: Update router/src/server/http.rs Co-authored-by: Dom <dom@itsallbroken.com> --------- Co-authored-by: CircleCI[bot] <circleci@influxdata.com> Co-authored-by: Marko Mikulicic <mkm@influxdata.com> Co-authored-by: Dom <dom@itsallbroken.com>
2023-03-17 15:20:14 +00:00
"authz",
"backoff",
"cache_system",
"clap_blocks",
"client_util",
"compactor_test_utils",
2023-05-09 00:41:33 +00:00
"compactor",
"compactor_scheduler",
2022-05-05 19:29:24 +00:00
"data_types",
"datafusion_util",
"dml",
"executor",
"flightsql",
"garbage_collector",
"generated_types",
"gossip",
"gossip_compaction",
"gossip_parquet_file",
"gossip_schema",
"grpc-binary-logger-proto",
"grpc-binary-logger-test-proto",
"grpc-binary-logger",
"import_export",
"influxdb_influxql_parser",
"influxdb_iox_client",
"influxdb_iox",
"influxdb_line_protocol",
"influxdb_storage_client",
"influxdb_tsm",
2021-11-19 19:02:08 +00:00
"influxdb2_client",
"influxrpc_parser",
"ingester_query_grpc",
"ingester_query_client",
"ingester_test_ctx",
2023-05-05 16:03:50 +00:00
"ingester",
2022-01-11 17:51:56 +00:00
"iox_catalog",
"iox_data_generator",
"iox_query_influxql",
"iox_query_influxrpc",
"iox_query",
"iox_tests",
"iox_time",
"ioxd_common",
"ioxd_compactor",
"ioxd_garbage_collector",
"ioxd_ingester",
"ioxd_querier",
"ioxd_router",
"ioxd_test",
"logfmt",
"metric_exporters",
"metric",
"mutable_batch_lp",
"mutable_batch_pb",
"mutable_batch_tests",
"mutable_batch",
"object_store_metrics",
"observability_deps",
"panic_logging",
2021-10-14 12:34:59 +00:00
"parquet_file",
"parquet_to_line_protocol",
"predicate",
"querier",
"query_functions",
2022-05-06 18:51:52 +00:00
"router",
"schema",
"service_common",
"service_grpc_catalog",
"service_grpc_flight",
"service_grpc_influxrpc",
"service_grpc_namespace",
"service_grpc_object_store",
"service_grpc_schema",
2023-05-18 15:29:49 +00:00
"service_grpc_table",
"service_grpc_testing",
2022-06-09 19:10:16 +00:00
"sharder",
"sqlx-hotswap-pool",
"test_helpers_end_to_end",
"test_helpers",
2023-06-29 08:43:57 +00:00
"tokio_metrics_bridge",
"trace_exporters",
"trace_http",
"trace",
"tracker",
"trogging",
"wal_inspect",
"wal",
"workspace-hack",
]
default-members = ["influxdb_iox"]
resolver = "2"
exclude = [
"*.md",
"*.txt",
".circleci/",
".editorconfig",
".git*",
".github/",
".kodiak.toml",
"Dockerfile*",
"LICENSE*",
"buf.yaml",
"docker/",
"docs/",
"massif.out.*",
"perf/",
"scripts/",
2021-11-25 17:14:40 +00:00
"test_bench/",
"test_fixtures/",
"tools/",
]
[workspace.package]
version = "0.1.0"
authors = ["IOx Project Developers"]
edition = "2021"
license = "MIT OR Apache-2.0"
[workspace.dependencies]
arrow = { version = "45.0.0" }
arrow-flight = { version = "45.0.0" }
datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "f3722c0af8418bcb19cf9dc5f7e458a3aa5f0f32", default-features = false }
datafusion-proto = { git = "https://github.com/apache/arrow-datafusion.git", rev = "f3722c0af8418bcb19cf9dc5f7e458a3aa5f0f32" }
hashbrown = { version = "0.14.0" }
object_store = { version = "0.6.0" }
parquet = { version = "45.0.0" }
tonic = { version = "0.9.2", features = ["tls", "tls-webpki-roots"] }
tonic-build = { version = "0.9.2" }
tonic-health = { version = "0.9.2" }
tonic-reflection = { version = "0.9.2" }
# This profile optimizes for runtime performance and small binary size at the expense of longer
# build times. It's most suitable for final release builds.
[profile.release]
codegen-units = 16
debug = true
chore: faster and smaller IOx binaries Use `codegen-units = 1`, thin-LTO and debug section compression to make our binary smaller (which is good for deploy and test times) and faster. # Summary The binary size of `influxdb_iox` after building with: ```console $ cargo build --release --no-default-features --features="aws,gcp,azure,jemalloc_replacing_malloc" ``` The profile was: ```toml [profile.release] debug = true ``` The commit was: ```text 89ece8b493c924d05ebfa75d6661be5462eaeefa ``` The size results are: | Method | Size | | ------------------------------------------ | ----- | | baseline | 833MB | | baseline + dbg compression | 222MB | | baseline + strip | 49MB | | codegen-units | 520MB | | codegen-units + strip | 40MB | | codegen-units + dbg compression | 143MB | | thin LTO | 715MB | | thin LTO + strip | 49MB | | thin LTO + dbg compression | 199MB | | codegen-units + thin LTO | 449MB | | codegen-units + thin LTO + strip | 40MB | | codegen-units + thin LTO + dbg compression | 130MB | For the methods that were successfully measured I couldn't really see any compile time differences on my laptop. # Methods ## Strip Remove debug symbols. We don't really want this, so this is just to get an idea of the size ```console $ strip baseline ``` ## Debug Sections compression Debug sections make a large amount of our binary size (a stripped executable is 49MB instead of 833MB). Since we like to have debug symbols we cannot just strip them. However these symbols are only used for: - backtrace generation (something went wrong, not BAU) - profiling - debugging So in normal operation and most test scenarios, we're just wasting memory. So we could compress them: ```console $ objcopy --compress-debug-sections baseline baseline-dbg_compressed ``` There is also elfutils: ```console $ eu-elfcompress test ``` Elfutils nearly ends up with the same size (220MB instead of 222MB that objcopy achieves), but takes more time and is probably not worth it. Note that compressed debug sections exist since many years. The Rust ecosystem supports reading them since over a year, see: - <https://github.com/gimli-rs/gimli/issues/195> - <https://github.com/rust-lang/backtrace-rs/issues/342> ## Codegen Units The rust compiler parallelizes codegen work. This split into units however means that optimizations are somewhat limited. This can be change by: ```toml [profile.release] ... codegen-units = 1 ``` As a nice side effect this should also make our code faster. ## Thin LTO Get LLVM to run "thin" Link Time Optimization: ```toml [profile.release] ... lto = "thin" ``` As a nice side effect this should also make our code faster. ## Fat LTO Get LLVM to run "fat" Link Time Optimization: ```toml [profile.release] ... lto = "fat" ``` There are no results for this because this took a massive amount of memory and CPU time and did not finish on my system.
2021-11-10 14:47:18 +00:00
lto = "thin"
2020-12-04 14:48:19 +00:00
[profile.bench]
debug = true
# This profile optimizes for short build times at the expense of larger binary size and slower
# runtime performance. It's most suitable for development iterations.
[profile.quick-release]
inherits = "release"
codegen-units = 16
lto = false
incremental = true
# Per insta docs: https://insta.rs/docs/quickstart/#optional-faster-runs
[profile.dev.package.insta]
opt-level = 3
[profile.dev.package.similar]
opt-level = 3