chore: script to verify unstructured image outbound connectivity#4008
chore: script to verify unstructured image outbound connectivity#4008
Conversation
qued
left a comment
There was a problem hiding this comment.
Some suggestions for compatibility.
| fi | ||
|
|
||
|
|
||
| docker exec -i -e PYTHONUNBUFFERED=1 "$CID" python - <<PY |& tee "${PY_LOG_DIR}/${SCENARIO}.log" |
There was a problem hiding this comment.
I have the version of bash that came with my Mac, and |& isn't a valid symbol. If there's an equivalent construction that works with the old (<4) version of bash, it might be worth using it for compatibility.
There was a problem hiding this comment.
yes, i'd rather just be opinionated that the caller has a modern version of bash though. maybe this can be an earlier line check that checks bash --version > 5
| ./test-outbound-connectivity.sh --cleanup offline-and-missing-models | ||
|
|
||
| set +e | ||
| found_pcap_files=$(find "pcaps" -maxdepth 1 -name "*.pcap" -type f -newermt "@$start_timestamp_seconds" 2>/dev/null | wc -l | tr -d ' ') |
There was a problem hiding this comment.
This might be a bash version issue, but I get an error running find "pcaps" -maxdepth 1 -name "*.pcap" -type f -newermt "@$start_timestamp_seconds" that it can't parse the date. I was able to get it to work by changing line 8 to start_timestamp_seconds=$(date) and removing the @ from the find commands.
| echo " tshark output for $scenario" | ||
| echo " -------------------------------------------" | ||
| echo | ||
| tshark -r pcaps/$scenario.pcap -q -z conv,ip | grep -v '====================================' |
There was a problem hiding this comment.
Just noting that I needed to install Wireshark.
Sample output. The key thing here is the modes
offline(meaning set HF_HUB_ONLINE=1 AND DO_NOT_TRACK=true) results in no outbound connections. This also is true if the locally cached models are removed, the last scenario ofoffline-and-missing-models)