cuigh / swirl Goto Github PK
View Code? Open in Web Editor NEWA web UI for Docker, focused on swarm cluster.
License: MIT License
A web UI for Docker, focused on swarm cluster.
License: MIT License
昨天克隆仓库后直接docker build,首先是用bolt类型的数据库,然后容器启动失败,日志报
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xa75e18]
goroutine 1 [running]:
github.com/boltdb/bolt.(*Bucket).ForEach(0xc00032a2b8, 0xc00025f038)
/go/pkg/mod/github.com/boltdb/[email protected]/bucket.go:385 +0x18
然后换mongodb,这是我两个容器的启动参数
docker run --name mongo -d -p 27017:27017 mongo
docker run -d -p 80:8001
-v /var/run/docker.sock:/var/run/docker.sock
-e DB_TYPE=mongo
-e DB_ADDRESS=mongodb://192.168.3.70:27017/swirl
--name=swirl
swirl:test-v1
换mongo之后启动成功了,并且Web页面能进入,但是在设置登录名跟密码之后登录失败。
密码设置的123456,登录失败,swirl容器也查不到详细的日志。
在HTTPS的情况下 WebSocket没有使用wss导致无法链接 希望修复一下
你好,不好意思还要麻烦一下,我按照readme中的所说的service label的方式配置了一个测试nginx,stack是这样的:
`version: '3.6'
services:
nginx:
image: nginx:latest
environment:
- TZ=Asia/Shanghai
deploy:
labels:
swirl.scale: swirl.scale=min=1,max=5,cpu=20:50
restart_policy:
condition: on-failure
resources:
limits:
cpus: "0.01"
memory: 200M
update_config:
parallelism: 1 # 每次更新1个副本
delay: 5s # 每次更新间隔
monitor: 10s # 单次更新多长时间后没有结束则判定更新失败
max_failure_ratio: 0.1 # 更新时能容忍的最大失败率
order: start-first # 更新顺序为新任务启动优先
ports:
- 18081:80`
但是在后面的压测中,一直没有看到这个service进行scale的动作,请问是哪里配置有问题吗?谢谢!
Query expression怎么写?
我觉得楼主直接定好模版就行了。
最近正好在学习Go相关的内容 有时间的话我自己也会试着写写看 提交PR
1、想要一些系统级的监控
2、能不能适配多个docker swarm集群管理
error from daemon in stream: Error grabbing logs: rpc error: code = Unknown desc = warning: incomplete log stream. some logs could not be retrieved for the following reasons: rpc error: code = Internal desc = grpc: received message length 1948282738 exceeding the max size 4194304
[E]2019-03-01 08:31:07.741: PANIC: runtime error: index out of range, stack: goroutine 2802 [running]:
github.com/cuigh/auxo/net/web/filter.(*Recover).Apply.func2.1(0xc0000255d0, 0xc000396d00, 0xc7eca0, 0xc000360480)
/go/pkg/mod/github.com/cuigh/[email protected]/net/web/filter/recover.go:46 +0x117
panic(0xad7ee0, 0x10e7750)
/usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/cuigh/swirl/model.NewServiceInfo(0xc0003ba980, 0x19, 0x1ee24, 0x32cc0638, 0xed40ae4ae, 0x0, 0x33b59f6d, 0xed40ae4ae, 0x0, 0xc000417240, ...)
/go/src/github.com/cuigh/swirl/model/docker.go:279 +0x1b82
github.com/cuigh/swirl/biz/docker.ServiceCommand(0xc000312ded, 0xb, 0x1, 0x1, 0x1, 0x0)
/go/src/github.com/cuigh/swirl/biz/docker/service.go:604 +0x213
github.com/cuigh/swirl/controller.serviceDetail(0xc7eca0, 0xc000360480, 0xc0003cb560, 0xad2f84)
/go/src/github.com/cuigh/swirl/controller/service.go:100 +0x578
github.com/cuigh/swirl/security.Permiter.func1(0xc7eca0, 0xc000360480, 0xc702a0, 0xc0000569c0)
/go/src/github.com/cuigh/swirl/security/perm.go:30 +0xb0
github.com/cuigh/auxo/net/web/filter.(*Authorizer).Apply.func1(0xc7eca0, 0xc000360480, 0xc000360480, 0xc000312e27)
/go/pkg/mod/github.com/cuigh/[email protected]/net/web/filter/authorizer.go:74 +0x733
github.com/cuigh/auxo/net/web/filter/auth.(*Form).Apply.func1(0xc7eca0, 0xc000360480, 0xc0000255d0, 0xc000396d00)
/go/pkg/mod/github.com/cuigh/[email protected]/net/web/filter/auth/form.go:138 +0x7f
github.com/cuigh/auxo/net/web/filter.(*Recover).Apply.func2(0xc7eca0, 0xc000360480, 0x0, 0x0)
/go/pkg/mod/github.com/cuigh/[email protected]/net/web/filter/recover.go:54 +0x91
github.com/cuigh/auxo/net/web.(*Server).execute(0xc000364000, 0xc000360480, 0xc702e0, 0xc0003a6740)
/go/pkg/mod/github.com/cuigh/[email protected]/net/web/server.go:356 +0xc7
github.com/cuigh/auxo/net/web.(*Server).ServeHTTP(0xc000364000, 0xc6f320, 0xc0002ff500, 0xc00029cc00)
/go/pkg/mod/github.com/cuigh/[email protected]/net/web/server.go:317 +0x13a
net/http.serverHandler.ServeHTTP(0xc00033c8f0, 0xc6f320, 0xc0002ff500, 0xc00029cc00)
/usr/local/go/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc000286d20, 0xc6ffe0, 0xc0002fbfc0)
/usr/local/go/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2851 +0x2f5
就是指定规则在某几个机器上运行的那个参数
Hello,
I am doing a swarm deployment of Swirl. My swirl
tasks get rejected with this message: invalid mount config for type "bind": bind source path does not exist: /data/swirl
using the following compose.yml
.
version: '3.3'
services:
manager_agent:
image: cuigh/socat:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- default
logging:
driver: json-file
deploy:
mode: global
placement:
constraints:
- node.role == manager
mongo-express:
image: mongo-express:latest
environment:
ME_CONFIG_MONGODB_URL: mongodb://mongodb:27017/
ports:
- 7081:8081
networks:
- default
logging:
driver: json-file
mongodb:
image: mongo:latest
networks:
- default
logging:
driver: json-file
swirl:
image: cuigh/swirl:latest
environment:
AGENTS: swirl_manager_agent,swirl_worker_agent
DB_ADDRESS: mongodb://mongodb:27017/swirl
DB_TYPE: mongo
DOCKER_ENDPOINT: tcp://swirl_manager_agent:2375
ports:
- 8001:8001
networks:
- default
logging:
driver: json-file
deploy:
placement:
constraints:
- node.role == worker
worker_agent:
image: cuigh/socat:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- default
logging:
driver: json-file
deploy:
mode: global
placement:
constraints:
- node.role == worker
networks:
default:
driver: overlay
I also noticed there are no clear instructions on how to supply database credentials, am I going to be prompted for those in the UI once I get it running?
Thank you very much.
现在节点有点多
需要进入非swirl节点的终端还是需要到链接指定机器上 比较麻烦
I notice there is a way to import dashboards. Can we provide/supply some samples or defaults baked in?
I am a little confused by the instructions and have been unable to get this working. I am unclear if i have hit an issue, didn't read something i should have (like manually creating databases and users)?
I am trying to deploy in a swarm using mongodb, i am unclear if mongodb is in the docker image or not?
I have tried both of the following:
(note i have never used mongodb before)
for approach #1 above
panic: failed to load storage engine: no reachable servers
as such i believe there to be no mondodb server running in the container
for approach #2 above mycompose is further below, when swirl tries to connect to the mongodb it results in this if the db path ends in /swirl
panic: failed to load storage engine: server returned error on SASL authentication step: Authentication failed.
if it doesn't end in /swirl i get
panic: failed to load storage engine: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
compose file:
version: '3.8'
services:
swirl:
image: cuigh/swirl
environment:
DB_TYPE: mongo
DB_ADDRESS: mongodb://mongoroot:password@mongodb:27017/swirl
DOCKER_ENDPOINT: tcp://swirl_manager_agent:2375
AGENTS: swirl_manager_agent,swirl_worker_agent
ports:
- 8001:8001
deploy:
replicas: 1
placement:
constraints: [ node.role == worker ]
manager_agent:
image: cuigh/socat
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: global
placement:
constraints: [ node.role == manager ]
worker_agent:
image: cuigh/socat
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: global
placement:
constraints: [ node.role == worker ]
mongodb:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: mongoroot
MONGO_INITDB_ROOT_PASSWORD: password
mongo-express:
image: mongo-express
restart: always
ports:
- 7081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: mongoroot
ME_CONFIG_MONGODB_ADMINPASSWORD: password
ME_CONFIG_MONGODB_URL: mongodb://mongoroot:password@mongodb:27017/
note my mongo-express service connects with no issues to the database.
Hi,
I am getting the following message in my browser after I login to Swirl: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
Could provide my with advise or direction what I am missing or doing wrong?
Below is my docker-compose file section for starting Swirl and MongoDB:
` swirl:
image: cuigh/swirl
container_name: swirl
depends_on:
- mongo
ports:
- 8001:8001
environment:
# - DB_TYPE=bolt
- PGID=998
- DB_ADDRESS=/data/swirl
- DB_ADDRESS=mongo:27017/swirl # - DB_ADDRESS=/data/swirl
# - RESCRAMBLE=true
security_opt:
- apparmor:unconfined
- seccomp:unconfined
volumes:
- /var/run/docker.sock,dst=/var/run/docker.sock
- /var/lib/docker/:/var/lib/docker:ro
- /path/swirl/data=/data/swirl
networks:
- web
- net
deploy:
# privileged: true
mode: replicated
replicas: 1
update_config:
order: start-first # get new container running first before removing old, for less downtime
rollback_config:
order: start-first # get new container running first before removing old, for less downtime
placement:
constraints:
- node.role==manager
mongo:
image: mongo
volumes:
- /path/mongo/data:/data/db
networks:
- net
deploy:
mode: replicated
replicas: 1
update_config:
order: start-first # get new container running first before removing old, for less downtime
rollback_config:
order: start-first # get new container running first before removing old, for less downtime
Thank you in advance.
Regards,
Angelo
您好,我的swarm测试集群是1manager+2worker,
因为有--mount="type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock" ,我理解的是创建swirl服务必须在manager上执行。
想请教您一下 --constraint 'node.role == worker' 是怎么实现的?
作者你好
我们的企业用户需要自己运维docker,k8s有翻墙问题,对这个工具很感兴趣。
这是你们在生产上使用了吗?
When creating a new user without admin role, information about the password is lost, making it impossible to login.
scanario:
Create a new user by api without admin role.
/api/user/save
{
"type": "internal",
"admin": false,
"name": "Jon Doe",
"loginName": "test",
"password": "xxx",
"passwordConfirm": "xxx",
"email": "[email protected]",
"roles": [
"rolaxxx"
]
}
try logging in with your new credentials
api/user/sign-in
{"name":"test","password":"xxx"}
the response will be:
security: invalid principal or credential(1001)
[FIX] This is a fix for this case. The principle is the same as for creating a new admin account.
api/user.go:73
return func(c web.Context) error {
args := &struct {
Password string `json:"password"`
*dao.User
}{}
err := c.Bind(args, true)
if err == nil {
ctx, cancel := misc.Context(defaultTimeout)
defer cancel()
user := args.User
if user.ID == "" {
user.Password = args.Password
_, err = b.Create(ctx, user, c.User())
} else {
err = b.Update(ctx, user, c.User())
}
}
return ajax(c, err)
}
Some of us run reverse proxies with middleware that take care of authentication.
It would be nice if we could disable authentication or have a way to bypass the login.
I think LDAP would be kind of overkill for my setup to provide a somewhat unified login experience so it would be nice if I could disable the login functionality.
(maybe an option to disable the expiration of the session cookie so I can just pass it along as a request header to the host?)
就是在服务日志页面 可以看到实时日志 而不是手动刷新
类似Jenkins的构建日志那样的
I was wondering if anyone ever tried using swirl behind traefik, as I have not found a way to make it work with a base path other than /
as the ui has all the references pointing to that.
This is the traefik config I'm trying to use:
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.swirl.entrypoints=https"
- "traefik.http.routers.swirl.tls=true"
- "traefik.http.services.swirl.loadbalancer.server.port=8001"
- "traefik.http.routers.swirl.rule=PathPrefix(`/swirl`)"
- "traefik.http.routers.swirl.middlewares=swirl-stripprefix"
- "traefik.http.middlewares.swirl-stripprefix.stripprefix.prefixes=/swirl"
- "traefik.http.middlewares.swirl-stripprefix.stripprefix.forceslash=true"
I would love to run swirl on my raspberry pi's
I don't know where to configure service elastic scaling. Can you write a specific exampl?
Login less than 1 minute, prompt 401
Hi,are you consider refactor this project to separate frontend and backend?login with jwt?
i can help write the ajax backend
Hi, it's very cool project. Is it possible to implement that specific user can only see/modify his service/stacks only given permission for that user?
现在手动修改的方式太麻烦了
如果能通过Git更新就比较方便 管理也比较统一
Hello,
Did you think it's possible to extract the Scaler part as an autonomous application ??
The idea is brilliant.
Best regards
Hi! I'm trying to build this locally to hack on / contribute to but I think there's a checksum error with the docker client dependency:
prologic@Jamess-MacBook
Sat Apr 13 14:06:42
~/Contributions/swirl
(master) 0
$ go build
go: downloading github.com/docker/docker v0.0.0-20180415161252-ea579a619452
go: verifying github.com/docker/[email protected]: checksum mismatch
downloaded: h1:KXTxrc9Q8FwG8x/lbSBYzBMKn3xWpwx9MBfP1Ko7FYg=
go.sum: h1:3DHHYhTKAP1ZgL0g+msknSuFuZBA0UW6BqcAA5qsWWc=
Can you look in to this? Perhaps consider upgrading this dependency (not trivial as the library has changed some API)
@cuigh 主要是用于直接操作swirl的rest接口直接重启服务或者上下线编排
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.