microsoft / CyberBattleSim

An experimentation and research platform to investigate the interaction of automated agents in an abstract simulated network environments.
MIT License
1.66k stars 261 forks source link

NPM Depends Errors & RuntimeWarning: Mean of empty slice. #1

Closed kevthehermit closed 3 years ago

kevthehermit commented 3 years ago

Using Ubuntu 20.04.2 LTS on AWS

Linux ip-172-31-9-167 5.4.0-1038-aws #40-Ubuntu SMP Fri Feb 5 23:50:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Running ./init.sh -n to use a global install.

there are a lot of NPM errors during the installation

pyright 1.1.130
Installing the Plotly orca dependency for plotly figure export
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 npm : Depends: nodejs (>= 6.11~)
       Depends: node-abbrev (>= 1.1.1~) but it is not going to be installed
       Depends: node-ajv but it is not going to be installed
       Depends: node-ansi but it is not going to be installed
       Depends: node-ansi-regex (>= 3.0~) but it is not going to be installed
       Depends: node-ansi-styles but it is not going to be installed
       Depends: node-ansistyles but it is not going to be installed
       Depends: node-aproba but it is not going to be installed
       Depends: node-archy (>= 1.0~) but it is not going to be installed
       Depends: node-are-we-there-yet but it is not going to be installed
       Depends: node-asap but it is not going to be installed
       Depends: node-asn1 but it is not going to be installed
       Depends: node-assert-plus but it is not going to be installed
       Depends: node-asynckit but it is not going to be installed
       Depends: node-aws4 but it is not going to be installed
       Depends: node-aws-sign2 but it is not going to be installed
       Depends: node-balanced-match but it is not going to be installed
       Depends: node-bcrypt-pbkdf but it is not going to be installed
       Depends: node-bl but it is not going to be installed
       Depends: node-bluebird but it is not going to be installed
       Depends: node-boxen but it is not going to be installed
       Depends: node-brace-expansion but it is not going to be installed
       Depends: node-builtin-modules but it is not going to be installed
       Depends: node-builtins but it is not going to be installed
       Depends: node-cacache but it is not going to be installed
       Depends: node-call-limit but it is not going to be installed
       Depends: node-camelcase but it is not going to be installed
       Depends: node-caseless but it is not going to be installed
       Depends: node-chalk but it is not going to be installed
       Depends: node-chownr but it is not going to be installed
       Depends: node-ci-info but it is not going to be installed
       Depends: node-cli-boxes but it is not going to be installed
       Depends: node-cliui but it is not going to be installed
       Depends: node-clone but it is not going to be installed
       Depends: node-co but it is not going to be installed
       Depends: node-color-convert but it is not going to be installed
       Depends: node-color-name but it is not going to be installed
       Depends: node-colors but it is not going to be installed
       Depends: node-columnify but it is not going to be installed
       Depends: node-combined-stream but it is not going to be installed
       Depends: node-concat-map but it is not going to be installed
       Depends: node-concat-stream but it is not going to be installed
       Depends: node-config-chain but it is not going to be installed
       Depends: node-configstore but it is not going to be installed
       Depends: node-console-control-strings but it is not going to be installed
       Depends: node-copy-concurrently but it is not going to be installed
       Depends: node-core-util-is but it is not going to be installed
       Depends: node-cross-spawn but it is not going to be installed
       Depends: node-crypto-random-string but it is not going to be installed
       Depends: node-cyclist but it is not going to be installed
       Depends: node-dashdash but it is not going to be installed
       Depends: node-debug but it is not going to be installed
       Depends: node-decamelize but it is not going to be installed
       Depends: node-deep-extend but it is not going to be installed
       Depends: node-defaults but it is not going to be installed
       Depends: node-define-properties but it is not going to be installed
       Depends: node-delayed-stream but it is not going to be installed
       Depends: node-delegates but it is not going to be installed
       Depends: node-detect-indent but it is not going to be installed
       Depends: node-detect-newline but it is not going to be installed
       Depends: node-dot-prop but it is not going to be installed
       Depends: node-duplexer3 but it is not going to be installed
       Depends: node-duplexify but it is not going to be installed
       Depends: node-ecc-jsbn but it is not going to be installed
       Depends: node-editor but it is not going to be installed
       Depends: node-encoding but it is not going to be installed
       Depends: node-end-of-stream but it is not going to be installed
       Depends: node-err-code but it is not going to be installed
       Depends: node-errno but it is not going to be installed
       Depends: node-es6-promise but it is not going to be installed
       Depends: node-escape-string-regexp but it is not going to be installed
       Depends: node-execa but it is not going to be installed
       Depends: node-extend but it is not going to be installed
       Depends: node-extsprintf but it is not going to be installed
       Depends: node-fast-deep-equal but it is not going to be installed
       Depends: node-find-up but it is not going to be installed
       Depends: node-flush-write-stream but it is not going to be installed
       Depends: node-forever-agent but it is not going to be installed
       Depends: node-form-data but it is not going to be installed
       Depends: node-from2 but it is not going to be installed
       Depends: node-fs.realpath but it is not going to be installed
       Depends: node-fs-vacuum but it is not going to be installed
       Depends: node-fs-write-stream-atomic but it is not going to be installed
       Depends: node-function-bind but it is not going to be installed
       Depends: node-gauge but it is not going to be installed
       Depends: node-genfun but it is not going to be installed
       Depends: node-get-caller-file but it is not going to be installed
       Depends: node-getpass but it is not going to be installed
       Depends: node-glob (>= 7.1.2~) but it is not going to be installed
       Depends: node-got but it is not going to be installed
       Depends: node-graceful-fs (>= 4.1.11~) but it is not going to be installed
       Depends: node-gyp (>= 3.6.2~) but it is not going to be installed
       Depends: node-har-schema but it is not going to be installed
       Depends: node-har-validator but it is not going to be installed
       Depends: node-has-flag but it is not going to be installed
       Depends: node-has-unicode but it is not going to be installed
       Depends: node-hosted-git-info (>= 2.6~) but it is not going to be installed
       Depends: node-http-signature but it is not going to be installed
       Depends: node-iconv-lite but it is not going to be installed
       Depends: node-iferr but it is not going to be installed
       Depends: node-import-lazy but it is not going to be installed
       Depends: node-imurmurhash but it is not going to be installed
       Depends: node-inflight but it is not going to be installed
       Depends: node-inherits (>= 2.0.3~) but it is not going to be installed
       Depends: node-ini (>= 1.3.5~) but it is not going to be installed
       Depends: node-invert-kv but it is not going to be installed
       Depends: node-ip but it is not going to be installed
       Depends: node-ip-regex but it is not going to be installed
       Depends: node-isarray but it is not going to be installed
       Depends: node-isexe but it is not going to be installed
       Depends: node-is-npm but it is not going to be installed
       Depends: node-is-obj but it is not going to be installed
       Depends: node-is-path-inside but it is not going to be installed
       Depends: node-is-retry-allowed but it is not going to be installed
       Depends: node-is-stream but it is not going to be installed
       Depends: node-isstream but it is not going to be installed
       Depends: node-is-typedarray but it is not going to be installed
       Depends: node-jsbn but it is not going to be installed
       Depends: node-jsonparse but it is not going to be installed
       Depends: node-json-parse-better-errors but it is not going to be installed
       Depends: node-json-schema but it is not going to be installed
       Depends: node-json-schema-traverse but it is not going to be installed
       Depends: node-jsonstream (>= 1.3.2~) but it is not going to be installed
       Depends: node-json-stringify-safe but it is not going to be installed
       Depends: node-jsprim but it is not going to be installed
       Depends: node-latest-version but it is not going to be installed
       Depends: node-lazy-property but it is not going to be installed
       Depends: node-lcid but it is not going to be installed
       Depends: node-libnpx but it is not going to be installed
       Depends: node-locate-path but it is not going to be installed
       Depends: node-lodash but it is not going to be installed
       Depends: node-lockfile (>= 1.0.3~) but it is not going to be installed
       Depends: node-lowercase-keys but it is not going to be installed
       Depends: node-lru-cache (>= 4.1.1~) but it is not going to be installed
       Depends: node-make-dir but it is not going to be installed
       Depends: node-mem but it is not going to be installed
       Depends: node-mime but it is not going to be installed
       Depends: node-mime-types but it is not going to be installed
       Depends: node-mimic-fn but it is not going to be installed
       Depends: node-minimatch but it is not going to be installed
       Depends: node-minimist but it is not going to be installed
       Depends: node-mississippi but it is not going to be installed
       Depends: node-mkdirp (>= 0.5.1~) but it is not going to be installed
       Depends: node-move-concurrently but it is not going to be installed
       Depends: node-ms but it is not going to be installed
       Depends: node-mute-stream but it is not going to be installed
       Depends: node-nopt but it is not going to be installed
       Depends: node-normalize-package-data (>= 2.4~) but it is not going to be installed
       Depends: node-npm-bundled but it is not going to be installed
       Depends: node-npm-package-arg (>= 6.1.1) but it is not going to be installed
       Depends: node-npmlog (>= 4.1.2~) but it is not going to be installed
       Depends: node-number-is-nan but it is not going to be installed
       Depends: node-oauth-sign but it is not going to be installed
       Depends: node-object-assign but it is not going to be installed
       Depends: node-once (>= 1.4~) but it is not going to be installed
       Depends: node-opener but it is not going to be installed
       Depends: node-osenv (>= 0.1.5~) but it is not going to be installed
       Depends: node-os-locale but it is not going to be installed
       Depends: node-os-tmpdir but it is not going to be installed
       Depends: node-package-json but it is not going to be installed
       Depends: node-parallel-transform but it is not going to be installed
       Depends: node-path-exists but it is not going to be installed
       Depends: node-path-is-absolute but it is not going to be installed
       Depends: node-path-is-inside but it is not going to be installed
       Depends: node-promise-inflight but it is not going to be installed
       Depends: node-promise-retry but it is not going to be installed
       Depends: node-promzard but it is not going to be installed
       Depends: node-performance-now but it is not going to be installed
       Depends: node-p-finally but it is not going to be installed
       Depends: node-p-is-promise but it is not going to be installed
       Depends: node-pify but it is not going to be installed
       Depends: node-p-limit but it is not going to be installed
       Depends: node-p-locate but it is not going to be installed
       Depends: node-prepend-http but it is not going to be installed
       Depends: node-process-nextick-args but it is not going to be installed
       Depends: node-proto-list but it is not going to be installed
       Depends: node-prr but it is not going to be installed
       Depends: node-pseudomap but it is not going to be installed
       Depends: node-psl but it is not going to be installed
       Depends: node-pump but it is not going to be installed
       Depends: node-pumpify but it is not going to be installed
       Depends: node-punycode but it is not going to be installed
       Depends: node-qs but it is not going to be installed
       Depends: node-qw but it is not going to be installed
       Depends: node-rc but it is not going to be installed
       Depends: node-read (>= 1.0.7~) but it is not going to be installed
       Depends: node-readable-stream but it is not going to be installed
       Depends: node-read-package-json (>= 2.0.13~) but it is not going to be installed
       Depends: node-registry-auth-token but it is not going to be installed
       Depends: node-registry-url but it is not going to be installed
       Depends: node-request (>= 2.83~) but it is not going to be installed
       Depends: node-require-main-filename but it is not going to be installed
       Depends: node-require-directory but it is not going to be installed
       Depends: node-resolve-from (>= 4.0~) but it is not going to be installed
       Depends: node-retry (>= 0.10.1~) but it is not going to be installed
       Depends: node-rimraf (>= 2.6.2~) but it is not going to be installed
       Depends: node-run-queue but it is not going to be installed
       Depends: node-safe-buffer but it is not going to be installed
       Depends: node-semver (>= 5.5~) but it is not going to be installed
       Depends: node-set-blocking but it is not going to be installed
       Depends: node-sha (>= 2.0.1~) but it is not going to be installed
       Depends: node-shebang-command but it is not going to be installed
       Depends: node-shebang-regex but it is not going to be installed
       Depends: node-signal-exit but it is not going to be installed
       Depends: node-slide (>= 1.1.6~) but it is not going to be installed
       Depends: node-sorted-object but it is not going to be installed
       Depends: node-slash but it is not going to be installed
       Depends: node-semver-diff but it is not going to be installed
       Depends: node-spdx-correct but it is not going to be installed
       Depends: node-spdx-exceptions but it is not going to be installed
       Depends: node-spdx-expression-parse but it is not going to be installed
       Depends: node-spdx-license-ids but it is not going to be installed
       Depends: node-sshpk but it is not going to be installed
       Depends: node-ssri but it is not going to be installed
       Depends: node-stream-each but it is not going to be installed
       Depends: node-stream-iterate but it is not going to be installed
       Depends: node-stream-shift but it is not going to be installed
       Depends: node-strict-uri-encode but it is not going to be installed
       Depends: node-string-decoder but it is not going to be installed
       Depends: node-string-width but it is not going to be installed
       Depends: node-strip-ansi (>= 4.0~) but it is not going to be installed
       Depends: node-strip-json-comments but it is not going to be installed
       Depends: node-strip-eof but it is not going to be installed
       Depends: node-supports-color but it is not going to be installed
       Depends: node-tar (>= 4.4~) but it is not going to be installed
       Depends: node-term-size but it is not going to be installed
       Depends: node-text-table but it is not going to be installed
       Depends: node-through but it is not going to be installed
       Depends: node-through2 but it is not going to be installed
       Depends: node-timed-out but it is not going to be installed
       Depends: node-tough-cookie but it is not going to be installed
       Depends: node-tunnel-agent but it is not going to be installed
       Depends: node-tweetnacl but it is not going to be installed
       Depends: node-typedarray but it is not going to be installed
       Depends: node-uid-number but it is not going to be installed
       Depends: node-unique-filename but it is not going to be installed
       Depends: node-unique-string but it is not going to be installed
       Depends: node-unpipe but it is not going to be installed
       Depends: node-url-parse-lax but it is not going to be installed
       Depends: node-util-deprecate but it is not going to be installed
       Depends: node-uuid but it is not going to be installed
       Depends: node-validate-npm-package-name but it is not going to be installed
       Depends: node-verror but it is not going to be installed
       Depends: node-which (>= 1.3~) but it is not going to be installed
       Depends: node-which-module but it is not going to be installed
       Depends: node-wide-align but it is not going to be installed
       Depends: node-widest-line but it is not going to be installed
       Depends: node-wrap-ansi but it is not going to be installed
       Depends: node-wrappy but it is not going to be installed
       Depends: node-wcwidth.js but it is not going to be installed
       Depends: node-write-file-atomic but it is not going to be installed
       Depends: node-xdg-basedir but it is not going to be installed
       Depends: node-xtend but it is not going to be installed
       Depends: node-yargs but it is not going to be installed
       Depends: node-yargs-parser but it is not going to be installed
       Depends: node-yallist but it is not going to be installed
       Depends: node-y18n but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

