sourcegraph/src-cli

src-cli doesn't work with podman

lookcrabs opened this issue · 4 comments

Description

When trying to run src-cli I get an obtuse error:

$ SRC_ENDPOINT="https://sourcegraph.host" SRC_ACCESS_TOKEN="XYXYXYXYXYXYXYXY" src batch preview -v -f replace-bugs.batch.yaml 

❌ Error:
   exit status 125
   
💡 The troubleshooting documentation can help to narrow down the cause of the errors:
   https://docs.sourcegraph.com/batch_changes/references/troubleshooting

After some poking around it looks like the src-cli does docker info --format '{{ .NCPU }}' underneath link. I think podman throws the number of cpus in docker info --format '{{ .Host.CPUs }}'.

When running this command manually I get exit status 125 which makes me think this is the issue but not sure.

using src-cli version 3.43.2 and sourcegraph 3.43.2

Hi - many thanks for your request. This helps us know what will be useful to work on next, so really appreciate your time!

This is not on our short-term roadmap, but we have ongoing conversations about generalizing what runtime we support in the future.
I'll make sure this is more clearly documented though.

Moving this to the backlog for now. Action item: document and point to this issue.

I'm getting the error below when running when using podman. Hope to see more support for podman soon.
For now using docker engine seems to work fine.

Machine Specs

❯ system_profiler SPSoftwareDataType SPHardwareDataType

Software:
      System Version: macOS 12.6 (21G115)
      Kernel Version: Darwin 21.6.0

Hardware:
      Model Name: MacBook Pro
      Model Identifier: MacBookPro18,3
      Chip: Apple M1 Pro
      Total Number of Cores: 10 (8 performance and 2 efficiency)
      Memory: 32 GB
      System Firmware Version: 7459.141.1
      OS Loader Version: 7459.141.1
      
❯ podman version      
Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.6
Built:        Wed Sep  7 04:16:02 2022
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.5
Built:        Thu Sep  8 04:59:25 2022
OS/Arch:      linux/arm64

❯ src version                  
Current version: 4.0.1
Recommended version: 4.0.1 or later

SourceGraph Error

2022-10-07T14:54:54.360138+09:00 stderr | invalid argument "type=bind,source=/tmp/1555766738,target=,ro" for "--mount" flag: target is required
2022-10-07T14:54:54.360208+09:00 stderr | See 'docker run --help'.
2022-10-07T14:54:54.360525+09:00 [Step 1] took 19ms; error running Docker container: exit status 125

Building on what @lookcrabs said I hacked in podman support for batches at imranh2@55d862c

You can clone my branch and just run go build ./cmd/src and you'll be left with ./src that you can use.

I also have docker aliased to podman behind the scenes but a symlink in your path from podman to docker would work too.