mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
updated version
This commit is contained in:
@@ -2,6 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/apex/log"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -54,4 +55,17 @@ func initConfig() {
|
||||
if err := viper.ReadInConfig(); err == nil {
|
||||
fmt.Println("Using config file:", viper.ConfigFileUsed())
|
||||
}
|
||||
|
||||
// initialize log level
|
||||
initLogLevel()
|
||||
}
|
||||
|
||||
func initLogLevel() {
|
||||
// set log level
|
||||
logLevel := viper.GetString("log.level")
|
||||
l, err := log.ParseLevel(logLevel)
|
||||
if err != nil {
|
||||
l = log.InfoLevel
|
||||
}
|
||||
log.SetLevel(l)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.16
|
||||
|
||||
require (
|
||||
github.com/apex/log v1.9.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211219.2134
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211224.1500
|
||||
github.com/crawlab-team/go-trace v0.1.1
|
||||
github.com/gin-gonic/gin v1.7.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
|
||||
@@ -11,11 +11,10 @@ replace (
|
||||
|
||||
require (
|
||||
github.com/apex/log v1.9.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211213.2006
|
||||
github.com/crawlab-team/go-trace v0.1.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211219.2134
|
||||
github.com/crawlab-team/go-trace v0.1.1
|
||||
github.com/gin-gonic/gin v1.7.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spf13/viper v1.7.1
|
||||
go.mongodb.org/mongo-driver v1.6.0 // indirect
|
||||
go.uber.org/dig v1.10.0
|
||||
)
|
||||
|
||||
10
backend/test/config-worker-03.json
Normal file
10
backend/test/config-worker-03.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"key": "worker-03",
|
||||
"is_master": false,
|
||||
"name": "Worker Node 03",
|
||||
"ip": "",
|
||||
"mac": "",
|
||||
"hostname": "",
|
||||
"description": "",
|
||||
"auth_key": "Crawlab2021!"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@crawlab/app",
|
||||
"version": "0.6.0-beta.20211221.1200",
|
||||
"version": "0.6.0-beta.20211224.1500",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"crawlab-ui": "0.6.0-beta.20211219.1200",
|
||||
"crawlab-ui": "0.6.0-beta.20211224.1500",
|
||||
"vue": "3.0.11",
|
||||
"vue-router": "^4.0.11"
|
||||
},
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<link rel="icon" type="image/x-icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<link rel="stylesheet" href="font-awesome.min.css">
|
||||
<meta charset="utf-8">
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
|
||||
<link href="font-awesome.min.css" rel="stylesheet">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<script>
|
||||
window.VUE_APP_API_BASE_URL = '<%= VUE_APP_API_BASE_URL %>'
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,24 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
build:
|
||||
build:
|
||||
context: ./dockerfiles/golang
|
||||
command: /bin/bash -c "rm -f /backend/dist/crawlab && go build -o ./dist/crawlab ./"
|
||||
volumes:
|
||||
- ./dist:/backend/dist
|
||||
- ./.crawlab/go/pkg/mod:/go/pkg/mod
|
||||
- ../backend:/backend
|
||||
- ../backend/go.mod.local:/backend/go.mod
|
||||
- ../..:/libs/crawlab-team
|
||||
environment:
|
||||
GOPROXY: https://goproxy.cn,direct
|
||||
|
||||
master:
|
||||
build:
|
||||
context: ./dockerfiles/golang
|
||||
command: /bin/bash -c "/app/bin/docker-start-master.sh && air -c .air.master.conf"
|
||||
command: /bin/bash -c "/app/bin/docker-start-master.sh && /dist/crawlab master"
|
||||
volumes:
|
||||
- ./dist:/dist
|
||||
- ./.crawlab/master:/root/.crawlab
|
||||
- ./.crawlab/go/pkg/mod:/go/pkg/mod
|
||||
- ../backend:/backend
|
||||
@@ -17,22 +31,29 @@ services:
|
||||
CRAWLAB_NODE_MASTER: "Y"
|
||||
CRAWLAB_NODE_NAME: "Master Node"
|
||||
CRAWLAB_MONGO_HOST: "mongo"
|
||||
CRAWLAB_LOG_LEVEL: debug
|
||||
GOPROXY: https://goproxy.cn,direct
|
||||
ports:
|
||||
- "9080:8080"
|
||||
- "9000:8000"
|
||||
- "9866:9666"
|
||||
- "9888:8888"
|
||||
depends_on:
|
||||
- mongo
|
||||
|
||||
worker01:
|
||||
build:
|
||||
context: ./dockerfiles/golang
|
||||
command: "air -c .air.worker.conf"
|
||||
command: /bin/bash -c "/dist/crawlab worker"
|
||||
environment:
|
||||
CRAWLAB_NODE_MASTER: "N"
|
||||
CRAWLAB_NODE_NAME: "Worker Node 01"
|
||||
CRAWLAB_GRPC_ADDRESS: "master"
|
||||
CRAWLAB_FS_FILER_URL: "http://master:8080/api/filer"
|
||||
CRAWLAB_LOG_LEVEL: debug
|
||||
GOPROXY: https://goproxy.cn,direct
|
||||
volumes:
|
||||
- ./dist:/dist
|
||||
- ./.crawlab/worker01:/root/.crawlab
|
||||
- ./.crawlab/go/pkg/mod:/go/pkg/mod
|
||||
- ../backend:/backend
|
||||
@@ -44,13 +65,16 @@ services:
|
||||
worker02:
|
||||
build:
|
||||
context: ./dockerfiles/golang
|
||||
command: "air -c .air.worker.conf"
|
||||
command: /bin/bash -c "/dist/crawlab worker"
|
||||
environment:
|
||||
CRAWLAB_NODE_MASTER: "N"
|
||||
CRAWLAB_NODE_NAME: "Worker Node 01"
|
||||
CRAWLAB_NODE_NAME: "Worker Node 02"
|
||||
CRAWLAB_GRPC_ADDRESS: "master"
|
||||
CRAWLAB_FS_FILER_URL: "http://master:8080/api/filer"
|
||||
CRAWLAB_LOG_LEVEL: debug
|
||||
GOPROXY: https://goproxy.cn,direct
|
||||
volumes:
|
||||
- ./dist:/dist
|
||||
- ./.crawlab/worker02:/root/.crawlab
|
||||
- ./.crawlab/go/pkg/mod:/go/pkg/mod
|
||||
- ../backend:/backend
|
||||
@@ -58,6 +82,7 @@ services:
|
||||
- ../..:/libs/crawlab-team
|
||||
depends_on:
|
||||
- master
|
||||
- worker01
|
||||
|
||||
mongo:
|
||||
image: mongo:4
|
||||
|
||||
Reference in New Issue
Block a user