From 3a13ba8f85adf62d8de1a63a5f12f1816399d6ea Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Mon, 11 Nov 2024 23:31:40 +0530 Subject: [PATCH 1/3] chore(updatecli):Track docker image digests for ubuntu 22_04 AMD64 and ARM64 Signed-off-by: jayfranco999 --- images-versions.yaml | 6 ++- sources.pkr.hcl | 2 +- .../docker-ubuntu-22-04-amd64-images.yml | 43 +++++++++++++++++++ .../docker-ubuntu-22-04-arm64-images.yml | 43 +++++++++++++++++++ 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml create mode 100644 updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml diff --git a/images-versions.yaml b/images-versions.yaml index f2741025b..0ce79a234 100644 --- a/images-versions.yaml +++ b/images-versions.yaml @@ -1,4 +1,3 @@ -# images-versions.yaml --- azure: windows: @@ -15,3 +14,8 @@ aws: "22.04": amd64: ami-00eb69d236edcfaf8 arm64: ami-039e419d24a37cb82 +docker: + ubuntu: + "22.04": + amd64: sha256:3d1556a8a18cf5307b121e0a98e93f1ddf1f3f8e092f1fddfd941254785b95d7 + arm64: sha256:7c75ab2b0567edbb9d4834a2c51e462ebd709740d1f2c40bcd23c56e974fe2a8 diff --git a/sources.pkr.hcl b/sources.pkr.hcl index d6a215a37..01c2b264d 100644 --- a/sources.pkr.hcl +++ b/sources.pkr.hcl @@ -74,7 +74,7 @@ source "azure-arm" "base" { # This source defines all the common settings for any Azure image (whatever Operating System) source "docker" "base" { - image = "${var.agent_os_type}:${var.agent_os_version}" + image = try(local.images_versions["docker"]["ubuntu"][var.agent_os_version][var.architecture], "N/A") # Persist image on local docker engine commit = true diff --git a/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml new file mode 100644 index 000000000..14111fc91 --- /dev/null +++ b/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml @@ -0,0 +1,43 @@ +--- +name: Bump docker `ubuntu 22_04 amd64` image version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastDockerDigest: + kind: dockerdigest + spec: + image: "ubuntu" + tag: "22.04" + architecture: "amd64" + +targets: + updateDigest: + name: Update docker `ubuntu 22_04 amd64` image version in locals + sourceid: lastDockerDigest + kind: yaml + spec: + file: ./images-versions.yaml + key: $.docker.ubuntu.'22.04'.amd64 + transformers: + - trimprefix: '22.04@' + +actions: + default: + kind: github/pullrequest + scmid: default + spec: + title: Bump docker `ubuntu 22_04 amd64` image version + description: "Follow up docker images for ubuntu 22_04 amd64" + labels: + - enhancement diff --git a/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml b/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml new file mode 100644 index 000000000..691d8e75c --- /dev/null +++ b/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml @@ -0,0 +1,43 @@ +--- +name: Bump docker `ubuntu 22_04 arm64` image version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastDockerDigest: + kind: dockerdigest + spec: + image: "ubuntu" + tag: "22.04" + architecture: "arm64" + +targets: + updateDigest: + name: Update docker `ubuntu 22_04 arm64` image version in locals + sourceid: lastDockerDigest + kind: yaml + spec: + file: ./images-versions.yaml + key: $.docker.ubuntu.'22.04'.arm64 + transformers: + - trimprefix: '22.04@' + +actions: + default: + kind: github/pullrequest + scmid: default + spec: + title: Bump docker `ubuntu 22_04 arm64` image version + description: "Follow up docker images for ubuntu 22_04 arm64" + labels: + - enhancement From b4f09fa62eba8b9608c1567b6f66f2610c408332 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Mon, 11 Nov 2024 23:35:08 +0530 Subject: [PATCH 2/3] fixup Signed-off-by: jayfranco999 --- images-versions.yaml | 1 + updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml | 1 + updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/images-versions.yaml b/images-versions.yaml index 0ce79a234..c6d58082f 100644 --- a/images-versions.yaml +++ b/images-versions.yaml @@ -1,3 +1,4 @@ +# images-versions.yaml --- azure: windows: diff --git a/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml index 14111fc91..6f0dcd070 100644 --- a/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml @@ -26,6 +26,7 @@ targets: name: Update docker `ubuntu 22_04 amd64` image version in locals sourceid: lastDockerDigest kind: yaml + scmid: default spec: file: ./images-versions.yaml key: $.docker.ubuntu.'22.04'.amd64 diff --git a/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml b/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml index 691d8e75c..541885efa 100644 --- a/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml +++ b/updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml @@ -26,6 +26,7 @@ targets: name: Update docker `ubuntu 22_04 arm64` image version in locals sourceid: lastDockerDigest kind: yaml + scmid: default spec: file: ./images-versions.yaml key: $.docker.ubuntu.'22.04'.arm64 From 11996db469832014abebb08026b6632f6bafbdc7 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Tue, 12 Nov 2024 20:48:28 +0530 Subject: [PATCH 3/3] fixup Signed-off-by: jayfranco999 --- sources.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources.pkr.hcl b/sources.pkr.hcl index 01c2b264d..14de8a67b 100644 --- a/sources.pkr.hcl +++ b/sources.pkr.hcl @@ -74,7 +74,7 @@ source "azure-arm" "base" { # This source defines all the common settings for any Azure image (whatever Operating System) source "docker" "base" { - image = try(local.images_versions["docker"]["ubuntu"][var.agent_os_version][var.architecture], "N/A") + image = try("${var.agent_os_type}@${local.images_versions["docker"]["ubuntu"][var.agent_os_version][var.architecture]}", "N/A") # Persist image on local docker engine commit = true