-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (44 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
59 lines (44 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
BIN := bin/oim
COORDINATOR_BIN := bin/oim-coordinator
DIRECTORY_BIN := bin/oim-directory
STUB_EXO_BIN := bin/stub-exo
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || echo dev-$(shell git rev-parse --short HEAD 2>/dev/null || echo none))
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
VPKG := github.com/open-inference-mesh/oim/internal/version
LDFLAGS := -s -w -buildid= -X $(VPKG).Version=$(VERSION) -X $(VPKG).Commit=$(COMMIT)
.PHONY: build build-all test test-integration lint clean install sim sim-down release image version
build:
go build -ldflags "$(LDFLAGS)" -o $(BIN) ./cmd/oim
build-all:
go build -ldflags "$(LDFLAGS)" -o $(BIN) ./cmd/oim
go build -ldflags "$(LDFLAGS)" -o $(COORDINATOR_BIN) ./cmd/coordinator
go build -ldflags "$(LDFLAGS)" -o $(DIRECTORY_BIN) ./cmd/directory
go build -ldflags "$(LDFLAGS)" -o $(STUB_EXO_BIN) ./cmd/stub-exo
install:
go install -ldflags "$(LDFLAGS)" ./cmd/oim
version:
@echo "$(VERSION) ($(COMMIT))"
# Cross-platform, reproducible, checksummed release artifacts into dist/.
release:
VERSION=$(VERSION) scripts/build-release.sh
# Version-stamped container image.
image:
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) \
--build-arg BUILD_DATE=$$(TZ=UTC git log -1 --pretty=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ) \
-t mlxmesh:$(VERSION) -t mlxmesh:latest .
test:
go test ./...
lint:
golangci-lint run ./...
test-integration:
go test -tags integration ./tests/ -run Integration -v
clean:
rm -rf bin/
# Docker simulation cluster
gen-compose:
go run ./tools/gen-compose --us=13 --eu=12 > docker-compose.yml
sim: gen-compose
docker compose build
docker compose up
sim-down:
docker compose down