Page MenuHomePhabricator

[components-api,beta] Generated configs should contain cpu values as numbers, not strings
Open, LowPublic

Description

How to reproduce?

$ ssh login.toolforge.org
$ become transmodel-ids
$ toolforge components config generate

What does happen?

components:
  fetch-ch:
    build:
      repository: https://gitlab.wikimedia.org/toolforge-repos/transmodel-ids.git
      ref: HEAD
    run:
      command: fetch_ch
      cpu: '0.5'
      emails: none
      filelog: false
      memory: 0.5Gi
      mount: none
      retry: 0
      schedule: 23 9 * * *

What should happen instead?

Probably this is purely cosmetic, but it would be less surprising/confusing if the value of cpu was a number, not a quoted string.

Event Timeline

This one might be a bit tricky, as the value of cpu might have units in it (ex. 500m), so we would have to check exactly what we get from the jobs-api to see if it's normalized as a number always, or just sometimes.

dcaro triaged this task as Low priority.Jul 3 2025, 1:00 PM
dcaro moved this task from Backlog to Ready to be worked on on the Toolforge board.

Had a quick look, and it seems k8s might reply with a string instead of a float sometimes (not clear when though):
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu