"lib/bindings/vscode:/vscode.git/clone" did not exist on "910b587db1a605c2f70355c6963582928ffa80fa"
Unverified Commit a818a4bd authored by Nate Mailhot's avatar Nate Mailhot Committed by GitHub
Browse files

fix: expand docker metric fields (#7601)

parent ee3de9e4
......@@ -237,6 +237,21 @@ runs:
mkdir -p build-metrics
METRICS_FILE="build-metrics/metrics-${{ inputs.framework }}-${PLATFORM_ARCH}-${{ github.run_id }}-${{ job.check_run_id }}.json"
# Extract additional metadata from the built image
if [ -n "$IMAGE_TAG" ]; then
PYTHON_VERSION=$(docker run --rm "$IMAGE_TAG" python3 --version 2>/dev/null | awk '{print $2}' || echo "unknown")
if [ -z "$PYTHON_VERSION" ]; then
PYTHON_VERSION="unknown"
fi
BASE_IMAGE=$(docker image inspect "$IMAGE_TAG" --format='{{index .Config.Labels "org.opencontainers.image.base.name"}}' 2>/dev/null || echo "unknown")
if [ -z "$BASE_IMAGE" ] || [ "$BASE_IMAGE" = "<no value>" ]; then
BASE_IMAGE="unknown"
fi
else
PYTHON_VERSION="unknown"
BASE_IMAGE="unknown"
fi
# Create the job metrics file
cat > "$METRICS_FILE" << EOF
{
......@@ -244,6 +259,10 @@ runs:
"target": "${{ inputs.target }}",
"platform": "${{ inputs.platform }}",
"platform_arch": "${PLATFORM_ARCH}",
"cuda_version": "${{ inputs.cuda_version }}",
"image_tag": "${IMAGE_TAG}",
"python_version": "${PYTHON_VERSION}",
"base_image": "${BASE_IMAGE}",
"image_size_bytes": ${IMAGE_SIZE_BYTES},
"build_start_time": "${BUILD_START_TIME}",
"build_end_time": "${BUILD_END_TIME}",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment