hitsz-ids / duetector

duetector🔍: Data Usage Extensible Detector for data usage observability.
https://dataucon.idslab.io/
Apache License 2.0
10 stars 8 forks source link

dependency issues when starting using duectl #95

Closed Guo-Yunzhe closed 1 year ago

Guo-Yunzhe commented 1 year ago

Description

First, I installed it according to the command

pip install duetector

in the readme.md this step performed normally.

When using the

sudo duectl start

command to start, it prompts:

ModuleNotFoundError: No module named 'bcc'

Reproduce

  1. run pip install duetector
  2. run sudo duectl start

Expected behavior

It shows :

  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/duetector/monitors/bcc_monitor.py", line 66, in init
    from bcc import BPF  # noqa
ModuleNotFoundError: No module named 'bcc'
(base) ➜  git_DIR 

Context

Error message
Paste complete error message, logs, or stack traces here.
(base) ➜  git_DIR sudo duectl start
Password:
2023-11-03 10:38:37.271 | INFO     | duetector.config:generate_config:93 - Creating default config file /Users/user_name/.config/duetector/config.toml
2023-11-03 10:38:37.272 | INFO     | duetector.config:load_config:114 - Loading config from /Users/user_name/.config/duetector/config.toml
2023-11-03 10:38:37.273 | INFO     | duetector.config:load_env_config:145 - Loading config from environment variables, prefix: `DUETECTOR_`, sep: `__`
2023-11-03 10:38:37.274 | INFO     | duetector.config:dump_config:170 - Current config has been dumped to /private/tmp/duetector_config.toml.31588
2023-11-03 10:38:37.413 | INFO     | duetector.managers.collector:init:63 - Collector DequeCollector is disabled
Traceback (most recent call last):
  File "/Users/user_name/opt/anaconda3/bin/duectl", line 8, in <module>
    sys.exit(cli())
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/duetector/cli/main.py", line 159, in start
    monitors.append(BccMonitor(c))
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/duetector/monitors/bcc_monitor.py", line 58, in __init__
    self.init()
  File "/Users/user_name/opt/anaconda3/lib/python3.9/site-packages/duetector/monitors/bcc_monitor.py", line 66, in init
    from bcc import BPF  # noqa
ModuleNotFoundError: No module named 'bcc'
(base) ➜  git_DIR 
Configuration
Paste the contents of your configuration file here.
Additional context
Add any other context about the problem here.
wunder957 commented 1 year ago

Dependency issue

There is no distribution of bcc, you need to compile it yourself.

Currently, the code relies on BCC for on-the-fly compilation of eBPF code, we recommend installing the latest BCC compiler

Works on mac? No, but...

eBPF (and includes bcc of course) does not yet work on macos, and you may use a vm to run Linux on your mac.

Which Linux distribution is recommended?

As far as I know, it works well on Ubuntu 22.04 and ArchLinux. A newer Linux kernel is recommended, as described in here

We provide a compiled image based on Ubuntu 22.04, so you may try it directly.

Or use the Docker image that we provide, which uses JupyterLab as the example user application, or you can modify the Dockerfile and startup script to customize the user application.

docker pull dataucon/duetector:latest