Skip to content

Commit

Permalink
balancerd: initial working balancer process
Browse files Browse the repository at this point in the history
This is not yet ready for production. The code here should be enough to
allow cloud to start testing.

Working:

- pgwire with no tls
- pgwire with tls
- static resolver (no frontegg) for local dev
- frontegg resolver

Not implemented:

- https
- metrics
- memory constraints

See #21843
  • Loading branch information
maddyblue committed Oct 5, 2023
1 parent a4b9a52 commit 4fd79aa
Show file tree
Hide file tree
Showing 16 changed files with 1,250 additions and 30 deletions.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"src/avro-derive",
"src/aws-s3-util",
"src/aws-secrets-controller",
"src/balancerd",
"src/build-id",
"src/build-info",
"src/ccsr",
Expand Down
17 changes: 17 additions & 0 deletions misc/images/balancerd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

MZFROM ubuntu-base

RUN apt-get update \
&& apt-get -qy install ca-certificates

COPY mz-balancerd /usr/local/bin/balancerd

ENTRYPOINT ["balancerd"]
15 changes: 15 additions & 0 deletions misc/images/balancerd/mzbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

name: balancerd
description: Ingress balancer.
pre-image:
- type: cargo-build
bin: [mz-balancerd]
strip: false
38 changes: 38 additions & 0 deletions src/balancerd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "mz-balancerd"
description = "Balancer service."
version = "0.0.0"
edition.workspace = true
rust-version.workspace = true
publish = false

[dependencies]
anyhow = { version = "1.0.66", features = ["backtrace"] }
async-trait = "0.1.68"
bytes = "1.3.0"
bytesize = "1.1.0"
clap = { version = "3.2.24", features = ["derive", "env"] }
futures = "0.3.25"
jsonwebtoken = "8.2.0"
mz-build-info = { path = "../build-info" }
mz-frontegg-auth = { path = "../frontegg-auth" }
mz-orchestrator-tracing = { path = "../orchestrator-tracing" }
mz-ore = { path = "../ore", features = ["server"] }
mz-pgwire-common = { path = "../pgwire-common" }
num_cpus = "1.14.0"
openssl = { version = "0.10.48", features = ["vendored"] }
semver = "1.0.16"
tokio = { version = "1.24.2", default-features = false }
tokio-openssl = "0.6.3"
tokio-postgres = { version = "0.7.8" }
tokio-util = { version = "0.7.4", features = ["codec"] }
tracing = "0.1.37"
uuid = "1.2.2"
workspace-hack = { version = "0.0.0", path = "../workspace-hack" }

[features]
default = ["tokio-console"]
tokio-console = ["mz-ore/tokio-console"]

[package.metadata.cargo-udeps.ignore]
normal = ["workspace-hack"]
Loading

0 comments on commit 4fd79aa

Please sign in to comment.