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

Cvm runtime submodules to go modules #732

Merged
merged 10 commits into from
Aug 13, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "cvm-runtime"]
path = cvm-runtime
url = https://github.com/CortexFoundation/cvm-runtime.git
branch = master
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BASE = $(shell pwd)
GOBIN = $(shell pwd)/build/bin
GO ?= latest
LIB_MINER_DIR = $(shell pwd)/solution/
INFER_NET_DIR = $(shell pwd)/cvm-runtime/
##INFER_NET_DIR = $(shell pwd)/cvm-runtime/

# Curkoo algorithm dynamic library path
OS = $(shell uname)
Expand Down Expand Up @@ -98,13 +98,13 @@ plugins/cpu_helper_for_node.so:
#build/env.sh go build -buildmode=plugin -o $@ consensus/cuckoo/plugins/cpu_helper_for_node.go

plugins/lib_cvm.so:
$(MAKE) -C ${INFER_NET_DIR} -j8 lib
#$(MAKE) -C ${INFER_NET_DIR} -j8 lib
@mkdir -p plugins
ln -sf ../cvm-runtime/build/libcvm_runtime.so $@
# build/env.sh go build -v -buildmode=plugin -o $@ cmd/plugins/c_wrapper.go
# ln -sf ../../cvm-runtime/kernel inference/synapse/kernel

clib_cpu: plugins/cpu_helper_for_node.so plugins/lib_cvm.so
clib_cpu: plugins/cpu_helper_for_node.so

clib: plugins/cuda_helper_for_node.so plugins/cpu_helper_for_node.so plugins/lib_cvm.so

Expand All @@ -129,13 +129,13 @@ lint: ## Run linters.

clean: clean-clib
./build/clean_go_build_cache.sh
rm -fr build/_workspace/pkg/ $(GOBIN)/* plugins/* build/_workspace/src/ solution/*.a solution/*.o
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/_workspace/src/ solution/*.a solution/*.o
# rm -rf inference/synapse/kernel
# ln -sf ../../cvm-runtime/kernel inference/synapse/kernel

clean-clib:
#$(MAKE) -C $(LIB_MINER_DIR) clean
$(MAKE) -C $(INFER_NET_DIR) clean
#$(MAKE) -C $(INFER_NET_DIR) clean

.PHONY: clean-all
clean-all: clean-clib clean
Expand Down
4 changes: 2 additions & 2 deletions common/storage_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
package common

type StorageEntry struct {
Hash string
Size uint64
Hash string `json:"hash" gencodec:"required"`
Size uint64 `json:"size" gencodec:"required"`
}
1 change: 0 additions & 1 deletion cvm-runtime
Submodule cvm-runtime deleted from dc9132
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.14

require (
github.com/Azure/azure-storage-blob-go v0.8.1-0.20191213204130-762620a866ba
github.com/CortexFoundation/cvm-runtime v0.0.0-20200812085857-abd157d76a51
github.com/CortexFoundation/torrentfs v1.0.20-0.20200810031954-d36d26f82fcc
github.com/VictoriaMetrics/fastcache v1.5.8-0.20200305212624-8835719dc76c
github.com/aristanetworks/goarista v0.0.0-20200513152637-638451432ae4
Expand All @@ -13,13 +14,11 @@ require (
github.com/cespare/cp v1.1.1
github.com/cloudflare/cloudflare-go v0.11.7
github.com/davecgh/go-spew v1.1.1
github.com/dlclark/regexp2 v1.2.0 // indirect
github.com/docker/docker v1.13.1
github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08
github.com/go-resty/resty/v2 v2.3.1-0.20200717071130-ca7661ad51fe
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-stack/stack v1.8.0
github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26
github.com/gorilla/websocket v1.4.2
Expand Down Expand Up @@ -48,7 +47,6 @@ require (
github.com/ucwong/tsdb v0.10.4-0.20200518132041-df9cb51f3a80
github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9
golang.org/x/text v0.3.3
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
github.com/CortexFoundation/CortexTheseus v1.9.56/go.mod h1:MkF8L4FF1jb8K8V6gDDQ3/cFJjNJ8byEp/WEj+4/zdE=
github.com/CortexFoundation/CortexTheseus v1.10.3-0.20200624034846-46f8f368cbee/go.mod h1:S/ekN5n18+CtbVTy4l8G5kmDn3xTFKVrcMUBymY7JwQ=
github.com/CortexFoundation/CortexTheseus v1.10.3-0.20200704025058-f0885ec2bd83/go.mod h1:++9X1TLZ+XbAFxrQO5Cl9T/5/OW6JaLlvVnDsEH0qkA=
github.com/CortexFoundation/CortexTheseus v1.10.8/go.mod h1:BxMcNBe5UuA9WWMLBdHP5JqpFKyCBZza+6FLSMx7Nhk=
github.com/CortexFoundation/cvm-runtime v0.0.0-20200812085857-abd157d76a51 h1:JL/iwqos57UPfrYHjC5d4c4LPAyOVLFltubwFf8R12Q=
github.com/CortexFoundation/cvm-runtime v0.0.0-20200812085857-abd157d76a51/go.mod h1:oLEQaJbHT0SAIVjY90BYPYVikGylXHrPyf1yTPS7HZg=
github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8 h1:tdddGS9QxQxI1c+svSyJ5IX9pvN3BK9DYYQ50E7mEWI=
github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8/go.mod h1:Ma+tGhPPvz4CEZHaqEJQMOEGOfHeQBiAoNd1zyc/w3Q=
github.com/CortexFoundation/torrentfs v1.0.14-0.20200703071639-3fcabcabf274/go.mod h1:qnb3YlIJmuetVBtC6Lsejr0Xru+1DNmDCdTqnwy7lhk=
Expand Down
2 changes: 1 addition & 1 deletion inference/synapse/local_infer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (

"github.com/CortexFoundation/CortexTheseus/common"
"github.com/CortexFoundation/CortexTheseus/common/lru"
"github.com/CortexFoundation/CortexTheseus/cvm-runtime/kernel"
"github.com/CortexFoundation/CortexTheseus/inference"
"github.com/CortexFoundation/CortexTheseus/log"
"github.com/CortexFoundation/CortexTheseus/metrics"
"github.com/CortexFoundation/cvm-runtime/kernel"
"time"
)

Expand Down
4 changes: 2 additions & 2 deletions inference/synapse/synapse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"github.com/CortexFoundation/CortexTheseus/common"
"github.com/CortexFoundation/CortexTheseus/common/lru"
"github.com/CortexFoundation/CortexTheseus/cvm-runtime/kernel"
"github.com/CortexFoundation/CortexTheseus/log"
"github.com/CortexFoundation/CortexTheseus/params"
"github.com/CortexFoundation/cvm-runtime/kernel"
"github.com/CortexFoundation/torrentfs"
resty "github.com/go-resty/resty/v2"
"math/big"
Expand All @@ -31,7 +31,7 @@ var (

const (
PLUGIN_PATH string = "plugins/"
PLUGIN_POST_FIX string = "lib_cvm.so"
PLUGIN_POST_FIX string = "libcvm_runtime.so"
MinMemoryUsage int64 = 2 * 1024 * 1024 * 1024
ReservedMemoryUsage int64 = 512 * 1024 * 1024
)
Expand Down
Binary file added plugins/libcvm_runtime.so
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions vendor/github.com/CortexFoundation/cvm-runtime/kernel/c_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions vendor/github.com/CortexFoundation/cvm-runtime/kernel/dlopen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.