# OEM metapackages & Concourse CI
###### $4
https://hackmd.io/@fourdollars/oem-metapackages-and-concourse-ci
---
## Who am I?
FourDollars aka $4
- Debian Developer / Ubuntu Contributing Developer / GNOME Emeritus Member / Canonical Employee
- Vim :heart:
[Plurk](https://www.plurk.com/fourdollars)
----
[LinkedIn](https://www.linkedin.com/in/fourdollars/)
---
## What are OEM metapackages?
[Ubuntu 20.04 LTS Aims To Enhance The Certified OEM Experience From Its Installer - Phoronix](https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-20.04-Certified-OEM-Exp) and [Providing opt-in upgrade path to the OEM Archives from the Ubuntu Archive](https://lists.ubuntu.com/archives/technical-board/2020-January/002478.html).
----
### Roughly saying, to provide an OEM metapackage to use the specific kernel.
```mermaid
gantt
dateFormat YYYY-MM
axisFormat %Y-%m
title Ubuntu 20.04.X LTS
section oem kernels
oem-20.04 (5.6) -> oem-20.04b :done, 5.6, 2020-04, 2021-06
oem-20.04b (5.10) -> oem-20.04d :done, 5.10, 2021-01, 2022-01
oem-20.04c (5.13) -> oem-20.04d :done, 5.13, 2021-07, 2022-01
oem-20.04d (5.14) :active, 5.14, 2021-09, 2022-08
section generic/hwe kernels
hwe-20.04 (5.4) :done, 5.4, 2020-04, 2020-10
hwe-20.04 (5.8) :done, 5.8, 2020-10, 2021-08
hwe-20.04 (5.11) :done, 5.11, 2021-08, 2022-03
hwe-20.04 (5.13) :done, 5.13, 2022-03, 2022-06
hwe-20.04 (5.15) :active, 5.15, 2022-06, 2022-08
generic (5.4) :active, 5.4, 2020-04, 2022-08
```
----
### How does it work?
* Use the modaliases to match the machine.
* Use ubuntu-driver and (ubiquity or update-manager) to install OEM metapackages.
----
#### What are the modaliases?
> Modalias is a little sysfs trick that exports hardware information to a file named 'modalias'.
[Modalias - ArchWiki](https://wiki.archlinux.org/title/Modalias)
```bash
$ find /sys -name modalias 2>/dev/null | sort
...
/sys/devices/system/cpu/modalias
/sys/devices/virtual/dmi/id/modalias
```
----
#### What is ubuntu-driver?
> Detect and install additional Ubuntu driver packages
```bash
$ ubuntu-drivers list
nvidia-driver-460, (kernel modules provided by linux-modules-nvidia-460-oem-20.04b)
nvidia-driver-470, (kernel modules provided by linux-modules-nvidia-470-oem-20.04b)
...
$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001CBDsv00001028sd000009C2bc03sc02i00
vendor : NVIDIA Corporation
model : GP107GLM [Quadro P620]
...
driver : nvidia-driver-460 - distro non-free
driver : nvidia-driver-470 - distro non-free recommended
driver : xserver-xorg-video-nouveau - distro free builtin
```
----
#### update-manager
![](https://i.imgur.com/JyRgFrN.png)
---
## What is Concourse CI?
----
> Concourse is an open-source continuous thing-doer.
> Built on the simple mechanics of resources, tasks, and jobs, Concourse presents a general approach to automation that makes it great for CI/CD.
https://concourse-ci.org/
----
Using YAML to define the pipelines
<iframe width="100%" height="500" src="https://ci.concourse-ci.org/" frameborder="0"></iframe>
https://ci.concourse-ci.org/
----
> Concourse admittedly has a steeper learning curve at first, and depending on your background it might be a lot to take in. A core goal of this project is for the curve to flatten out shortly after and result in higher productivity and less stress over time.
https://concourse-ci.org/docs.html
----
## Some notes
* Only support Docker container
* Only support amd64/x86_64 architecure
* The pipeline doesn't support if/else branches
* You need to familiar with YAML and JSON
---
[Concourse 是什麼? - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天](https://ithelp.ithome.com.tw/articles/10184547) by [蒼時弦也](https://ithelp.ithome.com.tw/users/20065771/ironman)
> Concourse 是一套 CI/CD 工具,由 [Cloud Foundry](https://www.cloudfoundry.org/) 所開發。主要是因為 Cloud Foundry 在處理 CI/CD 問題時發現現有的工具無法解決他們的需求,因此開發 Concourse 這套 CI/CD 工具。
----
> Concourse 是一套基於 Pipeline 所設計的 CI/CD 工具,一個專案就是由一個 Pipeline 所構成。不論是測試還是部署,所有的任務都可以透過定義 Pipeline 完成。
----
> Concourse 並沒有插件的概念,但是卻保有著高度的可自訂性。對 Concourse 來說**所謂的擴充性是透過 Resource 來達成的**,基於 Resource 和 Job 的組合就可以做到各種多變的 CI/CD 配置。
---
### Some resource types made by $4
* [fourdollars/samba-resource](https://github.com/fourdollars/samba-resource)
* [fourdollars/webdav-resource](https://github.com/fourdollars/webdav-resource)
* [fourdollars/dput-ppa-resource](https://github.com/fourdollars/dput-ppa-resource)
* [fourdollars/autopkgtest-resource](https://github.com/fourdollars/autopkgtest-resource)
* [fourdollars/deb-versions-resource](https://github.com/fourdollars/deb-versions-resource)
* [fourdollars/mattermost-notification-resource](https://github.com/fourdollars/mattermost-notification-resource)
* [fourdollars/launchpad-bug-resource](https://github.com/fourdollars/launchpad-bug-resource)
* [fourdollars/jenkins-resource](https://github.com/fourdollars/jenkins-resource)
* [fourdollars/rclone-resource](https://github.com/fourdollars/rclone-resource)
----
## Introduce WebDAV resource
[![GitHub: fourdollars/webdav-resource](https://img.shields.io/badge/GitHub-fourdollars%2Fwebdav%E2%80%90resource-darkgreen.svg?style=flat-square&logo=github)](https://github.com/fourdollars/webdav-resource/)
![](https://i.imgur.com/yZYoAA7.png)
----
pipeline.yml
```yaml
resource_types:
- name: webdav
type: registry-image
source:
repository: ghcr.io/fourdollars/webdav-resource
defaults:
domain: webdav
username: webdav
password: webdav
ssl: false
resources:
- name: demo-storage
type: webdav
icon: nas
source:
path: demo
- name: ubuntu-focal
type: registry-image
icon: ubuntu
source:
repository: ubuntu
tag: focal
jobs:
- name: check-demo-message
plan:
- get: ubuntu-focal
- get: demo-storage
trigger: true
- task: check-message
image: ubuntu-focal
config:
platform: linux
inputs:
- name: demo-storage
run:
path: cat
args:
- demo-storage/msg.log
```
----
# Live Demo
---
## How to use Concourse CI on OEM metapackages?
----
Canonical employees maintain the OEM metapackages on [oem-somerville-projects-meta](https://code.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-somerville-projects-meta), [oem-stella-projects-meta](https://code.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-stella-projects-meta) and [oem-sutton-projects-meta](https://code.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-sutton-projects-meta).
----
$4 maintains the CI/CD pipelines on [lp:~fourdollars/+git/meta-ci](https://code.launchpad.net/~fourdollars/+git/meta-ci) and the dashboard on https://people.ubuntu.com/~fourdollars/oem-meta-packages/.
----
![Concourse CI](https://i.imgur.com/4MPqgDf.png)
----
![OEM metapackages](https://i.imgur.com/YP8HE26.png)
----
There is a CI/CD pipeline job to watch the branches of [oem-somerville-projects-meta](https://code.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-somerville-projects-meta), [oem-stella-projects-meta](https://code.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-stella-projects-meta) and [oem-sutton-projects-meta](https://code.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-sutton-projects-meta) to update [lp:~fourdollars/+git/meta-ci](https://code.launchpad.net/~fourdollars/+git/meta-ci) automatically.
It just needs to modify project.tmpl.yml or ubuntu.tmpl.yml in [lp:~fourdollars/+git/meta-ci](https://code.launchpad.net/~fourdollars/+git/meta-ci) to add more tests.
----
# Live Demo
---
# The End
## Q&A
{"metaMigratedAt":"2023-06-16T08:14:23.881Z","metaMigratedFrom":"YAML","title":"OEM metapackages & Concourse CI","breaks":true,"slideOptions":"{\"transition\":\"slide\",\"allottedMinutes\":45}","contributors":"[{\"id\":\"bf86f028-d66e-4ad3-b300-1ac45ed078ed\",\"add\":9187,\"del\":1365}]"}