[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH 3/3] CI: New stage "containers" to rebuild some containers



On Fri, Nov 15, 2024 at 04:34:21PM -0800, Stefano Stabellini wrote:
> On Fri, 15 Nov 2024, Anthony PERARD wrote:
> > Rebuild rolling release containers when XEN_CI_REBUILD_CONTAINERS is
> > set. This is to be use with a scheduled pipeline.
> > 
> > When $XEN_CI_REBUILD_CONTAINERS is set, only build jobs related to the
> > containers been rebuild will be executed.
> > 
> > Build jobs that are using one of the containers been rebuild should
> > wait for the container to be rebuild. If it's a normal pipeline, those
> > dependency are simply ignored.
> 
> This is a fantastic contribution, thanks Anthony!
> 
> I think we can simplify this patch by removing all stages except for
> "containers" on the scheduled pipeline with XEN_CI_REBUILD_CONTAINERS
> set to true.
> 
> I think it is a good idea to have a special schedule pipeline for this,
> and we should exploit the fact that it is special and only use it to
> rebuild the containers. If we want to, we can have a second scheduled
> pipeline to do a full normal run afterwards.
> 
> This way, there is no need to carry the changes to build.yaml or
> test.yaml that are a bit hard to read/understand for someone unfamiliar
> with gitlab. When XEN_CI_REBUILD_CONTAINERS == true we only do the
> containers stage.

So, you mean having this following change instead of make changes to
build.yaml and test.yaml, right?

    diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
    --- a/.gitlab-ci.yml
    +++ b/.gitlab-ci.yml
    @@ -14,7 +14,15 @@ stages:
       - test
     
     include:
    -  - 'automation/gitlab-ci/containers.yaml'
    -  - 'automation/gitlab-ci/analyze.yaml'
    -  - 'automation/gitlab-ci/build.yaml'
    -  - 'automation/gitlab-ci/test.yaml'
    +  - local: 'automation/gitlab-ci/containers.yaml'
    +    rules:
    +      - if: $XEN_CI_REBUILD_CONTAINERS
    +  - local: 'automation/gitlab-ci/analyze.yaml'
    +    rules:
    +      - if: $XEN_CI_REBUILD_CONTAINERS == null
    +  - local: 'automation/gitlab-ci/build.yaml'
    +    rules:
    +      - if: $XEN_CI_REBUILD_CONTAINERS == null
    +  - local: 'automation/gitlab-ci/test.yaml'
    +    rules:
    +      - if: $XEN_CI_REBUILD_CONTAINERS == null


Or I guess we can also compare to the string "true" and write the
expression as
    if: $XEN_CI_REBUILD_CONTAINERS == "true"
and
    if: $XEN_CI_REBUILD_CONTAINERS != "true"

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.