Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and test images #14

Closed
wants to merge 16 commits into from
Closed

Conversation

MusicDin
Copy link
Member

@MusicDin MusicDin commented Feb 16, 2024

Adds workflows for building and testing lxd-imagebuilder images.

TODO:

  • setup-image contains url to the fork of the lxd-ci, which allows easier testing until recipes are ready.
  • Virtualization is not enabled (LXD reports drivers: "lxc")
  • If one reusable workflow fails, it stops all other workflows of the same image distro.
  • Prevent image upload if VM tests were skipped

@MusicDin MusicDin force-pushed the feat/image-workflows branch 4 times, most recently from d71e2f8 to b075f0f Compare February 16, 2024 15:31
.github/actions/image-setup/action.yml Outdated Show resolved Hide resolved
using: composite
steps:
- name: Install dependencies
shell: bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace all those by a single top section:

defaults:
  run:
    # Make sure bash is always invoked with `-eo pipefail`
    # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
    shell: bash

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried this one, but composite actions do not support default.run.shell.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh bummer. Have you tried putting it in the top composite job?

.github/actions/image-setup/action.yml Outdated Show resolved Hide resolved
@MusicDin MusicDin force-pushed the feat/image-workflows branch from b075f0f to ae546c0 Compare February 16, 2024 15:41
pull_request:
# schedule:
# # Run at 00:00 UTC daily.
# - cron: '0 0 * * *'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_dispatch: would be handing to trigger those workflows on demand.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add. Currently, this is added only for each separate image action.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we want to run those on "push" and "pull_request"? I would expect only workflow_dispatch and cron? Because once we add all images this will most likely trigger few hundred builds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a call for Tom to make but I think we'll at least want cron and manual dispatch. I think you are right in that we should avoid the thundering herd on pull/push :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we want to run those on "push" and "pull_request"? I would expect only workflow_dispatch and cron? Because once we add all images this will most likely trigger few hundred builds.

Yes indeed, daily and manually only.
We could potentially do something cleverer later where we detect if a pull request has modified recipe(s) and then runs the rebuild of only those modified in the PR.

fedora:
uses: ./.github/workflows/image-fedora.yml
# ubuntu:
# uses: ./.github/workflows/image-ubuntu.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like those composite jobs, pretty nifty. You might want to also include some steps to replicate https://github.com/canonical/lxd-ci/blob/main/.github/workflows/tests.yml#L83-L122

@MusicDin MusicDin force-pushed the feat/image-workflows branch from ae546c0 to a83f946 Compare February 16, 2024 15:47
@MusicDin MusicDin force-pushed the feat/image-workflows branch from a83f946 to 417577c Compare February 16, 2024 15:57
@simondeziel
Copy link
Member

@MusicDin fedora 36 is EOL, 39 is where it's at now ;)

@MusicDin MusicDin force-pushed the feat/image-workflows branch from 417577c to 1aaaecf Compare February 16, 2024 16:05
@MusicDin
Copy link
Member Author

Moving to LXD-CI.

@MusicDin MusicDin closed this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants