Skip to content

Commit

Permalink
[scaling] feat: builder service (#999)
Browse files Browse the repository at this point in the history
* feat: builder init

* feat: build route

* feat: builder service

* feat: binary and docker image

* refactor: clippy suggestions

* refactor: move test helpers to common crate

* refactor: trim deployer-alpha

* refactor: get name from nbuild

* refactor: .crate to .tar.gz

* refactor: Cmd to Entrypoint
  • Loading branch information
chesedo committed Sep 15, 2023
1 parent c7ac99b commit da4ba92
Show file tree
Hide file tree
Showing 18 changed files with 870 additions and 5 deletions.
77 changes: 77 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 @@ -3,6 +3,7 @@ resolver = "2"
members = [
"admin",
"auth",
"builder",
"cargo-shuttle",
"codegen",
"common",
Expand Down
34 changes: 34 additions & 0 deletions builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "shuttle-builder"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
async-trait = { workspace = true }
clap = { workspace = true }
flate2 = { workspace = true }
nbuild-core = "0.1.1"
tar = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["fs", "macros", "io-util", "process", "rt-multi-thread"] }
toml = { workspace = true }
tonic = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["default"] }
ulid = { workspace = true }

[dependencies.shuttle-common]
workspace = true
features = ["backend", "tonic"]

[dependencies.shuttle-proto]
workspace = true

[dev-dependencies]
hex = "0.4.3"
portpicker = { workspace = true }
pretty_assertions = { workspace = true }
shuttle-common-tests = { workspace = true }
15 changes: 15 additions & 0 deletions builder/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh

###############################################################################
# This file is used by our common Containerfile incase the container for this #
# service might need some extra preparation steps for its final image #
###############################################################################

# Install the nix package manager
curl -L https://nixos.org/nix/install > ./install.sh
chmod +x install.sh
./install.sh --daemon
rm install.sh

# Activate the nix command
echo "experimental-features = nix-command" >> /etc/nix/nix.conf
15 changes: 15 additions & 0 deletions builder/src/args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use std::net::SocketAddr;

use clap::Parser;
use tonic::transport::Uri;

#[derive(Parser, Debug)]
pub struct Args {
/// Address to bind to
#[arg(long, default_value = "127.0.0.1:8000")]
pub address: SocketAddr,

/// Address to reach the authentication service at
#[arg(long, default_value = "http://127.0.0.1:8008")]
pub auth_uri: Uri,
}
Loading

0 comments on commit da4ba92

Please sign in to comment.