Dyana is a sandbox environment using Docker and Tracee for loading, running and profiling a wide range of files, including machine learning models, ELF executables, Pickle serialized files, Javascripts and more. It provides detailed insights into GPU memory usage, filesystem interactions, network requests, and security related events.
- Python 3.10+ with PIP.
- Docker
- Optional: a GNU/Linux machine with CUDA for GPU memory tracing support.
Install with:
pip install dyana
To upgrade to the latest version, run:
pip install --upgrade dyana
To uninstall, run:
pip uninstall dyana
Create a trace file for a given loader with:
dyana trace --loader automodel ... --output trace.json
By default, Dyana will not allow network access to the model container. If you need to allow it, you can pass the --allow-network
flag:
dyana trace ... --allow-network
Show a summary of the trace file with:
dyana summary --trace-path trace.json
Dyana provides a set of loaders for different types of files, each loader has a dedicated set of arguments and will be executed in an isolated, offline by default container.
To see the available loaders and their scriptions, run dyana loaders
.
The default loader for machine learning models. It will load any model that is compatible with AutoModel and AutoTokenizer.
dyana trace --loader automodel --model /path/to/model --input "This is an example sentence."
# automodel is the default loader, so this is equivalent to:
dyana trace --model /path/to/model --input "This is an example sentence."
# in case the model requires extra dependencies, you can pass them as:
dyana trace --model tohoku-nlp/bert-base-japanese --input "This is an example sentence." --extra-requirements "protobuf fugashi ipadic"
This loader will load an ELF file and run it.
dyana trace --loader elf --elf /path/to/linux_executable
# depending on the ELF file and the host computer, you might need to specify a different platform:
dyana trace --loader elf --elf /path/to/linux_executable --platform linux/amd64
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader elf --elf /path/to/linux_executable --allow-network
This loader will load a Pickle serialized file.
dyana trace --loader pickle --pickle /path/to/file.pickle
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader pickle --pickle /path/to/file.pickle --allow-network
This loader will load a Python file and run it.
dyana trace --loader python --script /path/to/file.py
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader python --script /path/to/file.py --allow-network
This loader will load a Javascript file and run it via NodeJS.
dyana trace --loader js --script /path/to/file.js
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader js --script /path/to/file.js --allow-network
Dyana is released under the MIT license. Tracee is released under the Apache 2.0 license.