diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c71356a..f2b39cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,6 +68,11 @@ jobs: echo "Skipping merge commit: $msg" continue fi + # Skip specific legacy commit from history + if [[ "$msg" == "Initial plan" ]]; then + echo "Skipping legacy commit: $msg" + continue + fi if [[ ! "$msg" =~ $PATTERN ]]; then echo "Invalid commit message: $msg" echo "Expected format: type(scope)?: description" diff --git a/Cargo.toml b/Cargo.toml index 8bc9e71..bf0d7f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["agent", "hive", "hive-hq/api", "hive-hq/types", "diff", "storage"] [workspace.package] -version = "0.0.2" +version = "0.0.3" edition = "2021" [workspace.dependencies] @@ -45,10 +45,10 @@ kube = { version = "0.96.0", features = ["runtime", "derive", "client"] } k8s-openapi = { version = "0.23.0", features = ["latest"] } # HTTP clients -reqwest = { version = "0.12.12", features = ["json"] } +reqwest = { version = "0.12.12", default-features = false, features = ["json", "rustls-tls"] } hyper = { version = "1.0.1", features = ["full"] } hyper-util = { version = "0.1.1", features = ["full"] } -hyper-tls = "0.6.0" +hyper-rustls = "0.27.1" hyper-tungstenite = "0.13.0" # WebSocket diff --git a/agent/Dockerfile b/agent/Dockerfile index ae0c8c4..90b37af 100644 --- a/agent/Dockerfile +++ b/agent/Dockerfile @@ -5,22 +5,23 @@ # Supports linux/amd64 and linux/arm64 using rust-musl-cross base images # ============================================================================= -# Declare TARGETARCH at the top level -ARG TARGETARCH - # Use different base images based on target architecture FROM messense/rust-musl-cross:x86_64-musl AS builder-amd64 FROM messense/rust-musl-cross:aarch64-musl AS builder-arm64 -# Select the appropriate builder based on TARGETARCH -FROM builder-${TARGETARCH} AS builder +# Select the appropriate builder based on TARGETARCH (automatically set by BuildKit) +# TARGETARCH is a built-in arg that gets set to amd64 or arm64 +FROM builder-${TARGETARCH:-amd64} AS builder -# Redeclare ARG after FROM +# Declare ARG to make it available in RUN commands ARG TARGETARCH -# Install protobuf compiler and update CA certificates +# Install dependencies for building: protobuf and CA certificates RUN apt-get update && \ - apt-get install -y protobuf-compiler ca-certificates && \ + apt-get install -y \ + protobuf-compiler \ + ca-certificates \ + && \ update-ca-certificates && \ rm -rf /var/lib/apt/lists/* @@ -43,10 +44,6 @@ RUN mkdir -p agent/src && echo 'fn main() {}' > agent/src/main.rs && touch agent mkdir -p diff/src && touch diff/src/lib.rs && \ mkdir -p storage/src && touch storage/src/lib.rs -# Set Rust target as environment variable based on architecture -ENV RUST_TARGET=${TARGETARCH:+$(test "$TARGETARCH" = "arm64" && echo "aarch64-unknown-linux-musl" || echo "x86_64-unknown-linux-musl")} -RUN echo "Building for architecture: $TARGETARCH, target: $RUST_TARGET" - # Build dependencies with architecture-specific cache mounts RUN --mount=type=cache,target=/root/.cargo/registry,id=cargo-registry-${TARGETARCH} \ --mount=type=cache,target=/root/.cargo/git,id=cargo-git-${TARGETARCH} \ diff --git a/hive-hq/Dockerfile b/hive-hq/Dockerfile index 48202ae..92f1d08 100644 --- a/hive-hq/Dockerfile +++ b/hive-hq/Dockerfile @@ -17,19 +17,25 @@ COPY hive-hq/ui ./ RUN npm run build # Stage 2: Build Rust API binary using rust-musl-cross -# Declare TARGETARCH at the top level -ARG TARGETARCH - # Use different base images based on target architecture FROM messense/rust-musl-cross:x86_64-musl AS builder-amd64 FROM messense/rust-musl-cross:aarch64-musl AS builder-arm64 -# Select the appropriate builder based on TARGETARCH -FROM builder-${TARGETARCH} AS builder +# Select the appropriate builder based on TARGETARCH (automatically set by BuildKit) +# TARGETARCH is a built-in arg that gets set to amd64 or arm64 +FROM builder-${TARGETARCH:-amd64} AS builder -# Redeclare ARG after FROM +# Declare ARG to make it available in RUN commands ARG TARGETARCH +# Install dependencies for building +RUN apt-get update && \ + apt-get install -y \ + protobuf-compiler \ + ca-certificates \ + && \ + rm -rf /var/lib/apt/lists/* + WORKDIR /usr/src # Copy manifests first for dependency caching diff --git a/hive/Cargo.toml b/hive/Cargo.toml index 4eb2474..2861393 100644 --- a/hive/Cargo.toml +++ b/hive/Cargo.toml @@ -12,7 +12,7 @@ futures.workspace = true tempfile.workspace = true http.workspace = true hyper.workspace = true -hyper-tls.workspace = true +hyper-rustls.workspace = true hyper-tungstenite.workspace = true hyper-util.workspace = true prost.workspace = true @@ -49,7 +49,7 @@ hkdf.workspace = true getrandom.workspace = true [features] -default = ["tungstenite/native-tls"] +default = [] [dev-dependencies] sqlx = { workspace = true, features = ["runtime-tokio", "postgres"] } diff --git a/hive/Dockerfile b/hive/Dockerfile index 81b616c..b7aac3e 100644 --- a/hive/Dockerfile +++ b/hive/Dockerfile @@ -5,22 +5,23 @@ # Supports linux/amd64 and linux/arm64 using rust-musl-cross base images # ============================================================================= -# Declare TARGETARCH at the top level -ARG TARGETARCH - # Use different base images based on target architecture FROM messense/rust-musl-cross:x86_64-musl AS builder-amd64 FROM messense/rust-musl-cross:aarch64-musl AS builder-arm64 -# Select the appropriate builder based on TARGETARCH -FROM builder-${TARGETARCH} AS builder +# Select the appropriate builder based on TARGETARCH (automatically set by BuildKit) +# TARGETARCH is a built-in arg that gets set to amd64 or arm64 +FROM builder-${TARGETARCH:-amd64} AS builder -# Redeclare ARG after FROM +# Declare ARG to make it available in RUN commands ARG TARGETARCH -# Install protobuf compiler and update CA certificates +# Install dependencies for building: protobuf and CA certificates RUN apt-get update && \ - apt-get install -y protobuf-compiler ca-certificates && \ + apt-get install -y \ + protobuf-compiler \ + ca-certificates \ + && \ update-ca-certificates && \ rm -rf /var/lib/apt/lists/*