Page MenuHomePhabricator

[tbs] Create a subcommand for the toolforge cli to trigger a build
Closed, ResolvedPublic

Description

This taks is to investigate and decide how to trigger an image build.

What it needs:

It has to create a PipelineRun object under the image-build namespace, for example:

dcaro@vulcanus$ cat example-user-manifests/pipelinerun.yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: minikube-user-buildpacks-pipelinerun-
  namespace: image-build
spec:
  serviceAccountName: buildpacks-service-account
  pipelineRef:
    name: buildpacks
  params:
    - name: BUILDER_IMAGE
      value: docker-registry.tools.wmflabs.org/toolforge-buster0-builder
    - name: APP_IMAGE
      value: "192.168.49.1/minikube-user/python:snap"
    - name: SOURCE_URL
      value: https://github.com/david-caro/wm-lol
    - name: USER_ID
      value: "61312"
    - name: GROUP_ID
      value: "61312"
    # If you have a cache image, could speed this up
    # - name: CACHE_IMAGE
    #   value: <IMAGE_NAME>-cache
  workspaces:
  - name: source-ws
    emptyDir: {}
    # TODO: use persistent volume claims
    #persistentvolumeclaim:
      #claimName: minikube-user-pvc
  - name: cache-ws
    emptyDir: {}

But making sure the parameters are the correct ones.

    1. Some ideas:
  • Creating it's own cli, like the jobs framework
  • Adding a subcommand to webservice
  • Adding a plugin to the (maybe to be created) toolforge cli

Event Timeline

Is webservice really the best place for this? To avoid confusion, I would like to avoid putting things in webservice if it will likely be used for the jobs framework too eventually (assuming of course that jobs can use buildpack based images too).

The goal is to abstract from the user all the underlying implementation details and make it simple for existing users to discover/use. Keeping it as part of the same existing entry points (ex. jobs or webservice) help a long way with both discovery and usage, creating a new tool only covers the usage. But other ideas are welcome, what did you had in mind?

dcaro removed dcaro as the assignee of this task.Oct 19 2021, 1:46 PM
dcaro removed a project: User-dcaro.
dcaro renamed this task from [webservice] Add a way to trigger a buildpack based build to [tbs] Find a way to trigger a buildpack based build.Dec 6 2021, 1:06 PM
dcaro updated the task description. (Show Details)
dcaro renamed this task from [tbs] Find a way to trigger a buildpack based build to [tbs] Create a subcommand for the toolforge cli to trigger a build.Jan 12 2022, 9:02 AM
dcaro changed the task status from Open to In Progress.
dcaro claimed this task.
dcaro moved this task from Today to Doing on the User-dcaro board.
dcaro changed the task status from In Progress to Open.Jan 12 2022, 9:16 AM
dcaro edited projects, added Toolforge; removed Toolforge Build Service.
dcaro moved this task from Doing to Today on the User-dcaro board.

Change 764327 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/toolforge/toolforge-cli@main] DONOTMERGE: Add build subcommand

https://gerrit.wikimedia.org/r/764327

Change 769981 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/toolforge/toolforge-cli@main] Add build-list command

https://gerrit.wikimedia.org/r/769981

Change 769982 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/toolforge/toolforge-cli@main] Add build-show command

https://gerrit.wikimedia.org/r/769982

Change 769985 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/toolforge/toolforge-cli@main] Add build-logs command

https://gerrit.wikimedia.org/r/769985

dcaro changed the task status from Open to In Progress.Mar 11 2022, 3:11 PM
dcaro triaged this task as High priority.
dcaro moved this task from Today to Doing on the User-dcaro board.
dcaro changed the task status from In Progress to Open.Mar 16 2022, 11:36 AM
dcaro moved this task from Doing to Refined on the User-dcaro board.

Change 764327 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] Add build subcommand

https://gerrit.wikimedia.org/r/764327

Change 769985 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] Add build-logs command

https://gerrit.wikimedia.org/r/769985

Change 769981 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] Add build-list command

https://gerrit.wikimedia.org/r/769981

dcaro changed the task status from Open to In Progress.Mar 24 2022, 2:47 PM
dcaro moved this task from Refined to Doing on the User-dcaro board.

Change 773603 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/toolforge/toolforge-cli@main] Add mypy tests and some fixes

https://gerrit.wikimedia.org/r/773603

Change 773603 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] Add mypy tests and some fixes

https://gerrit.wikimedia.org/r/773603

Change 769982 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] Add build-show command

https://gerrit.wikimedia.org/r/769982

Change 777302 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/toolforge/toolforge-cli@main] Add explicit python3-cryptography version

https://gerrit.wikimedia.org/r/777302

Change 777302 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] Allow autodection of python modules

https://gerrit.wikimedia.org/r/777302

dcaro changed the task status from In Progress to Open.Aug 23 2022, 8:14 AM
dcaro moved this task from Doing to Today on the User-dcaro board.
dcaro changed the task status from Open to In Progress.Oct 5 2022, 1:08 PM
dcaro moved this task from Today to Doing on the User-dcaro board.

The cli is deployed in toolsbeta, will create a new task for the deployment in tools (with a more careful approach and communication).

dcaro moved this task from Doing to Done on the User-dcaro board.