mintproject / mic

Model Insertion Checker
https://mic-cli.readthedocs.io/en/latest/
5 stars 3 forks source link

Trace not working in docker #243

Closed Cmheidelberg closed 4 years ago

Cmheidelberg commented 4 years ago

Describe the bug After I start mic and run the trace command from within docker it fails with a ImportError.

root@b8867836cd65:/tmp/mint# mic encapsulate trace ./addtoarray.sh 5
Traceback (most recent call last):
  File "/usr/local/bin/mic", line 5, in <module>
    from mic.__main__ import cli
  File "/usr/local/lib/python3.6/dist-packages/mic/__main__.py", line 9, in <module>
    from mic.click_encapsulate.commands import start, trace, configs, add_parameters, inputs, outputs, run, publish, wrapper
  File "/usr/local/lib/python3.6/dist-packages/mic/click_encapsulate/commands.py", line 12, in <module>
    from mic.component.executor import build_docker, copy_code_to_src, compress_directory, execute_local
ImportError: cannot import name 'build_docker'

It looks like the mic image docker uses (By default 0.4.4 according to pip) is trying to import build_docker from component.executor instead of publisher.docker

Solution The version of mic downloaded in docker should be the most recent by default

To Reproduce

  1. cd to model's directory
  2. mic encapsulate start
  3. mic encapsulate trace crash

Desktop (please complete the following information):

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

mosoriob commented 4 years ago

I couldn't reproduce it

mic encapsulate trace ping -c 5 google.com
WARNING: You are using mic version 0.4.4, however version 1.1.0 is available.
You should consider upgrading via the 'pip install --upgrade mic' command.
Trace directory .reprozip-trace exists
(a)ppend run to the trace, (d)elete it or (s)top? [a/d/s] d
2020-07-09 22:42:39,227 reprozip     WARNING  You can use --overwrite to replace the existing trace (or --continue to append
without prompt)
2020-07-09 22:42:39,228 reprozip     INFO     Running program
2020-07-09 22:42:39,230 reprozip     INFO     child created, pid=38
2020-07-09 22:42:39,248 reprozip     INFO     process 38 created by initial fork()
2020-07-09 22:42:39,249 reprozip     INFO     1 processes (inc. 0 unattached)
2020-07-09 22:42:39,260 reprozip     INFO     [38] successfully exec'd /bin/ping
2020-07-09 22:42:39,261 reprozip     INFO     [38] binary has set-uid bit set, not a problem because it is owned by our user
2020-07-09 22:42:39,340 reprozip     INFO     [38] process connected to 192.168.65.1:53
2020-07-09 22:42:39,367 reprozip     INFO     [38] process connected to <unknown destination, sa_family=0>
2020-07-09 22:42:39,369 reprozip     INFO     [38] process connected to 172.217.5.78:0
2020-07-09 22:42:39,373 reprozip     INFO     [38] process connected to 172.217.5.78:1025
PING google.com (172.217.5.78) 56(84) bytes of data.
2020-07-09 22:42:39,415 reprozip     INFO     [38] process connected to 192.168.65.1:53
64 bytes from lax17s15-in-f78.1e100.net (172.217.5.78): icmp_seq=1 ttl=37 time=17.4 ms
64 bytes from lax17s15-in-f78.1e100.net (172.217.5.78): icmp_seq=2 ttl=37 time=14.1 ms
64 bytes from lax17s15-in-f78.1e100.net (172.217.5.78): icmp_seq=3 ttl=37 time=17.1 ms
64 bytes from lax17s15-in-f78.1e100.net (172.217.5.78): icmp_seq=4 ttl=37 time=16.4 ms
64 bytes from lax17s15-in-f78.1e100.net (172.217.5.78): icmp_seq=5 ttl=37 time=11.9 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 37ms
rtt min/avg/max/mdev = 11.940/15.384/17.360/2.068 ms
2020-07-09 22:42:43,437 reprozip     INFO     [38] process exited (code 0), 0 processes remain
2020-07-09 22:42:43,459 reprozip     INFO     Program completed
2020-07-09 22:42:43,563 reprozip     INFO     Running filter plugin builtin
2020-07-09 22:42:43,567 reprozip     INFO     Running filter plugin python
2020-07-09 22:42:43,585 reprozip     INFO     Identifying Debian packages for 30 files...
2020-07-09 22:42:43,781 reprozip     INFO     8 packages with 23 files, and 7 other files
Configuration file written in .reprozip-trace/config.yml
Edit that file then run the packer -- use 'reprozip pack -h' for help
[]
Cmheidelberg commented 4 years ago

@Maximiliano maybe it is because my docker container mic start makes is the one without dependencies?