Wildcard-ing job executors (OD-1873)
lolipain opened 2 years 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 years 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 years ago

    That's a doable solution for me, thanks!

  • Robin Shen changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • martinsonntag commented 2 years ago

    Hi @robin , we have exactly the same situation. If we use a configuration like you suggested (multiple executors can run on the same agent potentially) we get the problem, that we cannot control how many executors are running concurrently on the agent. Maybe we miss something?

  • Robin Shen commented 2 years ago

    This is a limitation. Concurrency can only be controlled within scope of an executor.

issue 1/1
Type
Improvement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-1873
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover