feat: implement lab 6 observability and telemetry cost research
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# Локальный Compose для машины замеров; установленный Docker не меняется.
|
||||
set -eu
|
||||
if [ "$(uname -sm)" != 'Darwin arm64' ]; then
|
||||
echo 'This helper is for macOS arm64; set LAB6_COMPOSE_CLI to Compose 5.6.1 on other hosts.' >&2
|
||||
exit 2
|
||||
fi
|
||||
root=$(CDPATH= cd "$(dirname "$0")/../.." && pwd)
|
||||
cache_dir="$root/.local-tools/compose-v5.6.1"
|
||||
expected=fcce41226abd2b7b2936094e688bbd61284673dddafea542e08cb9a3b4423a8b
|
||||
mkdir -p "$cache_dir"
|
||||
if [ -x "$cache_dir/docker-compose" ]; then
|
||||
actual=$(shasum -a 256 "$cache_dir/docker-compose" | awk '{print $1}')
|
||||
if [ "$actual" = "$expected" ]; then
|
||||
"$cache_dir/docker-compose" version
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
download_file=$(mktemp "$cache_dir/download.XXXXXX")
|
||||
trap 'rm -f "$download_file"' EXIT
|
||||
curl --fail --location --silent --show-error --max-time 60 \
|
||||
https://github.com/docker/compose/releases/download/v5.6.1/docker-compose-darwin-aarch64 \
|
||||
--output "$download_file"
|
||||
actual=$(shasum -a 256 "$download_file" | awk '{print $1}')
|
||||
if [ "$actual" != "$expected" ]; then
|
||||
echo 'Compose checksum mismatch; installation stopped.' >&2
|
||||
exit 1
|
||||
fi
|
||||
chmod +x "$download_file"
|
||||
mv "$download_file" "$cache_dir/docker-compose"
|
||||
"$cache_dir/docker-compose" version
|
||||
Reference in New Issue
Block a user