Closed aleksandrsmyk closed 3 years ago
After you've pulled the image, start an interactive container:
docker run -it mcr.microsoft.com/infersharp:latest
run_infersharp.sh should be under /app/:
sh: 0: Can't open run_infersharp.sh
with azure pipeline task given in .build/azure-pipelines-example.yml
I'm having the same problem with the Azure Pipeline task example. I can run the example in a local container, though.
I put a 'ls' into my script run. Here is the output at the base folder (on our ADO build agents) where the example tries to run the script. Locally, I get a completely different listing. I'm still debugging this issue.
CODEOWNERS azure-pipelines-ect-test.yml docs lib readme.md src tools sh: 0: Can't open run_infersharp.sh
Hi @vswathidev, @ethanturk, it seems that your Azure Pipelines were not running in container mode, but rather directly on the host. Can you double check if the container section of your pipelines looks like this?
pool:
vmImage: 'ubuntu-20.04'
container:
image: mcr.microsoft.com/infersharp:latest
This is one of the test run results on Azure Pipelines using .build/azure-pipelines-example.yml.
Here is the addition to my pipeline:
job: RunInferSharp dependsOn: 'BuildSolution' pool: vmImage: 'ubuntu-20.04' container: image: mcr.microsoft.com/infersharp:latest
steps:
task: DownloadBuildArtifacts@0 displayName: 'Download binaries' inputs: buildType: 'current' downloadType: 'single' artifactName: 'inferinput' downloadPath: '$(System.ArtifactsDirectory)'
script: | sh run_infersharp.sh $(System.ArtifactsDirectory) output displayName: 'Run Infer# analysis'
script: cat $(Build.SourcesDirectory)/infer-out/filtered_bugs.txt displayName: 'Infer# analysis result'
Thanks for the additional info! I think I know where it could have gone wrong. Let me get the fix ready.
So the problem is that _runinfersharp.sh needs to be present on the host first in order to run in a container. You can refer to the PR linked above for the updated instructions. I think it should resolve the issue. Please let me know otherwise. Thanks!
I saw the PR. It seems to have resolved the issue on my end, yes. Thanks for the quick response.
When executing : sh run_infersharp.sh Examples output
I got : sh: run_infersharp.sh: No such file or directory
Could you suggest any options to fix it?