concourse / concourse/concourse

Task file vars interpolation does not work for container_limits element

Open
#5,765 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
7.9k
Forks
903
Avg merge
2d 11h
Merged PRs (30d)
20

Description

Summary

Having a pipeline with a task file whose container_limits are hard coded is working for us.
When we try to make the container limits configurable, the build breaks with an unparseble task file.

Working:

---
platform: linux

container_limits:
  cpu: 32696
  memory: "5gb"

image_resource:
  type: docker-image
  source:
    repository: adoptopenjdk14-dind
    tag: latest
    insecure_registries: ['any.registry.com']
    username: ((concourse_user))
    password: ((concourse_password))

[…]

Not working:

---
platform: linux

container_limits:
  cpu: 32696
  # configured via vars: in the pipeline
  memory: ((container_mem_limit)) 

image_resource:
  type: docker-image
  source:
    repository: adoptopenjdk14-dind
    tag: latest
    insecure_registries: ['any.registry.com']
    username: ((concourse_user))
    password: ((concourse_password))

[…]

Expected results

The container limits in a task file should work from configured vars: in the pipeline.

Actual results

Concourse cannot launch the task complaining that for example the memory limit cannot be parsed for the task file.
Screenshot 2020-06-15 at 12 55 09

Additional context

Might be related to #5753

Triaging info

  • Concourse version: 6.2
  • Did this used to work? => Unsure, tested it the first time with 6.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the working and variable-based task YAML, then trace the task-file container_limits parsing and vars interpolation entry points in the Concourse codebase. Done means a configured pipeline variable supplies container_limits.memory without an unparseable task-file error, with the behavior verified for the provided example.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.