[PATCH v10 07/17] CI: Use Fedora 35 container (Linux only)


Michael Kubacki
 

Reviewed-by: Michael Kubacki <michael.kubacki@...>

On 12/1/2022 3:28 PM, Oliver Steffen wrote:
Run all Linux based jobs in a container, using a custom Fedora 35 image
(gcc 11). The image is hosted on ghcr.io and the Dockerfiles are
here: https://github.com/tianocore/containers
The version numbers of gcc, iasl, and nasm are pinned to avoid
unintended upgrades during image rebuild.
Do not run apt-get in CI jobs to install qemu and gcc dependencies.
Assume the container image provides these.
Use Python from the container image, do not download at runtime.
Signed-off-by: Oliver Steffen <osteffen@...>
---
.azurepipelines/Ubuntu-GCC5.yml | 6 ++----
.azurepipelines/templates/basetools-build-steps.yml | 9 ---------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml
index 4ed6cb601b8e..ca23b684e222 100644
--- a/.azurepipelines/Ubuntu-GCC5.yml
+++ b/.azurepipelines/Ubuntu-GCC5.yml
@@ -13,14 +13,12 @@ pr:
- master
- stable/*
-variables:
- - template: templates/defaults.yml
-
jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'GCC5'
vm_image: 'ubuntu-latest'
+ container: 'ghcr.io/tianocore/containers/fedora-35-build:2113a0e'
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
- usePythonVersion: ${{ variables.default_python_version }}
+ usePythonVersion: '' # use Python from the container image
diff --git a/.azurepipelines/templates/basetools-build-steps.yml
b/.azurepipelines/templates/basetools-build-steps.yml
index d8c108c6e212..a72758bc3395 100644
--- a/.azurepipelines/templates/basetools-build-steps.yml
+++ b/.azurepipelines/templates/basetools-build-steps.yml
@@ -10,15 +10,6 @@ parameters:
tool_chain_tag: ''
steps:
-- ${{ if contains(parameters.tool_chain_tag, 'GCC') }}:
- - bash: sudo apt-get update
- displayName: Update apt
- condition: and(gt(variables.pkg_count, 0), succeeded())
-
- - bash: sudo apt-get install gcc g++ make uuid-dev
- displayName: Install required tools
- condition: and(gt(variables.pkg_count, 0), succeeded())
-
- task: CmdLine@1
displayName: Build Base Tools from source
inputs:


Oliver Steffen
 

Run all Linux based jobs in a container, using a custom Fedora 35 image
(gcc 11). The image is hosted on ghcr.io and the Dockerfiles are
here: https://github.com/tianocore/containers
The version numbers of gcc, iasl, and nasm are pinned to avoid
unintended upgrades during image rebuild.

Do not run apt-get in CI jobs to install qemu and gcc dependencies.
Assume the container image provides these.

Use Python from the container image, do not download at runtime.

Signed-off-by: Oliver Steffen <osteffen@...>
---
.azurepipelines/Ubuntu-GCC5.yml | 6 ++----
.azurepipelines/templates/basetools-build-steps.yml | 9 ---------
2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml
index 4ed6cb601b8e..ca23b684e222 100644
--- a/.azurepipelines/Ubuntu-GCC5.yml
+++ b/.azurepipelines/Ubuntu-GCC5.yml
@@ -13,14 +13,12 @@ pr:
- master
- stable/*

-variables:
- - template: templates/defaults.yml
-
jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'GCC5'
vm_image: 'ubuntu-latest'
+ container: 'ghcr.io/tianocore/containers/fedora-35-build:2113a0e'
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
- usePythonVersion: ${{ variables.default_python_version }}
+ usePythonVersion: '' # use Python from the container image

diff --git a/.azurepipelines/templates/basetools-build-steps.yml
b/.azurepipelines/templates/basetools-build-steps.yml
index d8c108c6e212..a72758bc3395 100644
--- a/.azurepipelines/templates/basetools-build-steps.yml
+++ b/.azurepipelines/templates/basetools-build-steps.yml
@@ -10,15 +10,6 @@ parameters:
tool_chain_tag: ''

steps:
-- ${{ if contains(parameters.tool_chain_tag, 'GCC') }}:
- - bash: sudo apt-get update
- displayName: Update apt
- condition: and(gt(variables.pkg_count, 0), succeeded())
-
- - bash: sudo apt-get install gcc g++ make uuid-dev
- displayName: Install required tools
- condition: and(gt(variables.pkg_count, 0), succeeded())
-
- task: CmdLine@1
displayName: Build Base Tools from source
inputs:
--
2.38.1