Skip to content

Commit

Permalink
[8.12] [build] Remove ubi8 (#173873) (#174202)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.12`:
- [[build] Remove ubi8
(#173873)](#173873)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Jon","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-03T16:29:14Z","message":"[build]
Remove ubi8 (#173873)\n\nRHEL 8.10 will be the final ubi8 release. We
already have builds in\r\nplace for transitioning to
ubi9.\r\n\r\nDepends on
https://github.com/elastic/kibana/pull/170264.","sha":"7c2b3f1301803bec477af3f1e9657b8c2821619d","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v8.13.0"],"title":"[build]
Remove
ubi8","number":173873,"url":"https://github.com/elastic/kibana/pull/173873","mergeCommit":{"message":"[build]
Remove ubi8 (#173873)\n\nRHEL 8.10 will be the final ubi8 release. We
already have builds in\r\nplace for transitioning to
ubi9.\r\n\r\nDepends on
https://github.com/elastic/kibana/pull/170264.","sha":"7c2b3f1301803bec477af3f1e9657b8c2821619d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173873","number":173873,"mergeCommit":{"message":"[build]
Remove ubi8 (#173873)\n\nRHEL 8.10 will be the final ubi8 release. We
already have builds in\r\nplace for transitioning to
ubi9.\r\n\r\nDepends on
https://github.com/elastic/kibana/pull/170264.","sha":"7c2b3f1301803bec477af3f1e9657b8c2821619d"}}]}]
BACKPORT-->

Co-authored-by: Jon <[email protected]>
  • Loading branch information
kibanamachine and jbudz authored Jan 3, 2024
1 parent 1d6a90d commit 412e61f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
4 changes: 0 additions & 4 deletions .buildkite/scripts/steps/artifacts/docker_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ case $KIBANA_DOCKER_CONTEXT in
cloud)
DOCKER_CONTEXT_FILE="kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
;;
ubi8)
DOCKER_CONTEXT_FILE="kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz"
;;
ubi)
# Currently ubi9. After ubi8 we're moving to a version agnostic filename
DOCKER_CONTEXT_FILE="kibana-ubi-$FULL_VERSION-docker-build-context.tar.gz"
;;
ironbank)
Expand Down
15 changes: 2 additions & 13 deletions src/dev/build/tasks/os_packages/create_os_package_tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,7 @@ export const CreateDockerUBI: Task = {
async run(config, log, build) {
await runDockerGenerator(config, log, build, {
architecture: 'x64',
baseImage: 'ubi8',
context: false,
image: true,
});
await runDockerGenerator(config, log, build, {
architecture: 'x64',
baseImage: 'ubi9',
baseImage: 'ubi',
context: false,
image: true,
});
Expand Down Expand Up @@ -154,12 +148,7 @@ export const CreateDockerContexts: Task = {
dockerBuildDate,
});
await runDockerGenerator(config, log, build, {
baseImage: 'ubi8',
context: true,
image: false,
});
await runDockerGenerator(config, log, build, {
baseImage: 'ubi9',
baseImage: 'ubi',
context: true,
image: false,
});
Expand Down
8 changes: 3 additions & 5 deletions src/dev/build/tasks/os_packages/docker_generator/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function runDockerGenerator(
build: Build,
flags: {
architecture?: string;
baseImage: 'none' | 'ubi9' | 'ubi8' | 'ubuntu';
baseImage: 'none' | 'ubi' | 'ubuntu';
context: boolean;
image: boolean;
ironbank?: boolean;
Expand All @@ -40,12 +40,10 @@ export async function runDockerGenerator(
) {
let baseImageName = '';
if (flags.baseImage === 'ubuntu') baseImageName = 'ubuntu:20.04';
if (flags.baseImage === 'ubi8') baseImageName = 'docker.elastic.co/ubi8/ubi-minimal:latest';
if (flags.baseImage === 'ubi9') baseImageName = 'docker.elastic.co/ubi9/ubi-minimal:latest';
if (flags.baseImage === 'ubi') baseImageName = 'docker.elastic.co/ubi9/ubi-minimal:latest';

let imageFlavor = '';
if (flags.baseImage === 'ubi8') imageFlavor += `-ubi8`;
if (flags.baseImage === 'ubi9') imageFlavor += `-ubi`;
if (flags.baseImage === 'ubi') imageFlavor += `-ubi`;
if (flags.ironbank) imageFlavor += '-ironbank';
if (flags.cloud) imageFlavor += '-cloud';
if (flags.serverless) imageFlavor += '-serverless';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface TemplateContext {
dockerBuildDate: string;
usePublicArtifact?: boolean;
publicArtifactSubdomain: string;
baseImage: 'none' | 'ubi8' | 'ubi9' | 'ubuntu';
baseImage: 'none' | 'ubi' | 'ubuntu';
baseImageName: string;
cloud?: boolean;
serverless?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function generator(options: TemplateContext) {
const dir = options.ironbank ? 'ironbank' : 'base';
const template = readFileSync(resolve(__dirname, dir, './Dockerfile'));
return Mustache.render(template.toString(), {
packageManager: options.baseImage.includes('ubi') ? 'microdnf' : 'apt-get',
ubi: options.baseImage.includes('ubi'),
packageManager: options.baseImage === 'ubi' ? 'microdnf' : 'apt-get',
ubi: options.baseImage === 'ubi',
ubuntu: options.baseImage === 'ubuntu',
opensslLegacyProvider: !(options.cloud || options.serverless),
...options,
Expand Down

0 comments on commit 412e61f

Please sign in to comment.