diff mbox series

[ovs-dev] github: Don't fail the job if 'apt update' failed.

Message ID 20210201115615.1560521-1-i.maximets@ovn.org
State Accepted
Headers show
Series [ovs-dev] github: Don't fail the job if 'apt update' failed. | expand

Commit Message

Ilya Maximets Feb. 1, 2021, 11:56 a.m. UTC
Some repositories that are enabled in GHA are not stable and lead
to 'apt update' failures:

  E: The repository
     'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
     no longer has a Release file.

This causes the job failure.
In most cases we don't really need any packages from these failed
repositories, so we could try to continue the job.

Proviously this kind of failures happened on older branches with
ubuntu 16.04 base image, so we have this workaround already there.
Now it started to fail on bionic images, so fixing there too.

Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 .github/workflows/build-and-test.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aaron Conole Feb. 1, 2021, 2:08 p.m. UTC | #1
Ilya Maximets <i.maximets@ovn.org> writes:

> Some repositories that are enabled in GHA are not stable and lead
> to 'apt update' failures:
>
>   E: The repository
>      'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
>      no longer has a Release file.
>
> This causes the job failure.
> In most cases we don't really need any packages from these failed
> repositories, so we could try to continue the job.
>
> Proviously this kind of failures happened on older branches with
> ubuntu 16.04 base image, so we have this workaround already there.
> Now it started to fail on bionic images, so fixing there too.
>
> Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>

Incidentally, I was sure there was a way to ignore this condition (with
something like -m instead), but that started me down a rabbit hole and I
wasn't able to find the option anywhere.
David Marchand Feb. 1, 2021, 2:12 p.m. UTC | #2
On Mon, Feb 1, 2021 at 12:56 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> Some repositories that are enabled in GHA are not stable and lead
> to 'apt update' failures:
>
>   E: The repository
>      'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
>      no longer has a Release file.
>
> This causes the job failure.
> In most cases we don't really need any packages from these failed
> repositories, so we could try to continue the job.
>
> Proviously this kind of failures happened on older branches with

Nit: Previously*

> ubuntu 16.04 base image, so we have this workaround already there.
> Now it started to fail on bionic images, so fixing there too.
>
> Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  .github/workflows/build-and-test.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
> index e24970505..1bb72bbb1 100644
> --- a/.github/workflows/build-and-test.yml
> +++ b/.github/workflows/build-and-test.yml
> @@ -136,7 +136,7 @@ jobs:
>          key:  ${{ env.matrix_key }}-${{ env.ci_key }}
>
>      - name: update APT cache
> -      run:  sudo apt update
> +      run:  sudo apt update || true
>      - name: install common dependencies
>        if:   matrix.deb_package == ''
>        run:  sudo apt install -y ${{ env.dependencies }}
> --
> 2.26.2
>

Acked-by: David Marchand <david.marchand@redhat.com>

We just had the same failure with ovsrobot/dpdk.
https://github.com/ovsrobot/dpdk/runs/1805805661?check_suite_focus=true#step:7:68

Do you want to send the fix for DPDK?
Ilya Maximets Feb. 1, 2021, 2:22 p.m. UTC | #3
On 2/1/21 3:12 PM, David Marchand wrote:
> On Mon, Feb 1, 2021 at 12:56 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>>
>> Some repositories that are enabled in GHA are not stable and lead
>> to 'apt update' failures:
>>
>>   E: The repository
>>      'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
>>      no longer has a Release file.
>>
>> This causes the job failure.
>> In most cases we don't really need any packages from these failed
>> repositories, so we could try to continue the job.
>>
>> Proviously this kind of failures happened on older branches with
> 
> Nit: Previously*

Thanks.  Will fix before pusing.

> 
>> ubuntu 16.04 base image, so we have this workaround already there.
>> Now it started to fail on bionic images, so fixing there too.
>>
>> Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
>> ---
>>  .github/workflows/build-and-test.yml | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
>> index e24970505..1bb72bbb1 100644
>> --- a/.github/workflows/build-and-test.yml
>> +++ b/.github/workflows/build-and-test.yml
>> @@ -136,7 +136,7 @@ jobs:
>>          key:  ${{ env.matrix_key }}-${{ env.ci_key }}
>>
>>      - name: update APT cache
>> -      run:  sudo apt update
>> +      run:  sudo apt update || true
>>      - name: install common dependencies
>>        if:   matrix.deb_package == ''
>>        run:  sudo apt install -y ${{ env.dependencies }}
>> --
>> 2.26.2
>>
> 
> Acked-by: David Marchand <david.marchand@redhat.com>
> 
> We just had the same failure with ovsrobot/dpdk.
> https://github.com/ovsrobot/dpdk/runs/1805805661?check_suite_focus=true#step:7:68
> 
> Do you want to send the fix for DPDK?

Sorry, I have no much time for it right now.  And since this blocks CI,
this needs to be fixed ASAP, so it's better if you or someone else will
prepare this patch.

