Page MenuHomePhabricator

[components-api] Allow reusing another component build
Closed, ResolvedPublic

Description

When configuring more than one component, allow specifying that the build should reuse the same build as another component.

The syntax for this should be (from the design spec):

toolhunt-flower:
  description: dashboard for monitoring and managing celery
  type: continuous
  build:
    reuse-from: toolhunt-api
  run:
    port: 5555
    command: flower

The config should also validate that the component mentioned there is defined in the same config.

Event Timeline

dcaro triaged this task as High priority.Aug 21 2025, 3:30 PM

I think https://gitlab.wikimedia.org/repos/cloud/toolforge/components-api/-/merge_requests/118 is good for review.

Will continue trying to get a local environment working to integration test it as time allows.

Managed to get lima-kilo built.

Both manual tests and the functional tests seem to be good:

Added some setup notes under https://gitlab.wikimedia.org/repos/cloud/toolforge/components-api/-/merge_requests/120 and some pain points linked to T402672.

It will likely be a few weeks before I get back to looking at this stuff again, depending on the weather.

group_203_bot_f4d95069bb2675e4ce1fff090c1c1620 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/935

components-api: bump to 0.0.153-20250828083225-788c69d6

dcaro assigned this task to DamianZaremba.
dcaro moved this task from Next Up to Done on the Toolforge (Toolforge iteration 24) board.

Confirmed working in production with https://github.com/cluebotng/component-configs/blob/main/cluebotng-review.yaml

tools.cluebotng-review@tools-bastion-13:~$ toolforge components deployment show
Warning: You are using a beta feature of Toolforge.
Deployment ID: 20250828-111218-k51x6wbgjm
Created: 20250828-111218
Status: successful
Long status: 
  Finished at 2025-08-28 11:14:25.414207

Builds:
  add-dangling-edits-to-group(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  add-edits-to-queue(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  add-reported-edits(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  add-reviews-from-huggle(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  add-reviews-from-report(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  celery-flower(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  celery-worker(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  cleanup-user-records(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  cluebotng-reviewer(skipped): id:cluebotng-review-buildpacks-pipelinerun-z9gk5 Reusing existing build
  export-statistics(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  grafana-alloy(successful): id:cluebotng-review-buildpacks-pipelinerun-7rfh5 You can see the logs with `toolforge build logs cluebotng-review-buildpacks-pipelinerun-7rfh5`
  grant-review-access-from-wikipedia-rights(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  import-training-data(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  irc-relay(successful): id:cluebotng-review-buildpacks-pipelinerun-7zz8x You can see the logs with `toolforge build logs cluebotng-review-buildpacks-pipelinerun-7zz8x`
  mark-edits-as-deleted(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  mark-edits-as-having-data(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer
  redis(skipped): id:cluebotng-review-buildpacks-pipelinerun-sstgb Reusing existing build
  update-edit-classifications(skipped): id:no-build-needed Component re-uses build from cluebotng-reviewer

Runs:
  add-dangling-edits-to-group(successful): [info] (Job add-dangling-edits-to-group is already up to date)
  add-edits-to-queue(successful): [info] (Job add-edits-to-queue is already up to date)
  add-reported-edits(successful): [info] (Job add-reported-edits is already up to date)
  add-reviews-from-huggle(successful): [info] (Job add-reviews-from-huggle is already up to date)
  add-reviews-from-report(successful): [info] (Job add-reviews-from-report is already up to date)
  celery-flower(successful): [info] (Job celery-flower is already up to date)
  celery-worker(successful): [info] (Job celery-worker is already up to date)
  cleanup-user-records(successful): [info] (Job cleanup-user-records is already up to date)
  cluebotng-reviewer(successful): [info] (Job cluebotng-reviewer is already up to date)
  export-statistics(successful): [info] (Job export-statistics is already up to date)
  grafana-alloy(successful): [info] (Job grafana-alloy created)
  grant-review-access-from-wikipedia-rights(successful): [info] (Job grant-review-access-from-wikipedia-rights is already up to date)
  import-training-data(successful): [info] (Job import-training-data is already up to date)
  irc-relay(successful): [info] (Job irc-relay created)
  mark-edits-as-deleted(successful): [info] (Job mark-edits-as-deleted is already up to date)
  mark-edits-as-having-data(successful): [info] (Job mark-edits-as-having-data is already up to date)
  redis(successful): [info] (Job redis updated)
  update-edit-classifications(successful): [info] (Job update-edit-classifications is already up to date)