Wildcard-ing job executors (OD-1873)
Closed
lolipain opened 2 weeks ago

Hi, I'm running multiple Job Executors on different machines, even different arhcs e.g. arm64 and amd64. There's more - some of those executor are allowed to mount host docker.sock, some of them - are not (for security reasons) I try to keep those name are consistent, so:

  • my arm64 executor is named - arm64_runner
  • my amd64 executor with mounted socket is - amd64_runner_mount
  • and the amd64 w/o socket is just - amd64_runner

So, currently if I need to run my architecture-specific Job i should indicate explicitly executor that would match all specific criterias

For example to build docker image on native amd64 I need to explictly set in my .onedev-buildspec.yml:

jobExecutor: amd64_runner_mount

But that is not always handy when it comes down for not arch-specific jobs.

Running jobs such as unit-testing for my projects are absolutely universal, but the only criteria is to try avoiding docker.sock'mounted runners (again, for security)

So I'll be happy to write in my .onedev-buildspec.yml something like that:

jobExecutor: *_runner_[!mount]

The exact wildcard syntax doesn't matter, but my humble guess that is using regex-based wildcarding should be most-functionaled & easiest to implement

I'll be glad if someone else would find that feature useful for that or any other case, and finally it would be introduced in some release

Robin Shen commented 2 weeks ago

I'd suggest to define a new executor to do the job. For your case, it will include all machines (amd64/arm64) without docker mount option. And then configure your non-arch job to use this executor.

lolipain commented 2 weeks ago

That's a doable solution for me, thanks!

Robin Shen changed state to 'Closed' 2 weeks ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
Improvement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1873
Please wait...
Page is in error, reload to recover