Closed raghunathd8 closed 2 years ago
Hi @raghunathd8 this is possible using the -wd PATH
cli option.
In terminal one:
tern report -f json -i docker.io/library/alpine:latest -o tern-report.json
In terminal two:
tern -wd ~/temp1 report -f json -i alpine:3.14 -o tern-report1.json
Tern needs a working directory to perform its comparison operations. If one is not specified, it will default to using the same directory which is the error you're seeing. Note that the temporary working directory does not have to exist prior to running the Tern command (Tern will create it if it doens't exist) so this can be a random directory.
Describe the bug Running >=2 processes of tern is resulting in error for at least one process. One tern process is finishing and cleaning up temp directory while the other process (which is running in parallel) is also running and expecting that the temp directory is created and required directories/files are in place. This is ending up in various errors depending on the time parallel executions (overlapping periods).
To Reproduce Steps to reproduce the behavior:
watch $HOME/.tern/temp
tern report -f json -i docker.io/library/alpine:latest -o tern-report.json
tern report -f json -i docker.io/library/alpine:3.14 -o tern-report1.json
Error in terminal
On Terminal-1 watch for temp directory behaviour. The behaviour is different based on when you trigger the parallel tern processes.
Expected behavior Scanning of more than one image "simultaneously" using Tern should be possible. I should be able to run many tern processes on the same instance in parallel (simultaneously).
Environment you are running Tern on Enter all that apply
Output of 'tern --version' $ tern --version Tern version 2.9.1 python version = 3.9.2 (default, Feb 28 2021, 17:03:44)
Operating System (Linux Distro and version or Mac or Windows) $ cat /etc/*-release PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
Python version (3.6 or higher) python version = 3.9.2