Comment 2 for bug 1998607

Revision history for this message
Adam Dyess (addyess) wrote (last edit ):

While this above image update in #1 is nice -- it doesn't solve the problem that the oci-image resource is still solely amd64. The only current solution is to build the coredns charm for a specific bases-index and match its release with the appropriate architecture resource

Pseudo code of process would be something like this:
* change the charmcraft.yaml to split the bases apart by supported arch:

bases:
  - build-on: # bases-index 0
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
  - build-on: # bases-index 1
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["arm"]
  - build-on: # bases-index 2
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["arm64"]
  - build-on: # bases-index 3
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["ppc64le"]
  - build-on: # bases-index 4
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["s390x"]

for arch in charmcraft.yaml:
    charm_file = $(charmcraft pack -v --bases-index $(index_from_arch $arch))
    charm_id = $(charmcraft upload $charm_file)
    docker pull --platform=linux/$arch ${upstream_image}
    resource_id = $(charmcraft upload-resource --image resource-name ${upstream_image})
    charmcraft release coredns --revision=${charm_id} --resource resource-name=${resource_id}
done