If you will prepare patch for DPDK, I'll Ack it.
David Marchand Feb. 1, 2021, 2:31 p.m. UTC | #4
On Mon, Feb 1, 2021 at 3:22 PM Ilya Maximets <i.maximets@ovn.org> wrote:
> On 2/1/21 3:12 PM, David Marchand wrote:
> > Do you want to send the fix for DPDK?
>
> Sorry, I have no much time for it right now.  And since this blocks CI,
> this needs to be fixed ASAP, so it's better if you or someone else will
> prepare this patch.
>
> If you will prepare patch for DPDK, I'll Ack it.

Sure, no problem.
Ilya Maximets Feb. 1, 2021, 3:49 p.m. UTC | #5
On 2/1/21 3:08 PM, Aaron Conole wrote:
> Ilya Maximets <i.maximets@ovn.org> writes:
> 
>> Some repositories that are enabled in GHA are not stable and lead
>> to 'apt update' failures:
>>
>>   E: The repository
>>      'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
>>      no longer has a Release file.
>>
>> This causes the job failure.
>> In most cases we don't really need any packages from these failed
>> repositories, so we could try to continue the job.
>>
>> Proviously this kind of failures happened on older branches with
>> ubuntu 16.04 base image, so we have this workaround already there.
>> Now it started to fail on bionic images, so fixing there too.
>>
>> Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
>> ---
> 
> Acked-by: Aaron Conole <aconole@redhat.com>
> 
> Incidentally, I was sure there was a way to ignore this condition (with
> something like -m instead), but that started me down a rabbit hole and I
> wasn't able to find the option anywhere.
> 

apt-get has '-m' a.k.a. '--ignore-missing', but I'm not sure if it will
affect this cese since it's for packages and not for broken repositories.

apt doesn't have this flag documented anywhere.
Ilya Maximets Feb. 1, 2021, 3:50 p.m. UTC | #6
On 2/1/21 12:56 PM, Ilya Maximets wrote:
> Some repositories that are enabled in GHA are not stable and lead
> to 'apt update' failures:
> 
>   E: The repository
>      'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
>      no longer has a Release file.
> 
> This causes the job failure.
> In most cases we don't really need any packages from these failed
> repositories, so we could try to continue the job.
> 
> Proviously this kind of failures happened on older branches with
> ubuntu 16.04 base image, so we have this workaround already there.
> Now it started to fail on bionic images, so fixing there too.
> 
> Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  .github/workflows/build-and-test.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
> index e24970505..1bb72bbb1 100644
> --- a/.github/workflows/build-and-test.yml
> +++ b/.github/workflows/build-and-test.yml
> @@ -136,7 +136,7 @@ jobs:
>          key:  ${{ env.matrix_key }}-${{ env.ci_key }}
>  
>      - name: update APT cache
> -      run:  sudo apt update
> +      run:  sudo apt update || true
>      - name: install common dependencies
>        if:   matrix.deb_package == ''
>        run:  sudo apt install -y ${{ env.dependencies }}
> 

Thanks, Aaron and David!

Applied to master and backported down to 2.12.

Best regards, Ilya Maximets.
Aaron Conole Feb. 1, 2021, 4:15 p.m. UTC | #7
Ilya Maximets <i.maximets@ovn.org> writes:

> On 2/1/21 3:08 PM, Aaron Conole wrote:
>> Ilya Maximets <i.maximets@ovn.org> writes:
>> 
>>> Some repositories that are enabled in GHA are not stable and lead
>>> to 'apt update' failures:
>>>
>>>   E: The repository
>>>      'https://apt.postgresql.org/pub/repos/apt bionic-pgdg Release'
>>>      no longer has a Release file.
>>>
>>> This causes the job failure.
>>> In most cases we don't really need any packages from these failed
>>> repositories, so we could try to continue the job.
>>>
>>> Proviously this kind of failures happened on older branches with
>>> ubuntu 16.04 base image, so we have this workaround already there.
>>> Now it started to fail on bionic images, so fixing there too.
>>>
>>> Fixes: 02f76fb42ae9 ("github: Fix Ubuntu package installation.")
>>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
>>> ---
>> 
>> Acked-by: Aaron Conole <aconole@redhat.com>
>> 
>> Incidentally, I was sure there was a way to ignore this condition (with
>> something like -m instead), but that started me down a rabbit hole and I
>> wasn't able to find the option anywhere.
>> 
>
> apt-get has '-m' a.k.a. '--ignore-missing', but I'm not sure if it will
> affect this cese since it's for packages and not for broken repositories.

That only affects packages, not the repositories.  I did try it on a
local machine.

> apt doesn't have this flag documented anywhere.

apt(8) documentation even says to use 'apt-get' et. al. in scripts
(which this is), but ubuntu specifically says not to do so.  It's a bit
confusing, TBH.
diff mbox series

Patch

diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index e24970505..1bb72bbb1 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -136,7 +136,7 @@  jobs:
         key:  ${{ env.matrix_key }}-${{ env.ci_key }}
 
     - name: update APT cache
-      run:  sudo apt update
+      run:  sudo apt update || true
     - name: install common dependencies
       if:   matrix.deb_package == ''
       run:  sudo apt install -y ${{ env.dependencies }}