Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/CyberBattleSim
Path: blob/main/notebooks/run_quick.sh
597 views
1
# Run all the Jupyter notebooks in quick test mode (small number of iteartions and episodes) and write the output to disk
2
3
set -ex
4
5
kernel=$1
6
if [ -z "$kernel" ]; then
7
kernel=cybersim
8
fi
9
10
script_dir=$(dirname "$0")
11
12
pushd "$script_dir/.."
13
14
output_dir=notebooks/output/quick
15
output_plot_dir=$output_dir/plots
16
17
run () {
18
base=$1
19
suffix=$2
20
cat notebook notebooks/$base.py \
21
| jupytext --to ipynb - \
22
| papermill --kernel $kernel $output_dir/$base$suffix.ipynb "${@:3}"
23
}
24
25
jupyter kernelspec list
26
27
mkdir $output_dir -p
28
mkdir $output_plot_dir -p
29
30
# run c2_interactive_interface '' # disabled: not deterministic and can fail
31
32
# run random_active_directory '' # disabled: not deterministic and can fail
33
34
run toyctf-blank ''
35
36
run toyctf-random ''
37
38
run toyctf-solved ''
39
40
run chainnetwork-optionwrapper ''
41
42
run chainnetwork-random '' -y "
43
iterations: 100
44
"
45
run randomnetwork ''
46
47
run notebook_benchmark '-chain' -y "
48
gymid: 'CyberBattleChain-v0'
49
iteration_count: 100
50
training_episode_count: 5
51
eval_episode_count: 3
52
maximum_node_count: 12
53
maximum_total_credentials: 7
54
plots_dir: $output_plot_dir
55
"
56
57
run notebook_benchmark '-toyctf' -y "
58
gymid: 'CyberBattleToyCtf-v0'
59
env_size: null
60
iteration_count: 100
61
training_episode_count: 3
62
eval_episode_count: 5
63
maximum_node_count: 12
64
maximum_total_credentials: 10
65
plots_dir: $output_plot_dir
66
"
67
68
run notebook_benchmark '-tiny' -y "
69
gymid: 'CyberBattleTiny-v0'
70
env_size: null
71
iteration_count: 100
72
training_episode_count: 4
73
eval_episode_count: 2
74
maximum_node_count: 5
75
maximum_total_credentials: 3
76
plots_dir: $output_plot_dir
77
"
78
79
run notebook_dql_transfer '' -y "
80
iteration_count: 500
81
training_episode_count: 5
82
eval_episode_count: 3
83
plots_dir: $output_plot_dir
84
"
85
86
run notebook_randlookups '' -y "
87
iteration_count: 500
88
training_episode_count: 5
89
eval_episode_count: 2
90
plots_dir: $output_plot_dir
91
"
92
93
run notebook_tabularq '' -y "
94
iteration_count: 200
95
training_episode_count: 5
96
eval_episode_count: 2
97
plots_dir: $output_plot_dir
98
"
99
100
run notebook_withdefender '' -y "
101
iteration_count: 100
102
training_episode_count: 3
103
plots_dir: $output_plot_dir
104
"
105
106
run dql_active_directory '' -y "
107
ngyms: 3
108
iteration_count: 50
109
"
110
111
popd
112
113