-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b50be2f
commit 12f3d50
Showing
144 changed files
with
4,323 additions
and
4,554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
bin | ||
bin/dummy_task | ||
bin/worker | ||
bin/spearlet | ||
.idea | ||
.DS_Store | ||
*.whl | ||
*.egg-info | ||
sdk/python/dist | ||
sdk/python/dist | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,56 @@ | ||
|
||
PROJECT_ROOT := $(shell pwd) | ||
OUTPUT_DIR := $(PROJECT_ROOT)/bin | ||
REPO_ROOT := $(shell pwd) | ||
OUTPUT_DIR := $(REPO_ROOT)/bin | ||
|
||
|
||
all: clean worker workload sdk | ||
all: clean spearlet workload sdk | ||
|
||
|
||
SUBDIRS := $(shell find $(REPO_ROOT) -mindepth 1 -maxdepth 3 -type d -exec test -e {}/Makefile \; -exec echo {} \;) | ||
WORKLOAD_SUBDIRS := $(shell find $(REPO_ROOT)/workload -mindepth 1 -maxdepth 3 -type d -exec test -e {}/Makefile \; -exec echo {} \;) | ||
|
||
clean: | ||
@set -ex; \ | ||
docker system prune -f && \ | ||
rm -rf $(OUTPUT_DIR) && \ | ||
find $(PROJECT_ROOT)/workload -mindepth 1 -maxdepth 3 -type d -exec test -e {}/Makefile \; -exec make -C {} clean \; | ||
find $(PROJECT_ROOT)/sdk -mindepth 1 -maxdepth 2 -type d -exec test -e {}/Makefile \; -exec make -C {} clean \; | ||
|
||
worker: | ||
go build -o $(OUTPUT_DIR)/worker \ | ||
$(PROJECT_ROOT)/cmd/worker/main.go | ||
rm -rf $(REPO_ROOT)/pkg/spear && \ | ||
for dir in $(SUBDIRS); do \ | ||
make -C $$dir clean; \ | ||
done | ||
|
||
test: workload | ||
go test -v $(PROJECT_ROOT)/test/... | ||
build: spearlet | ||
@set -e; \ | ||
for dir in $(SUBDIRS); do \ | ||
make -C $$dir build; \ | ||
done | ||
|
||
workload: sdk | ||
find $(PROJECT_ROOT)/workload -mindepth 1 -maxdepth 3 -type d -exec test -e {}/Makefile \; -exec echo "make -C {}" \; -exec make -C {} \; | ||
spearlet: pkg/spear | ||
go build -o $(OUTPUT_DIR)/spearlet \ | ||
$(REPO_ROOT)/cmd/spearlet/main.go | ||
|
||
sdk: | ||
find $(PROJECT_ROOT)/sdk -mindepth 1 -maxdepth 2 -type d -exec test -e {}/Makefile \; -exec make -C {} \; | ||
test: workload | ||
@set -e; \ | ||
go test -v $(REPO_ROOT)/test/... && \ | ||
for dir in $(SUBDIRS); do \ | ||
make -C $$dir test; \ | ||
done | ||
|
||
workload: build | ||
@set -e; \ | ||
for dir in $(WORKLOAD_SUBDIRS); do \ | ||
make -C $$dir; \ | ||
done | ||
|
||
format_python: | ||
isort -rc $(PROJECT_ROOT)/ | ||
isort -rc $(REPO_ROOT)/ | ||
|
||
format_golang: | ||
gofmt -w . | ||
|
||
format: format_python format_golang | ||
|
||
.PHONY: all worker test workload clean sdk format_python format | ||
pkg/spear: | ||
allfiles=`find ${REPO_ROOT}/proto -name "*.fbs"`; \ | ||
flatc -o $(REPO_ROOT)/pkg/ -I ${REPO_ROOT}/proto --go-module-name "github.com/lfedgeai/spear/pkg" --go $${allfiles} | ||
|
||
.PHONY: all spearlet test workload clean format_python format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
package common | ||
|
||
import "runtime" | ||
|
||
const MaxDataResponseSize = 4096 * 1024 | ||
const SpearPlatformAddress = "172.17.0.1" | ||
|
||
var SpearPlatformAddress string | ||
|
||
func init() { | ||
SpearPlatformAddress = map[string]string{ | ||
"darwin": "host.docker.internal", | ||
"linux": "172.17.0.1", | ||
"windows": "host.docker.internal", | ||
}[runtime.GOOS] | ||
} |
Oops, something went wrong.