changed 287 packages, and audited 288 packages in 9s

And then trying to run the example test

/CyberBattleSim$ 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
torch cuda available=False
###### DQL
Learning with: episode_count=1,iteration_count=10,ϵ=0.9,ϵ_min=0.1, ϵ_expdecay=5000,γ=0.015, lr=0.01, replaymemory=10000,
batch=512, target_update=10
  ## Episode: 1/1 'DQL' ϵ=0.9000, γ=0.015, lr=0.01, replaymemory=10000,
batch=512, target_update=10
Episode 1|Iteration 10|reward:  139.0|Elapsed Time: 0:00:00|##################|
  Episode 1 stopped at t=10 
  Breakdown [Reward/NoReward (Success rate)]
    explore-local: 1/1 (0.50)
    explore-remote: 2/5 (0.29)
    explore-connect: 0/1 (0.00)
    exploit-local: 0/0 (NaN)
    exploit-remote: 0/0 (NaN)
    exploit-connect: 0/0 (NaN)
  exploit deflected to exploration: 2
simulation ended
###### Random search
Learning with: episode_count=1,iteration_count=10,ϵ=1.0,ϵ_min=0.0, 
  ## Episode: 1/1 'Random search' ϵ=1.0000, 
Episode 1|Iteration 10|reward:   94.0|Elapsed Time: 0:00:00|##################|
  Episode 1 stopped at t=10 
  Breakdown [Reward/NoReward (Success rate)]
    explore-local: 1/1 (0.50)
    explore-remote: 1/4 (0.20)
    explore-connect: 0/3 (0.00)
    exploit-local: 0/0 (NaN)
    exploit-remote: 0/0 (NaN)
    exploit-connect: 0/0 (NaN)
  exploit deflected to exploration: 0
simulation ended
Episode duration -- DQN=Red, Random=Green
   10.00  ┼
Cumulative rewards -- DQN=Red, Random=Green
/home/ubuntu/.local/lib/python3.8/site-packages/numpy/lib/function_base.py:380: RuntimeWarning: Mean of empty slice.
  avg = a.mean(axis)
/home/ubuntu/.local/lib/python3.8/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
  139.00  ┼     ╭───╴
  125.10  ┤     │
  111.20  ┤     │
   97.30  ┤  ╭──╯╭──╴
   83.40  ┤  │   │
   69.50  ┤  │   │
   55.60  ┼──╭───╯
   41.70  ┤  │
   27.80  ┤  │
   13.90  ┤  │
    0.00  ┤──╯
blumu commented 3 years ago

@kevthehermit I could not repro but with #11 npm got upgraded to version 16 so I wonder if it fixes your problem? Also now that docker build is fixed you might have better luck running it directly within a docker container.

blumu commented 3 years ago

@kevthehermit Closing the issue for now. Feel free to reopen if PR #11 did not resolve the issue.