wayne开发环境

参考官方链接

https://360yun.org/wayne/dev/develop-flow.html

 

架构图
整体采用前后端分离的方案,其中前端采用Angular框架进行数据交互和展示,
使用Ace编辑器进行Kubernetes资源模版编辑。
后端采用Beego框架做数据接口处理,使用Client-go与Kubernetes进行交互,数据使用MySQL存储。
组件
Web UI:提供完整的业务开发和平台运维功能体验。
Worker:扩展一系列基于消息队列的功能,例如Audit和Webhooks等审计组件。
项目依赖
Golang 1.9+( installation manual )
Docker 17.05+ ( installation manual )
Bee ( installation manual ) (请务必使用链接版本,不要使用beego官方版本,存在一些定制)
Node.js 8+ and npm 5+ ( installation with nvm )
MySQL 5.6+ (Wayne主要数据都存在MySQL中)
RabbitMQ (可选,如需扩展审计功能,例如操作审计和Webhooks等,则需部署)

 

 

 

1. go安装参考

https://blog.csdn.net/sun007700/article/details/88813841

2. docker安装参考连接:

https://blog.csdn.net/sun007700/article/details/88814258

3. bee环境准备

  • bee (installation manual) (请务必使用链接版本,不要使用 beego 官方版本,存在一些定制)

所以

yum -y install  git

#不用 go get github.com/beego/bee
go get   github.com/wilhelmguo/bee

 

执行

# bee version
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0

├── Beego     : Beego is not installed. Please do consider installing it first: https://github.com/astaxie/beego
├── GoVersion : go1.12.1
├── GOOS      : linux
├── GOARCH    : amd64
├── NumCPU    : 4
├── GOPATH    : /data/work/gopath
├── GOROOT    : /data/work/go
├── Compiler  : gc
└── Date      : Tuesday, 26 Mar 2019
[root@localhost src]# 
 

bee new my-web-app

go get  -u -v  github.com/astaxie/beego

cd my-web-app && bee run

访问:http://10.0.3.246:8080/

 wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

 export NVM_DIR="$HOME/.nvm" 
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

 nvm --version 

 nvm install node # "node" is an alias for the latest version

 node --version // 查看nodejs版本
# npm -v
6.7.0

# npm config get registry
https://registry.npmjs.org/

# npm config set registry https://registry.npm.taobao.org

# npm config get registry
https://registry.npm.taobao.org/

  • 5. MySQL 5.6+ (Wayne 主要数据都存在 MySQL 中)
 go get github.com/Qihoo360/wayne
systemctl  restart  docker
$ docker-compose up -d mysql
$ docker-compose up -d rabbitmq

如果失败参考以下连接进行修改
https://blog.csdn.net/sun007700/article/details/88720944

使用wayne本地镜像,安装mysql和 rabbitmq

 

#初始化Wayne所需plugins,执行如下操作:
cd $GOPATH/src/github.com/Qihoo360/wayne
git submodule update --init --recursive

touch src/backend/conf/dev.conf
# 复制src/backend/conf/app.conf里面的内容到  dev.conf,必须去掉 include "dev.conf" 否则会出现循环引用导致内存溢出。

#启动后端服务
make run-backend

安装前端依赖
yum -y install  gcc-c++
cd src/frontend && npm install --no-save

cd $GOPATH/src/github.com/Qihoo360/wayne && make run-frontend

现在你可以通过 http://localhost:4200 访问 Wayne 服务了 !

安装ng

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm i --g @angular/cli
 ng --version

 

angular.json

 

最后构建 Wayne 镜像

修改Makefile

REGISTRY_URI :=test.com/wayne  #harbor仓库名称


 

编译

make build-server-image
make build-ui-image
make

#make build-ui-image时下载下面连接
https://github.com/sass/node-sass/releases/download/v4.10.0/linux-x64-57_binding.node
可以考虑放到本地gitlab上。

使用harbor镜像仓库

docker  login  test.com

docker tag 360cloud/wayne-server-builder:v1.0.0  test.com/wayne/backend
docker push test.com/wayne/backend

docker tag 360cloud/wayne-ui-builder:v1.0.1  test.com/wayne/frontend
docker push test.com/wayne/frontend

docker tag node:8.12  test.com/wayne/node:8.12
docker  push  test.com/wayne/node:8.12

docker tag golang:1.10  test.com/wayne/golang:1.10
docker push test.com/wayne/golang:1.10

docker tag  360cloud/centos:7  test.com/docker/centos:7
docker push test.com/docker/centos:7


make产生的wayne镜像,通过docker push到harbor仓库,最后再通过k8s部署到生产环境,参考连接

https://blog.csdn.net/sun007700/article/details/88850554

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值