【FATE】FATE单机部署全流程(使⽤Docker镜像安装FATE)Docker 容器
注意:Linux 服务器上安装 Docker 需要 root 权限,安装完成之后可以设置 Docker 组⽤户访问 Docker 的权限。
docker 18.09 -> 19.03sy
1,查看本地是否有安装过旧版 Docker
$ docker --version
2,卸载旧版本的 Docker
$ sudo apt-get remove docker docker-engine docker.io containerd runc
3,Install using the repository
有两种安装⽅式,这⾥使⽤官⽅推荐的⽅式,使⽤ Docker 仓库进⾏安装
4,Set up the repository
Update the apt package index
$ sudo apt-get update
install packages to allow apt to use a repository over HTTPS
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
Add Docker’s official GPG key
curl -fsSL download.docker/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
验证是否拥有带指纹的密钥(,好像已经失效了,先码着)
$ sudo apt-key fingerprint
set up the stable repository
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] download.docker/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5,Install Docker Engine
Update the apt package index
$ sudo apt-get update
install a specific version of Docker Engine and containerd
a,List the version available in your repo:
$ apt-cache madison docker-ce
docker-ce | 5:20.10.7~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.6~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.5~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.4~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.3~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.2~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.1~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:20.10.0~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.15~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.14~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.13~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.12~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.11~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.10~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.9~3-0~ubuntu-focal | download.docker/linux/ubuntu focal/stable amd64 Packages
b,这⾥没有需要的18.09版本,先添加阿⾥云的docker GPG密钥
$ curl -fsSL mirrors.aliyun/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
> OK
c,添加阿⾥镜像源
$ sudo add-apt-repository "deb [arch=amd64] mirrors.aliyun/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
d,再次查看版本列表
$ apt-cache madison docker-ce
e,这个时候还是没有的话,直接安装,把<VERSION_STRING>中的版本号⼿动更改⼀下试试(再不⾏就安装现有版本吧..)$ sudo apt-get install docker-ce=5:19.03.9~3-0~ubuntu-focal docker-ce-cli=5:19.03.9~3-0~ubuntu-focal containerd.io
f,Verify that Docker Engine is installed correctly by running the hello-world image
$ sudo docker run hello-world
> Hello from Docker!
> This message shows that your installation appears to be working correctly.
6,allow non-privileged users to run Docker commands
Create the docker group
$ sudo groupadd docker
Add your user to the docker group (\(USER 替换为⽤户名) `\) sudo usermod -aG docker $USER`
activate the changes to groups
$ newgrp docker
Verify that you can run docker commands without sudo
$ docker run hello-world
(可选)7,阿⾥云镜像加速
b,登录账号,获取加速器地址
c,配置加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["加速器地址"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
docker-compose 1.24.0
download the current stable release of Docker Compose (替换相应的版本号)
$ sudo curl -L "github/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose Apply executable permissions to the binary
$ sudo chmod +x /usr/local/bin/docker-compose
Test the installation
$ docker-compose --version
配置开发环境和依赖库(略)
docker进入容器JDK 1.8+
Python 3.6
Python virtualenv
MySQL 5.6+
Redis 5.0.2
...
安装 FATE
1,查询端⼝号8080,9360,9380是否被占⽤
sudo netstat -nultp | grep 9360
2,获取和解压安装包(查询 version)
$ wget qcloud/docker_standalone_fate_1.6.
$ tar -xzvf docker_standalone_fate_1.6.
3,切换⽂件夹并执⾏部署
$ cd docker_standalone_fate_1.6.0
$ bash install_standalone_docker.sh
4,验证和单元测试
$ CONTAINER_ID=`docker ps -aqf "name=fate"`
$ docker exec -t -i ${CONTAINER_ID} bash
$ bash ./python/federatedml/test/run_test.sh
> ...
> there are 0 failed test
5,Toy测试
$ python ./examples/toy_example/run_toy_example.py 10000 10000 0
> ...
> success to calculate secure_sum, it is 1999.9999999999998
6,安装 FATE-Client 和 FATE-Test
$ pip install fate-client
$ pip install fate-test
7,使⽤ FATE Board
a,规则与jupyter notebook相同那个,localhost:8080,使⽤PuTTy的隧道,并在本地浏览器打开即可b,在fate#下进⼊examples/ federatedml-1.x-examples/,执⾏python quick_run.py,查看 FATE Board进度
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论