CyberBattleSim安装

Linux手动安装

环境

项目主页:https://github.com/microsoft/CyberBattleSim
基于Ubuntu 20.04的docker镜像构建

miniconda

文档推荐的好像是python3.8,所以从清华源 - miniconda下载,并安装

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh
chmod +x Miniconda3-py38_4.9.2-Linux-x86_64.sh
./Miniconda3-py38_4.9.2-Linux-x86_64.sh

根据使用的shell初始化conda,安装过程会默认初始化bash,如果使用zsh需要手动初始化./miniconda3/bin/conda init zsh

初始化以后重新打开shell,前面会有base,我是直接在base环境装的,如果需要一个新的环境自己conda新建一个

修改了一下pip源为清华源,为了pip快一点pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

CyberBattleSim

下载CyberBattleSim

进入CyberBattleSim项目目录

执行

python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -e .
pip install -r requirements.dev.txt

最后一条命令会报错,ERROR: Could not find a version that satisfies the requirement data-science-types (unavailable)

我的解决方案是在requirements.dev.txt文件中注释掉data-science-types @ git+https://github.com/blumu/data-science-types/@blumu-patch-1,并把data-science-types~=0.2.20取消注释。然后重新运行最后一条命令。

测试

执行:python cyberbattle/agents/baseline/run.py --training_episode_count 1 --eval_episode_count 1 --iteration_count 10 --rewardplot_with 80 --chain_size=20 --ownership_goal 1.0

结果:
在这里插入图片描述

Docker

环境

要求有azurecr.io的账号

使用构建好的镜像

commit=7c1f8c80bc53353937e3c69b0f5f799ebb2b03ee
docker login spinshot.azurecr.io
docker pull spinshot.azurecr.io/cyberbattle:$commit
docker run -it spinshot.azurecr.io/cyberbattle:$commit cyberbattle/agents/baseline/run.py

手动构建

下载CyberBattleSim并切入项目目录

docker build -t CyberBattleSim:v1 .

根据测试构建完毕的镜像运行测试会有问题,扔需要手动安装部分依赖,比如torch之类的

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苏打呀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值