Commit 89afdea7 authored by Kamil Trzciński's avatar Kamil Trzciński 💬

Make default limit for runner set to 1 during registration

parent 6c17d0af
Pipeline #45405 passed with stage
......@@ -5,6 +5,7 @@ v 0.4.0
- Make the debug log human readable
- Make default build log limit set to 4096 (4MB)
- Make default concurrent set to 1
- Make default limit for runner set to 1 during registration
- Updated kardianos service to fix OSX service installation
- Updated logrus to make console output readable on Windows
- Change default log level to warning
......
......@@ -212,6 +212,12 @@ func runRegister(c *cli.Context) {
}
runnerConfig.Executor = s.askExecutor()
limit := c.Int("limit")
runnerConfig.Limit = &limit
if s.config.Concurrent < limit {
log.Warningf("Specified limit (%d) larger then current concurrent limit (%d). Concurrent limit will not be enlarged.", limit, s.config.Concurrent)
  • @ayufan I don't understand this log message. What scenario are we talking about here?

  • You have two limits:

    • concurrent: global limit of maximum number of jobs for all runners
    • runner.limit: limit of maximum number of jobs for runner

    runner.limit > concurrent -> it doesn't make sense

  • OK I don't understand global vs runner. What is 'global'?

  • You can have multiple runners handled by single daemon: Global (concurrent) in that case means maximum number of jobs handled by all runners.

  • Example of such case you have 3 different docker executors with different images and services, each of them have limit set to 2. In the worst case it would run 6 jobs with concurrent set to 3 you limit it up to 3 jobs.

  • Aha 'global' is the top level of the toml file?

    And then 'concurrent' is the number of cores, and on each executor you can set a 'limit'. You don't want more total jobs (across different executors) then there are 'cores'. Is that correct?

  • There's no parameter named global: concurrent is the global. Yes, each executor has it's own limit.

    This is how will look config file to upper example:

    concurrent = 3
    
    [[runners]]
      executor = "docker"
      limit = 2
    
    [[runners]]
      executor = "docker"
      limit = 2
    
    [[runners]]
      executor = "docker"
      limit = 2
Please register or sign in to reply
}
switch runnerConfig.Executor {
case "docker", "docker-ssh":
......@@ -295,6 +301,14 @@ func init() {
EnvVar: "RUNNER_EXECUTOR",
},
// Runner specific configuration
cli.IntFlag{
Name: "limit",
Value: 1,
Usage: "Specify number of concurrent jobs for this runner",
EnvVar: "RUNNER_LIMIT",
},
// Docker specific configuration
cli.StringFlag{
Name: "docker-image",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment