From ca48a0d0f733e3477738041b28a624411ee9afd6 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:59:18 +0100 Subject: [PATCH] [wasm] Codespaces need more disc to succeed building on container creation (#99803) * Debug * Building steps logging. * Chop up restore and clean cache in between * Restore does not take as much space as codespaces setup files in "/workspaces/.codespaces". * Try removing the biggest offender. * Cannot see the impact of cleanup on the size check logs. * Move setup code into post-create * Pass arg to the script, otherwise nothing is triggered * Move all commands up to restore to onCreate. Restore should be done after codespaces setup when occupied disc space drops. * Fix: wasm does not have artifacts dir on writing to this file. * This would work but is not 100% reliable - user can interact with the VM before the command finishes. * Build subset by subset. * Easy fix - requre bigger disc. --- .devcontainer/scripts/onCreateCommand.sh | 2 +- .devcontainer/scripts/postCreateCommand.sh | 2 +- .devcontainer/wasm-multiThreaded/devcontainer.json | 5 +++-- .devcontainer/wasm/devcontainer.json | 5 +++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.devcontainer/scripts/onCreateCommand.sh b/.devcontainer/scripts/onCreateCommand.sh index 779ced4de99b98..6c2527c7d1eff0 100755 --- a/.devcontainer/scripts/onCreateCommand.sh +++ b/.devcontainer/scripts/onCreateCommand.sh @@ -49,4 +49,4 @@ case "$opt" in esac # save the commit hash of the currently built assemblies, so developers know which version was built -git rev-parse HEAD > ./artifacts/prebuild.sha +git rev-parse HEAD > ./artifacts/prebuild.sha \ No newline at end of file diff --git a/.devcontainer/scripts/postCreateCommand.sh b/.devcontainer/scripts/postCreateCommand.sh index b50fb9a7009fff..4ca45cc03fbb42 100755 --- a/.devcontainer/scripts/postCreateCommand.sh +++ b/.devcontainer/scripts/postCreateCommand.sh @@ -11,4 +11,4 @@ case "$opt" in esac # reset the repo to the commit hash that was used to build the prebuilt Codespace -git reset --hard $(cat ./artifacts/prebuild.sha) +git reset --hard $(cat ./artifacts/prebuild.sha) \ No newline at end of file diff --git a/.devcontainer/wasm-multiThreaded/devcontainer.json b/.devcontainer/wasm-multiThreaded/devcontainer.json index db3b2981b57149..b885a0f3620f42 100644 --- a/.devcontainer/wasm-multiThreaded/devcontainer.json +++ b/.devcontainer/wasm-multiThreaded/devcontainer.json @@ -10,7 +10,8 @@ }, "hostRequirements": { "cpus": 4, - "memory": "8gb" + "memory": "8gb", + "storage": "40gb" }, "features": { @@ -40,7 +41,7 @@ "onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/onCreateCommand.sh wasm-multithreaded", // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh", + "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh wasm-multithreaded", // Add the locally installed dotnet to the path to ensure that it is activated // This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used. diff --git a/.devcontainer/wasm/devcontainer.json b/.devcontainer/wasm/devcontainer.json index f4144299ff11d3..c9becdc18994d3 100644 --- a/.devcontainer/wasm/devcontainer.json +++ b/.devcontainer/wasm/devcontainer.json @@ -10,7 +10,8 @@ }, "hostRequirements": { "cpus": 4, - "memory": "8gb" + "memory": "8gb", + "storage": "40gb" }, "features": { @@ -40,7 +41,7 @@ "onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/onCreateCommand.sh wasm", // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh", + "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh wasm", // Add the locally installed dotnet to the path to ensure that it is activated // This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used.