From 786264edbc7bb5f8cc67fa2fbaf0ba1e376ec7fd Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Fri, 18 Nov 2022 10:29:02 +0100 Subject: [PATCH] Add hack script to locate latest debug image --- debugd/README.md | 2 +- hack/find-image/find-image.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 hack/find-image/find-image.sh diff --git a/debugd/README.md b/debugd/README.md index 25f452ff9..40ed3b59b 100644 --- a/debugd/README.md +++ b/debugd/README.md @@ -22,7 +22,7 @@ With `cdbg` and `yq` installed in your path: 1. Run `constellation config generate` to create a new default configuration -2. Locate the latest debugd images for [GCP](/.github/docs/README.md#gcp) and [Azure](/.github/docs/README.md#azure) +2. Locate the latest debugd images by running `hack/find-image/find-image.sh` 3. Modify the `constellation-conf.yaml` to use an image with the debugd already included and add required firewall rules: diff --git a/hack/find-image/find-image.sh b/hack/find-image/find-image.sh new file mode 100755 index 000000000..7e382741c --- /dev/null +++ b/hack/find-image/find-image.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Copyright (c) Edgeless Systems GmbH +# +# SPDX-License-Identifier: AGPL-3.0-only + +# Usage: find-image.sh + +set -euo pipefail +shopt -s inherit_errexit + +base_url="https://cdn.confidential.cloud" +bucket="cdn-constellation-backend" +newest_debug_image_path=$(aws s3api list-objects-v2 \ + --output text \ + --bucket "${bucket}" \ + --prefix constellation/v1/images/debug-v \ + --query "reverse(sort_by(Contents, &LastModified))[0].Key") + +image_version_uid=$(basename "${newest_debug_image_path}" .json) +url="${base_url}/${newest_debug_image_path}" +echo "Found image version UID:" +echo "${image_version_uid}" + +echo "Containing the following images:" +echo "${url}" +curl -sL "${url}" | jq