[2/3] panfrost: Make the gitlab-ci.yml file more robust

Submitted by Rohan Garg on June 20, 2019, 1:58 p.m.

Details

Message ID 20190620135852.18167-3-rohan.garg@collabora.com
State New
Headers show
Series "panfrost: CI improvements" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Rohan Garg June 20, 2019, 1:58 p.m.
This enables developers to add packages to the container
when working on their own branches by creating
a container tag which features the branch name.
Dropped the IMAGE_LOCAL variable since I did not see it being
used anywhere.
---
 src/gallium/drivers/panfrost/ci/gitlab-ci.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/ci/gitlab-ci.yml b/src/gallium/drivers/panfrost/ci/gitlab-ci.yml
index 887c93dbc8b..7be53d623d6 100644
--- a/src/gallium/drivers/panfrost/ci/gitlab-ci.yml
+++ b/src/gallium/drivers/panfrost/ci/gitlab-ci.yml
@@ -16,7 +16,8 @@ 
 variables:
   UPSTREAM_REPO: mesa/mesa
   DEBIAN_VERSION: testing-slim
-  DEBIAN_TAG: "2019-06-17-1"
+  REV: 2019-06-17-1
+  DEBIAN_TAG: "${CI_COMMIT_REF_SLUG}_${DEBIAN_ARCH}_${REV}"
 
 include:
   - project: 'wayland/ci-templates'
@@ -42,7 +43,6 @@  stages:
   <<: *retry
   variables:
     GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
-    IMAGE_LOCAL: "$CI_REGISTRY/$CI_PROJECT_PATH/${DEBIAN_ARCH}:latest"
     DEBIAN_EXEC: 'DEBIAN_ARCH=${DEBIAN_ARCH}
                   GCC_ARCH=${GCC_ARCH}
                   KERNEL_ARCH=${KERNEL_ARCH}
@@ -73,7 +73,7 @@  container:arm64:
 
 .build:
   stage: build
-  image: $CI_REGISTRY/$CI_PROJECT_PATH/${DEBIAN_ARCH}:latest
+  image: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
   cache:
     paths:
       - ccache

Comments

On Thu, 20 Jun 2019 at 15:59, Rohan Garg <rohan.garg@collabora.com> wrote:
>
> This enables developers to add packages to the container
> when working on their own branches by creating
> a container tag which features the branch name.

Not sure I understand how this works. Isn't this going to cause
unnecessary container builds?

And, why cannot developers just add whatever they want to DEBIAN_TAG
to that end?

> Dropped the IMAGE_LOCAL variable since I did not see it being
> used anywhere.

Cool.

Thanks,

Tomeu

> ---
>  src/gallium/drivers/panfrost/ci/gitlab-ci.yml | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/panfrost/ci/gitlab-ci.yml b/src/gallium/drivers/panfrost/ci/gitlab-ci.yml
> index 887c93dbc8b..7be53d623d6 100644
> --- a/src/gallium/drivers/panfrost/ci/gitlab-ci.yml
> +++ b/src/gallium/drivers/panfrost/ci/gitlab-ci.yml
> @@ -16,7 +16,8 @@
>  variables:
>    UPSTREAM_REPO: mesa/mesa
>    DEBIAN_VERSION: testing-slim
> -  DEBIAN_TAG: "2019-06-17-1"
> +  REV: 2019-06-17-1
> +  DEBIAN_TAG: "${CI_COMMIT_REF_SLUG}_${DEBIAN_ARCH}_${REV}"
>
>  include:
>    - project: 'wayland/ci-templates'
> @@ -42,7 +43,6 @@ stages:
>    <<: *retry
>    variables:
>      GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
> -    IMAGE_LOCAL: "$CI_REGISTRY/$CI_PROJECT_PATH/${DEBIAN_ARCH}:latest"
>      DEBIAN_EXEC: 'DEBIAN_ARCH=${DEBIAN_ARCH}
>                    GCC_ARCH=${GCC_ARCH}
>                    KERNEL_ARCH=${KERNEL_ARCH}
> @@ -73,7 +73,7 @@ container:arm64:
>
>  .build:
>    stage: build
> -  image: $CI_REGISTRY/$CI_PROJECT_PATH/${DEBIAN_ARCH}:latest
> +  image: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
>    cache:
>      paths:
>        - ccache
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> Not sure I understand how this works. Isn't this going to cause
> unnecessary container builds?
>
> And, why cannot developers just add whatever they want to DEBIAN_TAG
> to that end?
>

This will spin a container for each branch, yes, though I think that is
how it should be. The patch allows for someone working in a branch to
( if the need be ) customize their containers for their branch.

To that extent, I've simply enabled the CI to auto generate a DEBIAN_TAG
which depends on the branch name so that a developer doesn't have to change
the DEBIAN_TAG themselves.

Cheers
Rohan Garg
On 6/20/19 6:33 PM, Rohan Garg wrote:
>> Not sure I understand how this works. Isn't this going to cause
>> unnecessary container builds?
>>
>> And, why cannot developers just add whatever they want to DEBIAN_TAG
>> to that end?
>>
> 
> This will spin a container for each branch, yes, though I think that is
> how it should be.

Well, things are like this right now precisely because people wanted to 
avoid what you are proposing. I would be quite sad if every time I push a 
new branch I had to wait for the container to be rebuilt. Also note that 
this is how other projects based on wayland/ci-templates work, including 
the rest of mesa.

> The patch allows for someone working in a branch to
> ( if the need be ) customize their containers for their branch.

As I said, you can easily do that atm by just updating DEBIAN_TAG.

> To that extent, I've simply enabled the CI to auto generate a DEBIAN_TAG
> which depends on the branch name so that a developer doesn't have to change
> the DEBIAN_TAG themselves.

But, why is that such a problem?

Cheers,

Tomeu

> Cheers
> Rohan Garg