Repository navigation
docs: add a Windows (WSL) setup guide and setup scripts - #1443
Shulamit sharabani (SHULMIT) wants to merge 7 commits into
Conversation
|
@microsoft-github-policy-service agree |
|
Hello Shulamit sharabani (@SHULMIT), The overall structure looks good, and the local HTTPS certificate in Windows is a great point. Here are some comments:
In parallel of your documentation work, I was working on two scripts (one from outside of WSL, one inside) to complete the install automatically. This setup script should be the basis of future devcontainer support. They should be integrated into that doc as well. |
Import the two setup scripts from https://gist.github.com/cmaneu/03e857b16ee36788962a9355d738970b unchanged, so the follow-up adaptations are reviewable on their own: - scripts/setup-windows-wsl.ps1 (scope-wsl.ps1): elevated PowerShell that updates WSL, installs Ubuntu and installs Docker Desktop with the WSL 2 backend. - scripts/setup-linux-prereqs.sh (scope-setup.sh): checks and installs the Linux prerequisites (Node.js 22, Corepack/pnpm, Docker, mkcert, gh). Refs microsoft#1419 Co-authored-by: Christopher MANEU <790974+cmaneu@users.noreply.github.com>
Adapt the imported scripts for use from the repository: - setup-windows-wsl.ps1: add the license header, and end with steps that clone Scope into the WSL filesystem and run the checked-in setup-linux-prereqs.sh instead of downloading a gist revision. The script then matches the checkout's pinned versions. - setup-linux-prereqs.sh: when run as root (devcontainers, containers), $SUDO is empty and `$SUDO -E bash -` ran a command named "-E"; pipe to plain `bash` instead. $USER is unset there and aborted the script under `set -u`, so use `id -un`. - setup-linux-prereqs.sh: only suggest DOCKER_GID for Docker Engine. Docker Desktop (including WSL) mounts its socket as root:root 0660 in containers, which the Compose default of 0 already matches. Refs microsoft#1419 Co-authored-by: Christopher MANEU <790974+cmaneu@users.noreply.github.com>
Address the review on microsoft#1443: - Start with the scripted path: setup-windows-wsl.ps1 in an elevated PowerShell, then setup-linux-prereqs.sh from the checkout in Ubuntu. - Detail installing WSL 2 and Ubuntu (distribution, first-run user, version and default checks) and Docker Desktop (WSL 2 backend, WSL Integration, verification, DOCKER_GID left unset). - Target Ubuntu 22.04/24.04 with manual install commands: base tools, Node.js 22 from NodeSource (Ubuntu ships 12 and 18), Corepack and pnpm, mkcert from apt, and GitHub CLI from its apt repository (Ubuntu's is outdated). - Link the official WSL, Docker, Node.js, Corepack and GitHub CLI docs, and add troubleshooting for virtualization, Docker integration and WSL memory. Refs microsoft#1419
- CONTRIBUTING: mention scripts/setup-linux-prereqs.sh under the prerequisites, and link the Windows WSL guide. - Local development (website): link the Windows WSL guide. - Tips index: describe the expanded guide. Refs microsoft#1419
Address the review on microsoft#1443: - Start with the scripted path: setup-windows-wsl.ps1 in an elevated PowerShell, then setup-linux-prereqs.sh from the checkout in Ubuntu. - Detail installing WSL 2 and Ubuntu (distribution, first-run user, version and default checks) and Docker Desktop (WSL 2 backend, WSL Integration, verification, DOCKER_GID left unset). - Target Ubuntu 22.04/24.04 with manual install commands: base tools, Node.js 22 from NodeSource (Ubuntu ships 12 and 18), Corepack and pnpm, mkcert from apt, and GitHub CLI from its apt repository (Ubuntu's is outdated). - Link the official WSL, Docker, Node.js, Corepack and GitHub CLI docs, and add troubleshooting for virtualization, Docker integration and WSL memory. Refs microsoft#1419 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks Christopher MANEU (@cmaneu) for the review and the scripts! I've updated the PR:
I noticed draft #1415 also adds |
4ecddf7 to
58389e5
Compare
Summary
Adds a Windows + WSL 2 setup guide for Scope contributors, and checks in the two
setup scripts from Christopher MANEU (@cmaneu)'s
gist so the
guide can use them.
Guide (
docs/tips/03-windows-wsl-dev-setup.md)scripts/setup-windows-wsl.ps1in an elevatedPowerShell, then
scripts/setup-linux-prereqs.sh --skip-dockerin Ubuntu.NodeSource, Corepack/pnpm, mkcert and GitHub CLI.
a troubleshooting section.
Scripts. The first commit imports them unchanged and is co-authored by
Christopher MANEU (@cmaneu). The next commit adapts them:
setup-windows-wsl.ps1: adds the license header. Its closing steps now cloneScope in WSL and run the checked-in Linux script, instead of downloading a
gist revision.
setup-linux-prereqs.shfailed when run as root, as in a devcontainer. Ireproduced both problems in
ubuntu:24.04:$SUDO -E bash -ran a command named-E.$USERstopped the script underset -u.setup-linux-prereqs.shnow suggestsDOCKER_GIDonly for Docker Engine.With Docker Desktop, the socket is
root:root 0660inside containers, and theCompose default of
0already matches it.The guide is also linked from
CONTRIBUTING.md, the website's localdevelopment page and the tips index.
Closes #1419
Demos
N/A: documentation and setup scripts, with no Portal or CLI change.
Before
N/A
After
N/A
Testing
setup-linux-prereqs.sh:shellcheckfinds nothing new compared with thegist version. Only the existing SC2086/SC2015 notes remain.
setup-linux-prereqs.sh: both root-mode failures are reproduced in anubuntu:24.04container, and the replacement forms work there.setup-windows-wsl.ps1: the Windows PowerShell 5.1 parser reports 0 errors,and
#Requires -Version 5.1still applies.docker run -v /var/run/docker.sock:/var/run/docker.sock alpine stat:uid=0 gid=0 mode=660.apt-cache policy:nodejsis 12/18, so the guide uses NodeSource.ghis 2.4.0/2.45.0, so it uses GitHub's apt repository.mkcertis 1.4.3/1.4.4.shasumcomes fromlibdigest-sha-perl.resolve.
distribution.
Documentation and compatibility
CONTRIBUTING.md,website/src/content/docs/getting-started/local-development.mdanddocs/tips/README.md.raw.githubusercontent.com/microsoft/scope/main/scripts/setup-windows-wsl.ps1.That URL works once this is merged.
Checklist
up()/down()and keep it CosmosDB-compatible. (N/A)NOTICE/NOTICE-REVIEW.txtwithpnpm noticeas needed. (N/A)