-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from alecmocatta/docker
Add Kubernetes as a backend
- Loading branch information
Showing
23 changed files
with
636 additions
and
213 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
/*/ | ||
!/constellation-internal/ | ||
!/examples/ | ||
!/src/ | ||
!/tests/ | ||
!/Cargo.toml | ||
!/build.rs |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
[package] | ||
name = "constellation-rs" | ||
version = "0.1.5" | ||
version = "0.1.6" | ||
license = "Apache-2.0" | ||
authors = ["Alec Mocatta <[email protected]>"] | ||
categories = ["development-tools","network-programming","concurrency","asynchronous","command-line-utilities"] | ||
|
@@ -12,14 +12,11 @@ Constellation is a framework for Rust (nightly) that aides in the writing, debug | |
""" | ||
repository = "https://github.com/alecmocatta/constellation" | ||
homepage = "https://github.com/alecmocatta/constellation" | ||
documentation = "https://docs.rs/constellation-rs/0.1.5" | ||
documentation = "https://docs.rs/constellation-rs/0.1.6" | ||
readme = "README.md" | ||
edition = "2018" | ||
autotests = true | ||
|
||
[lib] | ||
name = "constellation" | ||
|
||
[badges] | ||
azure-devops = { project = "alecmocatta/constellation", pipeline = "tests" } | ||
maintenance = { status = "actively-developed" } | ||
|
@@ -30,16 +27,18 @@ nightly = ["palaver/nightly", "relative/nightly"] | |
distribute_binaries = ["constellation-internal/distribute_binaries"] | ||
fringe = ["serde_pipe/fringe"] | ||
no_alloc = ["constellation-internal/no_alloc"] | ||
kubernetes = ["distribute_binaries", "kube", "openssl"] | ||
|
||
[dependencies] | ||
constellation-internal = { path = "constellation-internal", version = "=0.1.5" } | ||
constellation-internal = { path = "constellation-internal", version = "=0.1.6" } | ||
atty = "0.2" | ||
backtrace = "0.3" | ||
bincode = "1.0" | ||
crossbeam = "0.7" | ||
docopt = "1.0" | ||
either = "1.5" | ||
futures-preview = "0.3.0-alpha.18" | ||
kube = { version = "0.16", features = ["openapi"], optional = true } | ||
log = "0.4" | ||
notifier = { version = "0.1", features = ["tcp_typed"] } | ||
once_cell = "1.0" | ||
|
@@ -54,6 +53,9 @@ serde_pipe = "0.1" | |
tcp_typed = "0.1" | ||
toml = "0.5" | ||
|
||
# dependency of kube; ensure it's vendored to simplify cross-compilation | ||
openssl = { version = "0.10", features = ["vendored"], optional = true } | ||
|
||
[target.'cfg(unix)'.dependencies] | ||
nix = "0.15" | ||
|
||
|
@@ -73,6 +75,11 @@ systemstat = "0.1" | |
[patch.crates-io] | ||
systemstat = { git = "https://github.com/alecmocatta/systemstat" } | ||
|
||
### | ||
|
||
[lib] | ||
name = "constellation" | ||
|
||
# Hopefully we won't need to exhaustively list in future: | ||
# https://github.com/rust-lang/cargo/issues/5766 or https://github.com/rust-lang/rust/issues/50297 | ||
|
||
|
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,29 @@ | ||
FROM rustlang/rust:nightly as build | ||
WORKDIR /usr/src | ||
|
||
# Install musl-gcc | ||
RUN apt-get update && apt-get install -y --no-install-recommends musl-tools | ||
|
||
# Download the target for static linking. | ||
RUN rustup target add x86_64-unknown-linux-musl | ||
|
||
# Create a dummy project and build the app's dependencies. | ||
# If the Cargo.toml and Cargo.lock files have not changed, | ||
# we can use the docker build cache and skip this slow step. | ||
RUN USER=root cargo init && USER=root cargo new --lib constellation-internal | ||
COPY Cargo.toml ./ | ||
RUN sed -i '/^###$/q' Cargo.toml | ||
COPY constellation-internal/Cargo.toml ./constellation-internal/ | ||
RUN cargo generate-lockfile | ||
RUN cargo build --bins --features kubernetes --target x86_64-unknown-linux-musl --release | ||
|
||
# Copy the source and build the application. | ||
COPY . ./ | ||
RUN touch ./constellation-internal/src/lib.rs | ||
RUN cargo build --locked --frozen --offline --bin constellation --features kubernetes --target x86_64-unknown-linux-musl --release | ||
|
||
# Copy the statically-linked binary into a scratch container. | ||
FROM scratch | ||
COPY --from=build /usr/src/target/x86_64-unknown-linux-musl/release/constellation . | ||
USER 1000 | ||
ENTRYPOINT ["./constellation"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "constellation-internal" | ||
version = "0.1.5" | ||
version = "0.1.6" | ||
license = "Apache-2.0" | ||
authors = ["Alec Mocatta <[email protected]>"] | ||
categories = ["development-tools","network-programming","concurrency","asynchronous"] | ||
|
@@ -10,7 +10,7 @@ Common components for the `constellation` framework. | |
""" | ||
repository = "https://github.com/alecmocatta/constellation" | ||
homepage = "https://github.com/alecmocatta/constellation" | ||
documentation = "https://docs.rs/constellation-internal/0.1.5" | ||
documentation = "https://docs.rs/constellation-internal/0.1.6" | ||
edition = "2018" | ||
|
||
[features] | ||
|
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
Oops, something went wrong.