Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dump build artifacts into an output folder #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
data/
node_modules/
redis_data/
output/

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ __pycache__/
data
redis_data
keys.json
output/

37 changes: 21 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
GO_CMD_W_CGO = CGO_ENABLED=1 GOOS=linux go
GO_CMD = CGO_ENABLED=0 GOOS=linux go

# Shared preparation steps
.PHONY: prepare
prepare:
mkdir -p output

# Build the Graph Builder Go binary
.PHONY: build-graph-builder
build-graph-builder:
build-graph-builder: prepare
@echo "Building Graph Builder Go binary..."
$(GO_CMD_W_CGO) build -o graph-builder cmd/graph-builder/*.go
$(GO_CMD_W_CGO) build -o output/graph-builder cmd/graph-builder/*.go

# Start up the Graph Builder
.PHONY: graph-builder-up
Expand All @@ -18,9 +23,9 @@ graph-builder-up:

# Build the Search API Go binary
.PHONY: build-search
build-search:
build-search: prepare
@echo "Building Search Go binary..."
$(GO_CMD) build -o search cmd/search/*.go
$(GO_CMD) build -o output/search cmd/search/*.go

.PHONY: search-up
search-up:
Expand Down Expand Up @@ -70,9 +75,9 @@ object-detection-gpu-up:

# Build the Indexer Go binary
.PHONY: build-indexer
build-indexer:
build-indexer: prepare
@echo "Building Indexer Go binary..."
$(GO_CMD_W_CGO) build -o indexer cmd/indexer/*.go
$(GO_CMD_W_CGO) build -o output/indexer cmd/indexer/*.go

.PHONY: indexer-up
indexer-up:
Expand All @@ -81,9 +86,9 @@ indexer-up:

# Build the Feedgen Go binary
.PHONY: build-feedgen-go
build-feedgen-go:
build-feedgen-go: prepare
@echo "Building Feed Generator Go binary..."
$(GO_CMD_W_CGO) build -o feedgen cmd/feed-generator/*.go
$(GO_CMD_W_CGO) build -o output/feedgen cmd/feed-generator/*.go

.PHONY: feedgen-go-up
feedgen-go-up:
Expand All @@ -92,9 +97,9 @@ feedgen-go-up:

# Build the PLC Go binary
.PHONY: build-plc
build-plc:
build-plc: prepare
@echo "Building PLC binary..."
$(GO_CMD_W_CGO) build -o plc cmd/plc/*.go
$(GO_CMD_W_CGO) build -o output/plc cmd/plc/*.go

.PHONY: plc-up
plc-up:
Expand All @@ -115,9 +120,9 @@ redis-down:

# Build the Consumer
.PHONY: build-consumer
build-consumer:
build-consumer: prepare
@echo "Building Consumer Go binary..."
$(GO_CMD_W_CGO) build -o consumer cmd/consumer/*.go
$(GO_CMD_W_CGO) build -o output/consumer cmd/consumer/*.go

.PHONY: consumer-up
consumer-up:
Expand All @@ -126,9 +131,9 @@ consumer-up:

# Build Jazbot
.PHONY: build-jazbot
build-jazbot:
build-jazbot: prepare
@echo "Building Jazbot Go binary..."
$(GO_CMD_W_CGO) build -o jazbot cmd/jazbot/*.go
$(GO_CMD_W_CGO) build -o output/jazbot cmd/jazbot/*.go

.PHONY: jazbot-up
jazbot-up:
Expand All @@ -154,9 +159,9 @@ empty-fanout:
redis-cli --scan --pattern "cg:*" | xargs -L 1000 redis-cli DEL

.PHONY: build-graphd
build-graphd:
build-graphd: prepare
@echo "Building GraphD Go binary..."
$(GO_CMD_W_CGO) build -o graphd cmd/graphd/*.go
$(GO_CMD_W_CGO) build -o output/graphd cmd/graphd/*.go

.PHONY: graphd-up
graphd-up: # Runs graphd docker container
Expand Down
2 changes: 1 addition & 1 deletion build/consumer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FROM debian:stable-slim
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

# Copy the binary from the first stage.
COPY --from=builder /app/consumer .
COPY --from=builder /app/output/consumer .

# Set the startup command to run the binary
CMD ["./consumer"]
2 changes: 1 addition & 1 deletion build/graph-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM debian:stable-slim

COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

COPY --from=builder /app/graph-builder .
COPY --from=builder /app/output/graph-builder .

RUN mkdir -p /app/data

Expand Down
2 changes: 1 addition & 1 deletion build/graphd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN apt-get update && apt-get install -y procps && rm -rf /var/lib/apt/lists/*
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

# Copy the binary from the first stage.
COPY --from=builder /app/graphd .
COPY --from=builder /app/output/graphd .

# Set the startup command to run the binary
CMD ["./graphd"]
2 changes: 1 addition & 1 deletion build/indexer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM debian:stable-slim

COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

COPY --from=builder /app/indexer .
COPY --from=builder /app/output/indexer .

RUN mkdir -p /app/data

Expand Down
2 changes: 1 addition & 1 deletion build/jazbot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FROM debian:stable-slim
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

# Copy the binary from the first stage.
COPY --from=builder /app/jazbot .
COPY --from=builder /app/output/jazbot .

# Set the startup command to run the binary
CMD ["./jazbot"]
2 changes: 1 addition & 1 deletion build/plc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM debian:stable-slim

COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

COPY --from=builder /app/plc .
COPY --from=builder /app/output/plc .

RUN mkdir -p /app/data

Expand Down
2 changes: 1 addition & 1 deletion build/search/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM alpine:latest

COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

COPY --from=builder /app/search .
COPY --from=builder /app/output/search .

COPY public/ public/

Expand Down