Backporting small tweaks from the demo repo(s) (#842)

This commit is contained in:
Brian Kroth 2024-09-23 13:48:41 -05:00 коммит произвёл GitHub
Родитель ff349f7db9
Коммит 0e8ef2cf62
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -8,8 +8,13 @@ set -x
set -eu
scriptdir=$(dirname "$(readlink -f "$0")")
repo_root=$(readlink -f "$scriptdir/../..")
repo_name=$(basename "$repo_root")
cd "$scriptdir/"
DEVCONTAINER_IMAGE="devcontainer-cli:latest"
MLOS_AUTOTUNING_IMAGE="mlos-devcontainer:latest"
# Build the helper container that has the devcontainer CLI for building the devcontainer.
NO_CACHE=${NO_CACHE:-} ./build-devcontainer-cli.sh
@ -20,13 +25,13 @@ if [ -w /var/run/docker-host.sock ]; then
fi
# Build the devcontainer image.
rootdir=$(readlink -f "$scriptdir/../..")
rootdir="$repo_root"
# Run the initialize command on the host first.
# Note: command should already pull the cached image if possible.
pwd
devcontainer_json=$(cat "$rootdir/.devcontainer/devcontainer.json" | sed -e 's|//.*||' -e 's|/\*|\n&|g;s|*/|&\n|g' | sed -e '/\/\*/,/*\//d')
initializeCommand=$(echo "$devcontainer_json" | docker run -i --rm devcontainer-cli jq -e -r '.initializeCommand[]')
devcontainer_json=$(cat "$rootdir/.devcontainer/devcontainer.json" | sed -e 's|^\s*//.*||' -e 's|/\*|\n&|g;s|*/|&\n|g' | sed -e '/\/\*/,/*\//d')
initializeCommand=$(echo "$devcontainer_json" | docker run -i --rm $DEVCONTAINER_IMAGE jq -e -r '.initializeCommand[]')
if [ -z "$initializeCommand" ]; then
echo "No initializeCommand found in devcontainer.json" >&2
exit 1
@ -61,10 +66,10 @@ docker run -i --rm \
--env http_proxy=${http_proxy:-} \
--env https_proxy=${https_proxy:-} \
--env no_proxy=${no_proxy:-} \
devcontainer-cli \
$DEVCONTAINER_IMAGE \
devcontainer build --workspace-folder /src \
$devcontainer_build_args \
--image-name mlos-devcontainer:latest
--image-name $MLOS_AUTOTUNING_IMAGE
if [ "${CONTAINER_REGISTRY:-}" != '' ]; then
docker tag mlos-devcontainer:latest "$CONTAINER_REGISTRY/mlos-devcontainer:latest"
fi

Просмотреть файл

@ -82,7 +82,8 @@
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
"trond-snekvik.simple-rst",
"tyriar.sort-lines"
"tyriar.sort-lines",
"ms-toolsai.jupyter"
]
}
}