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(vermeer): provides Vermeer project for the Go version of algorithms #311

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions vermeer/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*data*
*test*
*.git*
85 changes: 85 additions & 0 deletions vermeer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Golang #
######################
# `go test -c` 生成的二进制文件
*.test

# go coverage 工具
*.out
*.prof
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

# 编译文件 #
###################
*.com
*.class
#*.dll
*.exe
#*.o
#*.so
main
vermeer

# 压缩包 #
############
# Git 自带压缩,如果这些压缩包里有代码,建议解压后 commit
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# 日志文件和数据库 #
######################
*.log
*.sqlite
*.db

# 临时文件 #
######################
tmp/
.tmp/
data/
result/
vermeer_data/

# 系统生成文件 #
######################
.DS_Store
.DS_Store?
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.TemporaryItems
.fseventsd
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# IDE 和编辑器 #
######################
.idea/
/go_build_*
out/
#.vscode/
.vscode/settings.json
*.sublime*
__debug_bin
.project

# 前端工具链 #
######################
.sass-cache/*
node_modules/
/output/
/bin/*
!/bin/*.sh
16 changes: 16 additions & 0 deletions vermeer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.18-alpine AS builder
COPY ./ /src/
WORKDIR /src/
ENV CGO_ENABLED="0"
RUN go build -o /go/bin/app

FROM alpine
EXPOSE 8080
COPY --from=builder /go/bin/app /go/bin/app
COPY --from=builder /src/config/ /go/bin/config/
COPY --from=builder /usr/local/go/lib/time/zoneinfo.zip /
ENV TZ=Asia/Shanghai
ENV ZONEINFO=/zoneinfo.zip

WORKDIR /go/bin/
ENTRYPOINT ["/go/bin/app"]
50 changes: 50 additions & 0 deletions vermeer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 图计算平台

### grpc protobuf 依赖项安装

````
go install google.golang.org/protobuf/cmd/[email protected] \
go install google.golang.org/grpc/cmd/[email protected]
````

---

### protobuf build

````
../../tools/protoc/osxm1/protoc *.proto --go-grpc_out=. --go_out=.
````

---

### 交叉编译

````
linux: GOARCH=amd64 GOOS=linux go build
CC=x86_64-linux-musl-gcc CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=plugin
````

---

### 运行

```
master: ./vermeer --env=master
worker: ./vermeer --env=worker01
# 参数env是指定使用config文件夹下的配置文件名
or
./vermeer.sh start master
./vermeer.sh start worker
# 配置项在vermeer.sh中指定
```

---

## supervisord

配置文件参考 config/supervisor.conf

````
# 启动 run as daemon
./supervisord -c supervisor.conf -d
````
22 changes: 22 additions & 0 deletions vermeer/algorithms/algorithms.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with this
work for additional information regarding copyright ownership. The ASF
licenses this file to You under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*/

package algorithms

import "vermeer/apps/compute"

var Algorithms []compute.AlgorithmMaker
Loading
Loading