please execute all jobs in a stage even if one fails

Bug #2030672 reported by dann frazier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned
lpci
Triaged
Low
Unassigned

Bug Description

I'm looking to use lpci to implement some testing. In this testing, there could be multiple tests jobs defined for the same stage. Currently it appears that all jobs in a stage run in serial and, once one job fails, subsequent jobs in that stage are not started.

It would be more efficient for my use case if all jobs in a stage were always executed, so that a developer debugging a test failure could reason about the entire set of passes and failures, instead of just tackling them one at a time.

Revision history for this message
dann frazier (dannf) wrote :

Adding a task for Launchpad itself, as I understand it requires a different fix than local lpci.

Revision history for this message
Colin Watson (cjwatson) wrote :

I'm pretty sure this is contrary to the spec. Do you have a link to a build that's behaving this way?

Revision history for this message
dann frazier (dannf) wrote :
Download full text (8.0 KiB)

I'm not familiar with the spec, but the documentation[*] says:
 "If a stage is a list of job names, then those jobs are executed in parallel."

If they were executed in parallel and each allowed to run to completion, then I think this issue would be resolved. However, that is not what I'm observing:

# Here's a .launchpad.yaml with a pipeline comprising 2 jobs, with the first designed to fail:
ubuntu@cortez-vm-0:~$ cat .launchpad.yaml
pipeline:
- ["job1", "job2"]

jobs:
  job1:
    architectures: amd64
    series: jammy
    run: |-
      echo "Hello job1"
      /bin/false
  job2:
    architectures: amd64
    series: jammy
    run: |-
      echo "Hello job2"
# Here you can see that we only get output from the first job:
ubuntu@cortez-vm-0:~$ lpci
Starting lpci, version 0.2.3
Logging execution to '/home/ubuntu/.local/state/lpci/log/lpci-20230807-221738.576685.log'
Running ['bash', '--noprofile', '--norc', '-ec', 'echo "Hello job1"\n/bin/false']
:: Hello job1
Job 'job1' for jammy/amd64 failed with exit status 1.
Full execution log: '/home/ubuntu/.local/state/lpci/log/lpci-20230807-221738.576685.log'
# The log includes no evidence of an attempt to run job2:
ubuntu@cortez-vm-0:~$ cat /home/ubuntu/.local/state/lpci/log/lpci-20230807-221738.576685.log
2023-08-07 22:17:38.577 Starting lpci, version 0.2.3
2023-08-07 22:17:38.738 Executing on host: lxc --project default profile show local:default
2023-08-07 22:17:38.858 Launching environment for jammy/amd64
2023-08-07 22:17:38.859 Using hostname 'craft-buildd-instance'
2023-08-07 22:17:38.860 Executing on host: lxc remote list --format=yaml
2023-08-07 22:17:38.964 Remote 'craft-com.ubuntu.cloud-buildd' already exists.
2023-08-07 22:17:38.964 Using hostname 'lpci-ubuntu-7340034-jammy-amd64'
2023-08-07 22:17:38.965 Executing on host: lxc project list local: --format=yaml
2023-08-07 22:17:39.076 Executing on host: lxc --project default profile show local:default
2023-08-07 22:17:39.196 Executing on host: lxc --project lpci profile edit local:default
2023-08-07 22:17:39.352 Executing on host: lxc project list local: --format=yaml
2023-08-07 22:17:39.472 Set LXD instance name to 'lpci-ubuntu-7340034-jammy-amd64'
2023-08-07 22:17:39.472 Checking for instance 'lpci-ubuntu-7340034-jammy-amd64' in project 'lpci' in remote 'local'
2023-08-07 22:17:39.472 Executing on host: lxc --project lpci list local: --format=yaml
2023-08-07 22:17:39.624 Executing on host: lxc --project lpci config get local:lpci-ubuntu-7340034-jammy-amd64 raw.idmap
2023-08-07 22:17:39.741 Executing on host: lxc --project lpci list local: --format=yaml
2023-08-07 22:17:39.891 Instance exists and is not running. Starting instance.
2023-08-07 22:17:39.891 Executing on host: lxc --project lpci start local:lpci-ubuntu-7340034-jammy-amd64
2023-08-07 22:17:40.402 Executing in container: lxc --...

Read more...

Revision history for this message
Ines Almeida (ines-almeida) wrote :

Although the documentation does mention "If a stage is a list of job names, then those jobs are executed in parallel.", this hasn't been implemented yet.

We do plan to implement it in the future, and it is in the spec: https://docs.google.com/document/d/14MXIbRTBpp8bvtxJBOR12S9JcLisdNJi9r3taJx96LE/edit). I have now corrected the documentation: https://lpci.readthedocs.io/en/latest/configuration.html

So basically, this is indeed missing currently. I think this is a duplicate of https://bugs.launchpad.net/launchpad/+bug/2007650 (lpcraft is the old name for lpci), can you confirm?

Changed in launchpad:
importance: Undecided → Low
status: New → Triaged
Changed in lpci:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
dann frazier (dannf) wrote :

Thanks Ines. Bug 2007650 does look like a duplicate of the LP task, which comment #6 asserts is fixed. Perhaps this only impacts lpci running locally? I'll leave it to you to decide if you want to dupe it.

Revision history for this message
Ines Almeida (ines-almeida) wrote :

I just confirmed, and it is not yet possible to run these in parallel, even though comment #6 implies that it was fixed.

I marked this ticket as a duplicate

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.