Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
21 changes: 9 additions & 12 deletions agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand All @@ -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} \
Expand Down
18 changes: 12 additions & 6 deletions hive-hq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"] }
Expand Down
17 changes: 9 additions & 8 deletions hive/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand Down