forked from fluentpython/example-code
- 需要启动
docker
服务,并且安装docker-compose
工具
git clone https://github.com/korewayume/DemoFlagsServer.git
cd DemoFlagsServer/containers
unzip flags.zip
docker-compose up -d
部署完成会启动三个容器 Nginx Vaurien-DELAY Vaurien-ERROR
将test_scripts/flags2_common.py
代码中的vmware
替换为docker daemon宿主机的hostname或者ip
SERVERS = {
'REMOTE': 'http://flupy.org/data/flags',
'LOCAL': 'http://vmware:8001/flags',
'DELAY': 'http://vmware:8002/flags',
'ERROR': 'http://vmware:8003/flags',
}
python3 test_scripts/flags2_threadpool.py -s LOCAL
python3 test_scripts/flags2_threadpool.py -s DELAY
python3 test_scripts/flags2_threadpool.py -s ERROR
- 需要当前路径下存在
downloads
目录