Coder Social home page Coder Social logo

core's Introduction

Core

Install libgit2

We use v0.23.4 because v0.24 sucks

cp  /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git checkout b0b94c4ee5ddec3a33d1ecb406f73b19642ec519 libgit2.rb
git commit -m 'override libgit2 version'

DEV

生产服部署在 c2-eru-1,测试服部署在 c1-eru-1,如果需要测试,先更新 core,然后这样子部署:

devtools/upgrade-eru-core.sh test
devtools/upgrade-eru-core.sh prod

setup dev environment

git config --global url."[email protected]:".insteadOf "https://gitlab.ricebook.net/"
go get gitlab.ricebook.net/platform/core.git
mv $GOPATH/src/gitlab.ricebook.net/platform/core.git $GOPATH/src/gitlab.ricebook.net/platform/core
cd $GOPATH/src/gitlab.ricebook.net/platform/core
make deps
make build

Upgrade core on test/production server

make build
# test server
devtools/upgrade-eru-core.sh test eru-core
# prod server
devtools/upgrade-eru-core.sh

GRPC

Generate golang & python code

$ go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
$ make golang
$ make python

Current version of dependencies are:

  • google.golang.org/grpc: v1.0.1-GA
  • github.com/golang/protobuf: f592bd283e

do not forget first command...

deploy core on local environment

  • create core.yaml like this
bind: ":5000" # gRPC server 监听地址
agent_port: "12345" # agent 的 HTTP API 端口, 暂时没有用到
permdir: "/mnt/mfs/permdirs" # 宿主机的 permdir 的路径
etcd: # etcd 集群的地址
    - "http://127.0.0.1:2379"
etcd_lock_prefix: "/eru-core/_lock" # etcd 分布式锁的前缀, 一般会用隐藏文件夹

git:
    public_key: "[path_to_pub_key]" # git clone 使用的公钥
    private_key: "[path_to_pri_key]" # git clone 使用的私钥
    gitlab_token: "[token]" # gitlab API token

docker:
    log_driver: "json-file" # 日志驱动, 线上会需要用 none
    network_mode: "bridge" # 默认网络模式, 用 bridge
    cert_path: "[cert_file_dir]" # docker tls 证书目录
    hub: "hub.ricebook.net" # docker hub 地址
    hub_prefix: "namespace/test" # 存放镜像的命名空间, 两边的/会被去掉, 中间的会保留. 镜像名字会是$hub/$hub_prefix/appname:version

scheduler:
    lock_key: "_scheduler_lock" # scheduler 用的锁的 key, 会在 etcd_lock_prefix 里面
    lock_ttl: 10 # scheduler 超时时间
    type: "complex" # scheduler 类型, complex 或者 simple
  • start eru core
$ core --config /path/to/core.yaml --log-level debug

or

$ export ERU_CONFIG_PATH=/path/to/core.yaml
$ export ERU_LOG_LEVEL=DEBUG
$ core

Use client.py

$ devtools/client.py --grpc-host core-grpc.intra.ricebook.net node:get intra c2-docker-7

core's People

Contributors

tonicmuroq avatar timfeirg avatar cmgs avatar

Stargazers

DQ avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.