2512ecb701
New PeerManager, Allocator, Informer components have been added along with a new "replication_factor" configuration option. First, cluster peers collect and push metrics (Informer) to the Cluster leader regularly. The Informer is an interface that can be implemented in custom wayts to support custom metrics. Second, on a pin operation, using the information from the collected metrics, an Allocator can provide a list of preferences as to where the new pin should be assigned. The Allocator is an interface allowing to provide different allocation strategies. Both Allocator and Informer are Cluster Componenets, and have access to the RPC API. The allocations are kept in the shared state. Cluster peer failure detection is still missing and re-allocation is still missing, although re-pinning something when a node is down/metrics missing does re-allocate the pin somewhere else. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
66 lines
1.7 KiB
Makefile
66 lines
1.7 KiB
Makefile
gx_version=v0.10.0
|
|
gx-go_version=v1.4.0
|
|
|
|
deptools=deptools
|
|
|
|
gx=gx_$(gx_version)
|
|
gx-go=gx-go_$(gx-go_version)
|
|
gx_bin=$(deptools)/$(gx)
|
|
gx-go_bin=$(deptools)/$(gx-go)
|
|
bin_env=$(shell go env GOHOSTOS)-$(shell go env GOHOSTARCH)
|
|
|
|
export PATH := $(deptools):$(PATH)
|
|
|
|
all: service ctl
|
|
clean: rwundo
|
|
$(MAKE) -C ipfs-cluster-service clean
|
|
$(MAKE) -C ipfs-cluster-ctl clean
|
|
install: deps
|
|
$(MAKE) -C ipfs-cluster-service install
|
|
$(MAKE) -C ipfs-cluster-ctl install
|
|
|
|
build: deps
|
|
go build -ldflags "-X ipfscluster.Commit=$(shell git rev-parse HEAD)"
|
|
$(MAKE) -C ipfs-cluster-service build
|
|
$(MAKE) -C ipfs-cluster-ctl build
|
|
|
|
service: deps
|
|
$(MAKE) -C ipfs-cluster-service ipfs-cluster-service
|
|
ctl: deps
|
|
$(MAKE) -C ipfs-cluster-ctl ipfs-cluster-ctl
|
|
|
|
$(gx_bin):
|
|
@echo "Downloading gx"
|
|
@mkdir -p ./$(deptools)
|
|
@rm -f $(deptools)/gx
|
|
@wget -nc -q -O $(gx_bin).tgz https://dist.ipfs.io/gx/$(gx_version)/$(gx)_$(bin_env).tar.gz
|
|
@tar -zxf $(gx_bin).tgz -C $(deptools) --strip-components=1 gx/gx
|
|
@mv $(deptools)/gx $(gx_bin)
|
|
@ln -s $(gx) $(deptools)/gx
|
|
@rm $(gx_bin).tgz
|
|
|
|
$(gx-go_bin):
|
|
@echo "Downloading gx-go"
|
|
@mkdir -p ./$(deptools)
|
|
@rm -f $(deptools)gx-go
|
|
@wget -nc -q -O $(gx-go_bin).tgz https://dist.ipfs.io/gx-go/$(gx-go_version)/$(gx-go)_$(bin_env).tar.gz
|
|
@tar -zxf $(gx-go_bin).tgz -C $(deptools) --strip-components=1 gx-go/gx-go
|
|
@mv $(deptools)/gx-go $(gx-go_bin)
|
|
@ln -s $(gx-go) $(deptools)/gx-go
|
|
@rm $(gx-go_bin).tgz
|
|
|
|
gx: $(gx_bin) $(gx-go_bin)
|
|
|
|
deps: gx
|
|
$(gx_bin) --verbose install --global
|
|
$(gx-go_bin) rewrite
|
|
test: deps
|
|
go test -tags silent -v ./...
|
|
rw: gx
|
|
$(gx-go_bin) rewrite
|
|
rwundo: gx
|
|
$(gx-go_bin) rewrite --undo
|
|
publish: rwundo
|
|
$(gx_bin) publish
|
|
.PHONY: all gx deps test rw rwundo publish service ctl install clean
|