Public Repository

Last pushed: 2 years ago
Short Description
Augmented Traffic Control in a Docker container
Full Description

docker-atc

A Dockerfile that installs the atc stack.

Installation

The easiest way to get this image is to run

docker run -it --privileged --net=host --rm atcd/atc

Building the image

If you prefer to build the image yourself:

git clone https://github.com/facebook/augmented-traffic-control.git
cd augmented-traffic-control/docker
docker build -t="${USER}/atc" .

Usage

ATC modifies the network of the host it is running on. As such, it MUST
run with the following options: --cap-add=NET_ADMIN --net=host.

There is currently 2 environment variables:

  • ATCD_WAN (default eth0)
  • ATCD_LAN (default eth1)
  • ATCD_MODE (default secure)
  • ATCD_BURST_SIZE (default 12000)
  • ATCD_OPTIONS (default empty) free form options to pass to atcd

To run atcd with the default settings:

docker run -it --cap-add=NET_ADMIN --net=host --rm atcd/atc

To change which interface to use for WAN access (internet) or LAN, you can modify
ATCD_WAN and ATCD_LAN environment variables. For example:

docker run -it --cap-add=NET_ADMIN --net=host --rm -e ATCD_LAN=wlan1 -e ATCD_WAN=em1 atcd/atc

You can then access ATC UI at:

http://docker_ip:8000
Docker Pull Command
Owner
atcd

Comments (4)
jhaoheng
a year ago

hello i can't build this image on mac osx.

docker : 1.12.1

The cmd is sudo docker run -it --privileged --network=host --rm -e ATCD_LAN=en0 -e ATCD_WAN=en4 atcd/atc

because my wan is en4(
Ethernet) and lan is en0(wifi)

error is 'One of the following interfaces does not exist'

but i am sure the network interface en0 & en4 are workable.

devinzhang
2 years ago

Yes,搞定了,使用命令:sudo docker run -it --privileged --net=host --rm -e ATCD_LAN=wlan0 -e ATCD_WAN=eth0 atcd/atc即可

devinzhang
2 years ago

详细错误输出日志:
sudo docker run -it --privileged --net=host --rm atcd/atc
/usr/local/lib/python2.7/site-packages/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
'Supervisord is running as root and it is searching '
2015-09-16 12:57:49,060 CRIT Supervisor running as root (no user in config file)
2015-09-16 12:57:49,091 INFO RPC interface 'supervisor' initialized
2015-09-16 12:57:49,091 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-09-16 12:57:49,091 INFO supervisord started with pid 6
2015-09-16 12:57:50,093 INFO spawned: 'stdout' with pid 9
2015-09-16 12:57:50,095 INFO spawned: 'atcui' with pid 10
2015-09-16 12:57:50,097 INFO spawned: 'atcd' with pid 11
2015-09-16 12:57:50,099 INFO spawned: 'rsyslogd' with pid 12
2015-09-16 12:57:51,583 INFO success: stdout entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-09-16 12:57:51,584 INFO success: atcui entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-09-16 12:57:51,584 INFO success: atcd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-09-16 12:57:51,584 INFO success: rsyslogd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
rsyslogd stderr | rsyslogd: Could not open output pipe '/dev/xconsole': No such file or directory [try http://www.rsyslog.com/e/2039 ]
atcd stderr | INFO:AtcdVService.AtcdNBServerTask:AtcdNBServerTask Server Started on 127.0.0.1:9090
atcd stderr | CRITICAL:AtcdVService.AtcdLinuxShaper:One of the following interfaces does not exist: eth1, eth0
atcd stderr | ERROR:sparts.tasks:Error creating task, AtcdLinuxShaper
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/sparts/vtask.py", line 313, in init
t.initTask()
File "/usr/local/lib/python2.7/site-packages/atcd/backends/linux.py", line 48, in initTask
super(AtcdLinuxShaper, self).initTask()
File "/usr/local/lib/python2.7/site-packages/atcd/AtcdThriftHandlerTask.py", line 227, in initTask
self._links_lookup()
File "/usr/local/lib/python2.7/site-packages/atcd/backends/linux.py", line 65, in _links_lookup
raise Exception(msg)
Exception: One of the following interfaces does not exist: eth1, eth0
atcd stderr | ERROR:AtcdVService:Unexpected Exception during init
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/sparts/vservice.py", line 268, in _runloop
instance._createTasks()
File "/usr/local/lib/python2.7/site-packages/sparts/vservice.py", line 167, in _createTasks
self.tasks.init()
File "/usr/local/lib/python2.7/site-packages/sparts/vtask.py", line 332, in init
len(exceptions))
Exception: Unable to start service (1 task start errors)
atcd stderr | INFO:AtcdVService:Received graceful shutdown request
DEBUG:AtcdVService:VService Active. Awaiting graceful shutdown.
atcd stderr | INFO:AtcdVService:Waiting for tasks to shutdown gracefully...
atcd stderr | DEBUG:AtcdVService:Waiting for <atcd.AtcdDeviceTimeoutTask.AtcdDeviceTimeoutTask object at 0x7ff7632318d0> to stop...
atcd stderr | DEBUG:AtcdVService:Waiting for <atcd.backends.linux.AtcdLinuxShaper object at 0x7ff7632316d0> to stop...
atcd stderr | DEBUG:AtcdVService:Waiting for <atcd.AtcdDBQueueTask.AtcdDBQueueTask object at 0x7ff763231650> to stop...
atcd stderr | DEBUG:AtcdVService:Waiting for <atcd.AtcdThriftHandlerTask.AtcdNBServerTask object at 0x7ff7632315d0> to stop...
atcd stderr | INFO:AtcdVService:Instance shut down gracefully
2015-09-16 12:57:52,306 INFO exited: atcd (exit status 0; expected)

devinzhang
2 years ago

楼主,你好,谢谢你共享了ATC镜像,我这边按照你的使用文档,结果:2015-09-16 12:57:52,306 INFO exited: atcd (exit status 0; expected),你知道是什么原因吗
,我使用的是最新1.82的Docker