kubernetes-csi / csi-release-tools

shared build and test files used by kubernetes-csi projects
Apache License 2.0
21 stars 71 forks source link

Add parameter base_image and addon_image to BUILD_PLATFORMS #150

Closed mauriciopoppe closed 3 years ago

mauriciopoppe commented 3 years ago

Fixes #145

Adds new parameters in BUILD_PLATFORMS referred as base_image and addon_image with the format image:tag

make push-multiarch BUILD_PLATFORMS="linux amd64; windows amd64 .exe nanoserver:2019 servercore:2019;

List of changes:

Output of some snippets used here:

build_platforms=build_platforms="linux amd64; linux ppc64le -ppc64le; linux s390x -s390x; linux arm64 -arm64; windows amd64 .exe nanoserver:1809 servercore:ltsc2019; windows amd64 .exe nanoserver:1909 servercore:1909; windows amd64 .exe nanoserver:2004 servercore:2004; windows amd64 .exe nanoserver:20H2 servercore:20H2"
echo "$build_platforms" | sed -e 's/windows *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$//'
linux amd64; linux ppc64le -ppc64le; linux s390x -s390x; linux arm64 -arm64

I used these changes in node-driver-registrar to push all the windows images as well as the manifest:

image

Manifest contents of the canary manifest:

{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 738,
         "digest": "sha256:619f0eb76b5b704fe351dacc26b94368e7e0db60a1fefcd8605aeb3e7e81874e",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 950,
         "digest": "sha256:5a21cee79643052c985a0d7073bef60f36711c83d74f58e94605c3e8a1ae6abf",
         "platform": {
            "architecture": "amd64",
            "os": "windows",
            "os.version": "10.0.17763.1935"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 950,
         "digest": "sha256:b5f11b3fe645a67b3ae2ab3bf32403670c6c454c4ab19e72a41c052035613873",
         "platform": {
            "architecture": "amd64",
            "os": "windows",
            "os.version": "10.0.18363.1556"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 950,
         "digest": "sha256:fe8327a9e9d3c2c73fa117cb4b635fc2c4f3f501e217ffe4f36bb6918cb63b3e",
         "platform": {
            "architecture": "amd64",
            "os": "windows",
            "os.version": "10.0.19041.985"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 950,
         "digest": "sha256:fe57e7ddfcec7008290dbf998c131ac5d98c8514326555d8fb24607b17e7ca0a",
         "platform": {
            "architecture": "amd64",
            "os": "windows",
            "os.version": "10.0.19042.985"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 738,
         "digest": "sha256:cd870ccc4e58a592195e3af0cc3e690cc009a6fce7a47deaedc7583ccc335310",
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 738,
         "digest": "sha256:56e373d03c5a0e00d8e09912d462984bd5169433fca887505310f4b179430386",
         "platform": {
            "architecture": "ppc64le",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 738,
         "digest": "sha256:a11755a59d704d2da641794aa31235875f1d2b65d24810831b952220fcdec86f",
         "platform": {
            "architecture": "s390x",
            "os": "linux"
         }
      }
   ]
}

/assign @pohly @jingxu97

k8s-ci-robot commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mauriciopoppe, pohly

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-csi/csi-release-tools/blob/master/OWNERS)~~ [pohly] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
mauriciopoppe commented 3 years ago

@pohly I made a small change to the name of the image, from amd64-nanoserver-20H2-windows-canary to amd64-windows-nanoserver-20H2-canary, the lgtm tag was removed because of this

pohly commented 3 years ago

/release-note-none

mauriciopoppe commented 3 years ago

@pohly so sorry I lost your comment, are the images in csi-driver-host-path still failing because of this?

mauriciopoppe commented 3 years ago

@pohly I just checked that you added the missing $ in https://github.com/kubernetes-csi/csi-release-tools/commit/5561780172df4a863139f8677905f112758cea82, thank you and sorry about missing this.