google / shipshape

Program analysis platform
Apache License 2.0
271 stars 35 forks source link

External analyzers can't run if one was run previously #105

Open clconway opened 9 years ago

clconway commented 9 years ago
$ bazel-bin/shipshape/cli/shipshape --analyzer_images yulin2/ctadetector -categories CTADetector --stderrthreshold=INFO .
I1008 16:53:55.347716   11643 shipshape_lib.go:78] Starting shipshape...
[...]
I1008 16:54:01.766097   11643 shipshape_lib.go:157] Calling with request shipshape_context:<repo_root:"/shipshape-workspace" > triggered_category:"CTADetector" event:"manual" stage:PRE_BUILD 
I1008 16:54:01.766432   11643 shipshape_lib.go:248] Calling to the shipshape service with shipshape_context:<repo_root:"/shipshape-workspace" > triggered_category:"CTADetector" event:"manual" stage:PRE_BUILD 
WARNING: Analyzer CTADetector failed to run: The triggered category "CTADetector" could not be found at the locations [localhost:10005 localhost:10006 localhost:10008]
I1008 16:54:01.819013   11643 shipshape_lib.go:200] End of Results.

It might be something wrong with the image itself:

$ docker pull yulin2/ctadetector
[...]
Status: Downloaded newer image for yulin2/ctadetector:latest
$ docker run -it yulin2/ctadetector /bin/bash
/endpoint.sh: line 7: /shipshape-output/shipshape.CTADetector.log: No such file or directory
ciera commented 9 years ago

I think I know what the issue is now. I'm having this problem when any other analyzer image was previously run, but now is not being run. The problem is that the old image is still bound to the ports that we want to use. I'm having this happen for not just the CTA Detector, but any image after I already have android lint running. Docker inspect on the container will confirm if it is the same issue.

The right way to do this is to properly shut down old containers. For now, I may just have all external analyzers go down every time, just to get this working for the tutorial

ciera commented 9 years ago

I put in a hack fix for this (see commit above). This now takes up and down the external analyzers every time. This should be modified to take down existing ones only if they are unused.