Page MenuHomePhabricator

[components-api] Trigger builds on every deploy
Closed, ResolvedPublic

Description

The flow should be:

  • Deploy is triggered
  • Extract the list of images to build from the tool configuration (components.build.repository + components.build.ref if they exist) - update build status with 'pending'
  • Trigger each images build - update build status with 'started'
  • If any build failed, stop the deploy and update build status with failed
  • Then continue with the deployment of the continuous job as it does right now

Thins to add in the API are:

  • Support for build-service components, this means adding the following to the build: section of the tool config:
build:
  repository: https://github.com/wikimedia/toolhunt-ui
  ref: main

(for a full example see https://docs.google.com/document/d/116eZZcEPpm-YCV25qjK3Iv8LFj2OBA4wkwYMTeJcYWo/edit?tab=t.0#heading=h.66q7phvqzgit)
Code for it https://gitlab.wikimedia.org/repos/cloud/toolforge/components-api/-/blob/main/components/models/api_models.py?ref_type=heads#L17

Probably an enum with something like build pending, build started, build successful, build failed, unknown.

This can be done in several patches for simplicity and ease of review/testing, like:

  • First iteration runs the builds in sequence if any, and does no updates to the deploy status
  • Second iteration adds parallelism to the builds
  • Third iteration adds status updating of the deployment object during the process (build pending, build started, build successful, build failed, unknown)

Event Timeline

dcaro triaged this task as High priority.Jan 23 2025, 6:06 PM
dcaro changed the task status from Open to In Progress.Feb 26 2025, 2:27 PM
dcaro moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 18) board.

group_203_bot_4866fc124f4b41659f667468a6115cf3 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/679

components-api: bump to 0.0.80-20250226173827-dba5198e

group_203_bot_4866fc124f4b41659f667468a6115cf3 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/713

components-api: bump to 0.0.83-20250313140145-6eef21b6

group_203_bot_4866fc124f4b41659f667468a6115cf3 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/715

components-api: bump to 0.0.84-20250313161312-ec70b457

group_203_bot_4866fc124f4b41659f667468a6115cf3 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/716

components-api: bump to 0.0.92-20250313163352-ed309aa5

dcaro moved this task from In Progress to Done on the Toolforge (Toolforge iteration 18) board.