-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Lakefront service stub (#3329)
- Loading branch information
Showing
13 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
# Cargo target directories. | ||
/*target | ||
|
||
# Submodules | ||
/submodules | ||
|
||
# Temp dir for slts | ||
/slt_tmp | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM rust AS builder | ||
|
||
WORKDIR /usr/src | ||
COPY . . | ||
|
||
RUN cargo build --release --bin lakefront | ||
|
||
FROM debian:bookworm-slim | ||
|
||
COPY --from=builder /usr/src/target/release/lakefront /usr/local/bin/lakefront | ||
|
||
CMD ["lakefront"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
FROM rust AS builder | ||
|
||
WORKDIR /usr/src/rayexec | ||
WORKDIR /usr/src | ||
COPY . . | ||
|
||
RUN ./scripts/install_protoc_linux.sh | ||
RUN cargo build --release --bin rayexec_server | ||
|
||
FROM debian:bookworm-slim | ||
|
||
COPY --from=builder /usr/src/rayexec/target/release/rayexec_server /usr/local/bin/rayexec_server | ||
COPY --from=builder /usr/src/target/release/rayexec_server /usr/local/bin/rayexec_server | ||
|
||
CMD ["rayexec_server"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "lakefront" | ||
version.workspace = true | ||
edition.workspace = true | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[[bin]] | ||
name = "lakefront" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
rayexec_error = { path = '../rayexec_error' } | ||
logutil = { path = '../logutil' } | ||
serde = { workspace = true } | ||
serde_json = "1.0" | ||
tracing = { workspace = true } | ||
tokio = { workspace = true, features = ["full"] } | ||
axum = "0.7.5" | ||
clap = { version = "4.5.9", features = ["derive"] } | ||
tower-http = { version = "0.5.2", default-features = false, features = ["cors", "trace"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! Lakefront lib. | ||
pub fn serve() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use clap::{Parser, ValueEnum}; | ||
use tracing::info; | ||
|
||
#[derive(Parser)] | ||
#[clap(name = "lakefront")] | ||
struct Arguments { | ||
/// Port to start the server on. | ||
#[clap(short, long, default_value_t = 8081)] | ||
port: u16, | ||
/// Log format. | ||
#[arg(value_enum, long, value_parser, default_value_t = LogFormat::Json)] | ||
log_format: LogFormat, | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, Default, ValueEnum)] | ||
enum LogFormat { | ||
#[default] | ||
Json, | ||
Pretty, | ||
} | ||
|
||
impl From<LogFormat> for logutil::LogFormat { | ||
fn from(value: LogFormat) -> Self { | ||
match value { | ||
LogFormat::Json => logutil::LogFormat::Json, | ||
LogFormat::Pretty => logutil::LogFormat::HumanReadable, | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
let args = Arguments::parse(); | ||
logutil::configure_global_logger(tracing::Level::DEBUG, args.log_format.into()); | ||
|
||
info!("lakefront main") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters