diff --git a/.github/actions/README.md b/.github/actions/README.md index cf195015b..866707cf4 100644 --- a/.github/actions/README.md +++ b/.github/actions/README.md @@ -1,4 +1,4 @@ # Github actions for WSL This page has been moved to our documentation -https://canonical-ubuntu-wsl.readthedocs-hosted.com/en/latest/ +https://ubuntu.com/wsl/docs/stable/reference/actions/ diff --git a/.github/workflows/automatic-doc-cheks.yaml b/.github/workflows/automatic-doc-cheks.yaml deleted file mode 100644 index c935d2069..000000000 --- a/.github/workflows/automatic-doc-cheks.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Main Documentation Checks - -on: - push: - branches: - - main - paths: - - "docs/**" - pull_request: - paths: - - "docs/**" - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - documentation-checks: - uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main - with: - working-directory: './docs' \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1aae9ff08..90d722a2f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,7 +52,7 @@ If you have identified a problem or bug in WSL then file an issue in If you are unsure whether your problem relates to an Ubuntu project or the Microsoft project then familiarise yourself with their documentation. -- [Ubuntu WSL docs](https://documentation.ubuntu.com/wsl/en/latest/) +- [Ubuntu WSL docs](https://ubuntu.com/wsl/docs/) - [Microsoft WSL docs](https://learn.microsoft.com/en-us/windows/wsl/) At this point, if you are still not sure, try to contact a maintainer of one of the projects who will advise you where best to submit your Issue. @@ -126,7 +126,7 @@ Please refer to the licences for Ubuntu on WSL: ## Contributing to the docs > [!WARNING] -> The **documentation** for Ubuntu on WSL can be found at [https://documentation.ubuntu.com/wsl/](documentation.ubuntu.com/wsl). +> The **documentation** for Ubuntu on WSL can be found at [ubuntu.com/wsl/docs/](https://ubuntu.com/wsl/docs/). > The source for that documentation can be found in the [Ubuntu Pro for WSL repo](https://github.com/canonical/ubuntu-pro-for-wsl). > If you are interested in contributing to the documentation, please submit your Issues and Pull Requests there. diff --git a/README.md b/README.md index df8c5315c..8707e72c4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Install a complete Ubuntu terminal environment in minutes with Windows Subsystem for Linux (WSL). Develop cross-platform applications, improve your data science or web development workflows and manage IT infrastructure without leaving Windows. -Read about the [distributions of Ubuntu available for WSL](https://documentation.ubuntu.com/wsl/en/latest/reference/distributions/). +Read about the [distributions of Ubuntu available for WSL](https://ubuntu.com/wsl/docs/reference/distributions/). Key features: - Efficient command line utilities including bash, ssh, git, apt, npm, pip and many more @@ -16,7 +16,7 @@ For more information about Ubuntu WSL and how Canonical supports developers plea https://ubuntu.com/wsl > [!NOTE] -> The **documentation** for Ubuntu on WSL can be found at [https://documentation.ubuntu.com/wsl/](documentation.ubuntu.com/wsl). +> The **documentation** for Ubuntu on WSL can be found at [ubuntu.com/wsl/docs/](https://ubuntu.com/wsl/docs/). > The source for that documentation can be found in the [Ubuntu Pro for WSL repo](https://github.com/canonical/ubuntu-pro-for-wsl). > If you are interested in contributing to the documentation, please submit your Issues and Pull Requests there. diff --git a/SECURITY.md b/SECURITY.md index 29a65ddbd..d0365a767 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -53,7 +53,7 @@ contains more information about what you can expect when you contact us, and wha - [Canonical's Security Site](https://ubuntu.com/security) - [Ubuntu Security disclosure and embargo policy](https://ubuntu.com/security/disclosure-policy) - [Ubuntu Security Notices](https://ubuntu.com/security/notices) -- [Ubuntu on WSL documentation](https://documentation.ubuntu.com/wsl/en/latest/) +- [Ubuntu on WSL documentation](https://ubuntu.com/wsl/docs/) - [Ubuntu Pro for WSL documentation](https://canonical-ubuntu-pro-for-wsl.readthedocs-hosted.com/en/latest/) If you have any questions regarding security vulnerabilities, please reach out diff --git a/docs/.custom_wordlist.txt b/docs/.custom_wordlist.txt deleted file mode 100644 index 6e44f04ce..000000000 --- a/docs/.custom_wordlist.txt +++ /dev/null @@ -1,83 +0,0 @@ -Appx -AppxPackage -awk -backports -BotFramework -chatbot -codebase -conf -config -CSV -cuda -CUDA -Dev -distro -distros -EchoBot -ENV -exe -executables -filesystem -filesystems -GPG -GUI -GUIs -init -IDE -IDEs -js -Jupyter -localhost -LTS -MSIX -npm -Numbat -OpenGL -OpenID -OpenVINO -performant -PowerShell -PR -PRs -rootfs -repo -repos -Rootfs -runtime -SDK -stdout -subdirectory -subprocess -systemd -ubuntu -UbuntuPreview -UP4W -vGPU -VMs -webserver -Whitepaper -whitespace -Winget -wsl -WSL -WSL's -WSLg - -# Contributor names and emails -Didier -Roche -Tolomelli -didier -roche -oliver -smith -carlos -Nihelton -santanadeoliveira -Edu -Gómez -Escandell -edu -gomez -escandell -powershell diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 25a54f038..000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -/*env*/ -.sphinx/venv/ -.sphinx/requirements.txt -.sphinx/warnings.txt -.sphinx/.wordlist.dic -.sphinx/.doctrees/ -.sphinx/node_modules/ -package*.json -_build -.DS_Store -__pycache__ -.idea/ -.vscode/ -.sphinx/styles/* -.sphinx/vale.ini \ No newline at end of file diff --git a/docs/.readthedocs.yaml b/docs/.readthedocs.yaml deleted file mode 100644 index 005b75c2b..000000000 --- a/docs/.readthedocs.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.11" - jobs: - pre_install: - - python3 docs/.sphinx/build_requirements.py - - git fetch --unshallow || true - -# Build documentation in the docs/ directory with Sphinx -sphinx: - builder: dirhtml - configuration: docs/conf.py - fail_on_warning: true - -# If using Sphinx, optionally build your docs in additional formats such as PDF -formats: - - pdf - -# Optionally declare the Python requirements required to build your docs -python: - install: - - requirements: docs/.sphinx/requirements.txt diff --git a/docs/.sphinx/_static/404.svg b/docs/.sphinx/_static/404.svg deleted file mode 100644 index b353cd339..000000000 --- a/docs/.sphinx/_static/404.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/docs/.sphinx/_static/custom.css b/docs/.sphinx/_static/custom.css deleted file mode 100644 index 3ceeb188e..000000000 --- a/docs/.sphinx/_static/custom.css +++ /dev/null @@ -1,378 +0,0 @@ -/** - Ubuntu variable font definitions. - Based on https://github.com/canonical/vanilla-framework/blob/main/scss/_base_fontfaces.scss - - When font files are updated in Vanilla, the links to font files will need to be updated here as well. -*/ - -/* default font set */ -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/f1ea362b-Ubuntu%5Bwdth,wght%5D-latin-v0.896a.woff2') format('woff2-variations'); -} - -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: italic; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/90b59210-Ubuntu-Italic%5Bwdth,wght%5D-latin-v0.896a.woff2') format('woff2-variations'); -} - -@font-face { - font-family: 'Ubuntu Mono variable'; - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/d5fc1819-UbuntuMono%5Bwght%5D-latin-v0.869.woff2') format('woff2-variations'); -} - -/* cyrillic-ext */ -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/77cd6650-Ubuntu%5Bwdth,wght%5D-cyrillic-extended-v0.896a.woff2') format('woff2-variations'); - unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; -} - -/* cyrillic */ -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/2702fce5-Ubuntu%5Bwdth,wght%5D-cyrillic-v0.896a.woff2') format('woff2-variations'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} - -/* greek-ext */ -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/5c108b7d-Ubuntu%5Bwdth,wght%5D-greek-extended-v0.896a.woff2') format('woff2-variations'); - unicode-range: U+1F00-1FFF; -} - -/* greek */ -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/0a14c405-Ubuntu%5Bwdth,wght%5D-greek-v0.896a.woff2') format('woff2-variations'); - unicode-range: U+0370-03FF; -} - -/* latin-ext */ -@font-face { - font-family: 'Ubuntu variable'; - font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */ - font-style: normal; - font-weight: 100 800; /* min and max value for the weight axis */ - src: url('https://assets.ubuntu.com/v1/19f68eeb-Ubuntu%5Bwdth,wght%5D-latin-extended-v0.896a.woff2') format('woff2-variations'); - unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; -} - - -/** Define font-weights as per Vanilla - Based on: https://github.com/canonical/vanilla-framework/blob/main/scss/_base_typography-definitions.scss - - regular text: 400, - bold: 550, - thin: 300, - - h1: bold, - h2: 180; - h3: bold, - h4: 275, - h5: bold, - h6: regular -*/ - -/* default regular text */ -html { - font-weight: 400; -} - -/* heading specific definitions */ -h1, h3, h5 { font-weight: 550; } -h2 { font-weight: 180; } -h4 { font-weight: 275; } - -/* bold */ -.toc-tree li.scroll-current>.reference, -dl.glossary dt, -dl.simple dt, -dl:not([class]) dt { - font-weight: 550; -} - - -/** Table styling **/ - -th.head { - text-transform: uppercase; - font-size: var(--font-size--small); - text-align: initial; -} - -table.align-center th.head { - text-align: center -} - -table.docutils { - border: 0; - box-shadow: none; - width:100%; -} - -table.docutils td, table.docutils th, table.docutils td:last-child, table.docutils th:last-child, table.docutils td:first-child, table.docutils th:first-child { - border-right: none; - border-left: none; -} - -/* Allow to centre text horizontally in table data cells */ -table.align-center { - text-align: center !important; -} - -/** No rounded corners **/ - -.admonition, code.literal, .sphinx-tabs-tab, .sphinx-tabs-panel, .highlight { - border-radius: 0; -} - -/** Admonition styling **/ - -.admonition { - border-top: 1px solid #d9d9d9; - border-right: 1px solid #d9d9d9; - border-bottom: 1px solid #d9d9d9; -} - -/** Color for the "copy link" symbol next to headings **/ - -a.headerlink { - color: var(--color-brand-primary); -} - -/** Line to the left of the current navigation entry **/ - -.sidebar-tree li.current-page { - border-left: 2px solid var(--color-brand-primary); -} - -/** Some tweaks for Sphinx tabs **/ - -[role="tablist"] { - border-bottom: 1px solid var(--color-sidebar-item-background--hover); -} - -.sphinx-tabs-tab[aria-selected="true"], .sd-tab-set>input:checked+label{ - border: 0; - border-bottom: 2px solid var(--color-brand-primary); - font-weight: 400; - font-size: 1rem; - color: var(--color-brand-primary); -} - -body[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] { - background: var(--color-background-primary); - border-bottom: 2px solid var(--color-brand-primary); -} - -button.sphinx-tabs-tab[aria-selected="false"]:hover, .sd-tab-set>input:not(:checked)+label:hover { - border-bottom: 2px solid var(--color-foreground-border); -} - -button.sphinx-tabs-tab[aria-selected="false"]{ - border-bottom: 2px solid var(--color-background-primary); -} - -body[data-theme="dark"] .sphinx-tabs-tab { - background: var(--color-background-primary); -} - -.sphinx-tabs-tab, .sd-tab-set>label{ - color: var(--color-brand-primary); - font-family: var(--font-stack); - font-weight: 400; - font-size: 1rem; - padding: 1em 1.25em .5em -} - -.sphinx-tabs-panel { - border: 0; - border-bottom: 1px solid var(--color-sidebar-item-background--hover); - background: var(--color-background-primary); - padding: 0.75rem 0 0.75rem 0; -} - -body[data-theme="dark"] .sphinx-tabs-panel { - background: var(--color-background-primary); -} - -/** A tweak for issue #190 **/ - -.highlight .hll { - background-color: var(--color-highlighted-background); -} - - -/** Custom classes to fix scrolling in tables by decreasing the - font size or breaking certain columns. - Specify the classes in the Markdown file with, for example: - ```{rst-class} break-col-4 min-width-4-8 - ``` -**/ - -table.dec-font-size { - font-size: smaller; -} -table.break-col-1 td.text-left:first-child { - word-break: break-word; -} -table.break-col-4 td.text-left:nth-child(4) { - word-break: break-word; -} -table.min-width-1-15 td.text-left:first-child { - min-width: 15em; -} -table.min-width-4-8 td.text-left:nth-child(4) { - min-width: 8em; -} - -/** Underline for abbreviations **/ - -abbr[title] { - text-decoration: underline solid #cdcdcd; -} - -/** Use the same style for right-details as for left-details **/ -.bottom-of-page .right-details { - font-size: var(--font-size--small); - display: block; -} - -/** Version switcher */ -button.version_select { - color: var(--color-foreground-primary); - background-color: var(--color-toc-background); - padding: 5px 10px; - border: none; -} - -.version_select:hover, .version_select:focus { - background-color: var(--color-sidebar-item-background--hover); -} - -.version_dropdown { - position: relative; - display: inline-block; - text-align: right; - font-size: var(--sidebar-item-font-size); -} - -.available_versions { - display: none; - position: absolute; - right: 0px; - background-color: var(--color-toc-background); - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - z-index: 11; -} - -.available_versions a { - color: var(--color-foreground-primary); - padding: 12px 16px; - text-decoration: none; - display: block; -} - -.available_versions a:hover {background-color: var(--color-sidebar-item-background--current)} - -/** Suppress link underlines outside on-hover **/ -a { - text-decoration: none; -} - -a:hover, a:visited:hover { - text-decoration: underline; -} - -.show {display:block;} - -/** Fix for nested numbered list - the nested list is lettered **/ -ol.arabic ol.arabic { - list-style: lower-alpha; -} - -/** Make expandable sections look like links **/ -details summary { - color: var(--color-link); -} - -/** Fix the styling of the version box for readthedocs **/ - -#furo-readthedocs-versions .rst-versions, #furo-readthedocs-versions .rst-current-version, #furo-readthedocs-versions:focus-within .rst-current-version, #furo-readthedocs-versions:hover .rst-current-version { - background: var(--color-sidebar-item-background--hover); -} - -.rst-versions .rst-other-versions dd a { - color: var(--color-link); -} - -#furo-readthedocs-versions:focus-within .rst-current-version .fa-book, #furo-readthedocs-versions:hover .rst-current-version .fa-book, .rst-versions .rst-other-versions { - color: var(--color-sidebar-link-text); -} - -.rst-versions .rst-current-version { - color: var(--color-version-popup); - font-weight: bolder; -} - -/* Code-block copybutton invisible by default - (overriding Furo config to achieve default copybutton setting). */ -.highlight button.copybtn { - opacity: 0; -} - -/* Mimicking the 'Give feedback' button for UX consistency */ -.sidebar-search-container input[type=submit] { - color: #FFFFFF; - border: 2px solid #D6410D; - padding: var(--sidebar-search-input-spacing-vertical) var(--sidebar-search-input-spacing-horizontal); - background: #D6410D; - font-weight: bold; - font-size: var(--font-size--small); - cursor: pointer; -} - -.sidebar-search-container input[type=submit]:hover { - text-decoration: underline; -} - -/* Make inline code the same size as code blocks */ -p code.literal { - border: 0; - font-size: var(--code-font-size); -} - -/* Use the general admonition font size for inline code */ -.admonition p code.literal { - font-size: var(--admonition-font-size); -} - -.highlight .s, .highlight .s1, .highlight .s2 { - color: #3F8100; -} - -.highlight .o { - color: #BB5400; -} diff --git a/docs/.sphinx/_static/favicon.png b/docs/.sphinx/_static/favicon.png deleted file mode 100644 index 7f175e461..000000000 Binary files a/docs/.sphinx/_static/favicon.png and /dev/null differ diff --git a/docs/.sphinx/_static/footer.css b/docs/.sphinx/_static/footer.css deleted file mode 100644 index a0a1db454..000000000 --- a/docs/.sphinx/_static/footer.css +++ /dev/null @@ -1,47 +0,0 @@ -.display-contributors { - color: var(--color-sidebar-link-text); - cursor: pointer; -} -.all-contributors { - display: none; - z-index: 55; - list-style: none; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - width: 200px; - height: 200px; - overflow-y: scroll; - margin: auto; - padding: 0; - background: var(--color-background-primary); - scrollbar-color: var(--color-foreground-border) transparent; - scrollbar-width: thin; -} - -.all-contributors li:hover { - background: var(--color-sidebar-item-background--hover); - width: 100%; -} - -.all-contributors li a{ - color: var(--color-sidebar-link-text); - padding: 1rem; - display: inline-block; -} - -#overlay { - position: fixed; - display: none; - width: 100%; - height: 100%; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0,0,0,0.5); - z-index: 2; - cursor: pointer; -} diff --git a/docs/.sphinx/_static/footer.js b/docs/.sphinx/_static/footer.js deleted file mode 100644 index 9a08b1e99..000000000 --- a/docs/.sphinx/_static/footer.js +++ /dev/null @@ -1,12 +0,0 @@ -$(document).ready(function() { - $(document).on("click", function () { - $(".all-contributors").hide(); - $("#overlay").hide(); - }); - - $('.display-contributors').click(function(event) { - $('.all-contributors').toggle(); - $("#overlay").toggle(); - event.stopPropagation(); - }); -}) diff --git a/docs/.sphinx/_static/furo_colors.css b/docs/.sphinx/_static/furo_colors.css deleted file mode 100644 index 4cfdbe7bf..000000000 --- a/docs/.sphinx/_static/furo_colors.css +++ /dev/null @@ -1,89 +0,0 @@ -body { - --color-code-background: #f8f8f8; - --color-code-foreground: black; - --code-font-size: 1rem; - --font-stack: Ubuntu variable, Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - --font-stack--monospace: Ubuntu Mono variable, Ubuntu Mono, Consolas, Monaco, Courier, monospace; - --color-foreground-primary: #111; - --color-foreground-secondary: var(--color-foreground-primary); - --color-foreground-muted: #333; - --color-background-secondary: #FFF; - --color-background-hover: #f2f2f2; - --color-brand-primary: #111; - --color-brand-content: #06C; - --color-api-background: #E3E3E3; - --color-inline-code-background: rgba(0,0,0,.03); - --color-sidebar-link-text: #111; - --color-sidebar-item-background--current: #ebebeb; - --color-sidebar-item-background--hover: #f2f2f2; - --toc-font-size: var(--font-size--small); - --color-admonition-title-background--note: var(--color-background-primary); - --color-admonition-title-background--tip: var(--color-background-primary); - --color-admonition-title-background--important: var(--color-background-primary); - --color-admonition-title-background--caution: var(--color-background-primary); - --color-admonition-title--note: #24598F; - --color-admonition-title--tip: #24598F; - --color-admonition-title--important: #C7162B; - --color-admonition-title--caution: #F99B11; - --color-highlighted-background: #EBEBEB; - --color-link-underline: var(--color-link); - --color-link-underline--hover: var(--color-link); - --color-link-underline--visited: var(--color-link--visited); - --color-link-underline--visited--hover: var(--color-link--visited); - --color-version-popup: #772953; -} - -@media not print { - body[data-theme="dark"] { - --color-code-background: #202020; - --color-code-foreground: #d0d0d0; - --color-foreground-secondary: var(--color-foreground-primary); - --color-foreground-muted: #CDCDCD; - --color-background-secondary: var(--color-background-primary); - --color-background-hover: #666; - --color-brand-primary: #fff; - --color-brand-content: #69C; - --color-sidebar-link-text: #f7f7f7; - --color-sidebar-item-background--current: #666; - --color-sidebar-item-background--hover: #333; - --color-admonition-background: transparent; - --color-admonition-title-background--note: var(--color-background-primary); - --color-admonition-title-background--tip: var(--color-background-primary); - --color-admonition-title-background--important: var(--color-background-primary); - --color-admonition-title-background--caution: var(--color-background-primary); - --color-admonition-title--note: #24598F; - --color-admonition-title--tip: #24598F; - --color-admonition-title--important: #C7162B; - --color-admonition-title--caution: #F99B11; - --color-highlighted-background: #666; - --color-version-popup: #F29879; - } - @media (prefers-color-scheme: dark) { - body:not([data-theme="light"]) { - --color-api-background: #A4A4A4; - --color-code-background: #202020; - --color-code-foreground: #d0d0d0; - --color-foreground-secondary: var(--color-foreground-primary); - --color-foreground-muted: #CDCDCD; - --color-background-secondary: var(--color-background-primary); - --color-background-hover: #666; - --color-brand-primary: #fff; - --color-brand-content: #69C; - --color-sidebar-link-text: #f7f7f7; - --color-sidebar-item-background--current: #666; - --color-sidebar-item-background--hover: #333; - --color-admonition-background: transparent; - --color-admonition-title-background--note: var(--color-background-primary); - --color-admonition-title-background--tip: var(--color-background-primary); - --color-admonition-title-background--important: var(--color-background-primary); - --color-admonition-title-background--caution: var(--color-background-primary); - --color-admonition-title--note: #24598F; - --color-admonition-title--tip: #24598F; - --color-admonition-title--important: #C7162B; - --color-admonition-title--caution: #F99B11; - --color-highlighted-background: #666; - --color-link: #F9FCFF; - --color-version-popup: #F29879; - } - } -} diff --git a/docs/.sphinx/_static/github_issue_links.css b/docs/.sphinx/_static/github_issue_links.css deleted file mode 100644 index db166ed95..000000000 --- a/docs/.sphinx/_static/github_issue_links.css +++ /dev/null @@ -1,24 +0,0 @@ -.github-issue-link-container { - padding-right: 0.5rem; -} -.github-issue-link { - font-size: var(--font-size--small); - font-weight: bold; - background-color: #D6410D; - padding: 13px 23px; - text-decoration: none; -} -.github-issue-link:link { - color: #FFFFFF; -} -.github-issue-link:visited { - color: #FFFFFF -} -.muted-link.github-issue-link:hover { - color: #FFFFFF; - text-decoration: underline; -} -.github-issue-link:active { - color: #FFFFFF; - text-decoration: underline; -} diff --git a/docs/.sphinx/_static/github_issue_links.js b/docs/.sphinx/_static/github_issue_links.js deleted file mode 100644 index f0706038b..000000000 --- a/docs/.sphinx/_static/github_issue_links.js +++ /dev/null @@ -1,34 +0,0 @@ -// if we already have an onload function, save that one -var prev_handler = window.onload; - -window.onload = function() { - // call the previous onload function - if (prev_handler) { - prev_handler(); - } - - const link = document.createElement("a"); - link.classList.add("muted-link"); - link.classList.add("github-issue-link"); - link.text = "Give feedback"; - link.href = ( - github_url - + "/issues/new?" - + "title=docs%3A+TYPE+YOUR+QUESTION+HERE" - + "&body=*Please describe the question or issue you're facing with " - + `"${document.title}"` - + ".*" - + "%0A%0A%0A%0A%0A" - + "---" - + "%0A" - + `*Reported+from%3A+${location.href}*` - ); - link.target = "_blank"; - - const div = document.createElement("div"); - div.classList.add("github-issue-link-container"); - div.append(link) - - const container = document.querySelector(".article-container > .content-icon-container"); - container.prepend(div); -}; diff --git a/docs/.sphinx/_static/header-nav.js b/docs/.sphinx/_static/header-nav.js deleted file mode 100644 index 3608576e0..000000000 --- a/docs/.sphinx/_static/header-nav.js +++ /dev/null @@ -1,10 +0,0 @@ -$(document).ready(function() { - $(document).on("click", function () { - $(".more-links-dropdown").hide(); - }); - - $('.nav-more-links').click(function(event) { - $('.more-links-dropdown').toggle(); - event.stopPropagation(); - }); -}) diff --git a/docs/.sphinx/_static/header.css b/docs/.sphinx/_static/header.css deleted file mode 100644 index 0b9440903..000000000 --- a/docs/.sphinx/_static/header.css +++ /dev/null @@ -1,167 +0,0 @@ -.p-navigation { - border-bottom: 1px solid var(--color-sidebar-background-border); -} - -.p-navigation__nav { - background: #333333; - display: flex; -} - -.p-logo { - display: flex !important; - padding-top: 0 !important; - text-decoration: none; -} - -.p-logo-image { - height: 44px; - padding-right: 10px; -} - -.p-logo-text { - margin-top: 18px; - color: white; - text-decoration: none; -} - -ul.p-navigation__links { - display: flex; - list-style: none; - margin-left: 0; - margin-top: auto; - margin-bottom: auto; - max-width: 800px; - width: 100%; -} - -ul.p-navigation__links li { - margin: 0 auto; - text-align: center; - width: 100%; -} - -ul.p-navigation__links li a { - background-color: rgba(0, 0, 0, 0); - border: none; - border-radius: 0; - color: var(--color-sidebar-link-text); - display: block; - font-weight: 400; - line-height: 1.5rem; - margin: 0; - overflow: hidden; - padding: 1rem 0; - position: relative; - text-align: left; - text-overflow: ellipsis; - transition-duration: .1s; - transition-property: background-color, color, opacity; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); - white-space: nowrap; - width: 100%; -} - -ul.p-navigation__links .p-navigation__link { - color: #ffffff; - font-weight: 300; - text-align: center; - text-decoration: none; -} - -ul.p-navigation__links .p-navigation__link:hover { - background-color: #2b2b2b; -} - -ul.p-navigation__links .p-dropdown__link:hover { - background-color: var(--color-sidebar-item-background--hover); -} - -ul.p-navigation__links .p-navigation__sub-link { - background: var(--color-background-primary); - padding: .5rem 0 .5rem .5rem; - font-weight: 300; -} - -ul.p-navigation__links .more-links-dropdown li a { - border-left: 1px solid var(--color-sidebar-background-border); - border-right: 1px solid var(--color-sidebar-background-border); -} - -ul.p-navigation__links .more-links-dropdown li:first-child a { - border-top: 1px solid var(--color-sidebar-background-border); -} - -ul.p-navigation__links .more-links-dropdown li:last-child a { - border-bottom: 1px solid var(--color-sidebar-background-border); -} - -ul.p-navigation__links .p-navigation__logo { - padding: 0.5rem; -} - -ul.p-navigation__links .p-navigation__logo img { - width: 40px; -} - -ul.more-links-dropdown { - display: none; - overflow-x: visible; - height: 0; - z-index: 55; - padding: 0; - position: relative; - list-style: none; - margin-bottom: 0; - margin-top: 0; -} - -.nav-more-links::after { - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23111' d='M8.187 11.748l6.187-6.187-1.06-1.061-5.127 5.127L3.061 4.5 2 5.561z'/%3E%3C/svg%3E"); - background-position: center; - background-repeat: no-repeat; - background-size: contain; - content: ""; - display: block; - filter: invert(100%); - height: 1rem; - pointer-events: none; - position: absolute; - right: 1rem; - text-indent: calc(100% + 10rem); - top: calc(1rem + 0.25rem); - width: 1rem; -} - -.nav-ubuntu-com { - display: none; -} - -@media only screen and (min-width: 480px) { - ul.p-navigation__links li { - width: 100%; - } - - .nav-ubuntu-com { - display: inherit; - } -} - -@media only screen and (max-width: 800px) { - .nav-more-links { - margin-left: auto !important; - padding-right: 2rem !important; - width: 8rem !important; - } -} - -@media only screen and (min-width: 800px) { - ul.p-navigation__links li { - width: 100% !important; - } -} - -@media only screen and (min-width: 1310px) { - ul.p-navigation__links { - margin-left: calc(50% - 41em); - } -} diff --git a/docs/.sphinx/_static/tag.png b/docs/.sphinx/_static/tag.png deleted file mode 100644 index f6f6e5aa4..000000000 Binary files a/docs/.sphinx/_static/tag.png and /dev/null differ diff --git a/docs/.sphinx/_templates/404.html b/docs/.sphinx/_templates/404.html deleted file mode 100644 index 4cb2d50d3..000000000 --- a/docs/.sphinx/_templates/404.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "page.html" %} - -{% block content -%} -
-

Page not found

-
-
-
- {{ body }} -
-
- Penguin with a question mark -
-
-
-
-{%- endblock content %} diff --git a/docs/.sphinx/_templates/base.html b/docs/.sphinx/_templates/base.html deleted file mode 100644 index 33081547c..000000000 --- a/docs/.sphinx/_templates/base.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "furo/base.html" %} - -{% block theme_scripts %} - -{% endblock theme_scripts %} - -{# ru-fu: don't include the color variables from the conf.py file, but use a - separate CSS file to save space #} -{% block theme_styles %} -{% endblock theme_styles %} diff --git a/docs/.sphinx/_templates/footer.html b/docs/.sphinx/_templates/footer.html deleted file mode 100644 index 6839f0154..000000000 --- a/docs/.sphinx/_templates/footer.html +++ /dev/null @@ -1,131 +0,0 @@ -{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #} - - -
-
- {%- if show_copyright %} - - {%- endif %} - - {# mod: removed "Made with" #} - - {%- if last_updated -%} -
- {% trans last_updated=last_updated|e -%} - Last updated on {{ last_updated }} - {%- endtrans -%} -
- {%- endif %} - - {%- if show_source and has_source and sourcename %} - - {%- endif %} -
-
- {% if github_url and github_folder and pagename and page_source_suffix and display_contributors %} - {% set contributors = get_contribs(github_url, github_folder, pagename, page_source_suffix, display_contributors_since) %} - {% if contributors %} - {% if contributors | length > 1 %} - Thanks to the {{ contributors |length }} contributors! - {% else %} - Thanks to our contributor! - {% endif %} -
- - {% endif %} - {% endif %} -
-
- - {# mod: replaced RTD icons with our links #} - - {% if discourse %} - - {% endif %} - - {% if mattermost %} - - {% endif %} - - {% if matrix %} - - {% endif %} - - {% if github_url and github_version and github_folder %} - - {% if github_issues %} - - {% endif %} - - - {% endif %} - - -
-
- diff --git a/docs/.sphinx/_templates/header.html b/docs/.sphinx/_templates/header.html deleted file mode 100644 index 1a128b6f8..000000000 --- a/docs/.sphinx/_templates/header.html +++ /dev/null @@ -1,36 +0,0 @@ - diff --git a/docs/.sphinx/_templates/page.html b/docs/.sphinx/_templates/page.html deleted file mode 100644 index bda306109..000000000 --- a/docs/.sphinx/_templates/page.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "furo/page.html" %} - -{% block footer %} - {% include "footer.html" %} -{% endblock footer %} - -{% block body -%} - {% include "header.html" %} - {{ super() }} -{%- endblock body %} - -{% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %} - {% set furo_hide_toc_orig = furo_hide_toc %} - {% set furo_hide_toc=false %} -{% endif %} - -{% block right_sidebar %} -
- {% if not furo_hide_toc_orig %} -
- - {{ _("Contents") }} - -
-
-
- {{ toc }} -
-
- {% endif %} - {% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %} - - - {% endif %} -
-{% endblock right_sidebar %} diff --git a/docs/.sphinx/_templates/sidebar/search.html b/docs/.sphinx/_templates/sidebar/search.html deleted file mode 100644 index 644a5ef6a..000000000 --- a/docs/.sphinx/_templates/sidebar/search.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/docs/.sphinx/build_requirements.py b/docs/.sphinx/build_requirements.py deleted file mode 100644 index 1a317bb07..000000000 --- a/docs/.sphinx/build_requirements.py +++ /dev/null @@ -1,131 +0,0 @@ -import sys -import os - -import pathlib -scriptdir=pathlib.Path(__file__).parent.resolve() -sys.path.append(scriptdir) - -from custom_conf import * - -# The file contains helper functions and the mechanism to build the -# .sphinx/requirements.txt file that is needed to set up the virtual -# environment. - -# You should not do any modifications to this file. Put your custom -# requirements into the custom_required_modules array in the custom_conf.py -# file. If you need to change this file, contribute the changes upstream. - -legacyCanonicalSphinxExtensionNames = [ - "youtube-links", - "related-links", - "custom-rst-roles", - "terminal-output" - ] - -def IsAnyCanonicalSphinxExtensionUsed(): - for extension in custom_extensions: - if (extension.startswith("canonical.") or - extension in legacyCanonicalSphinxExtensionNames): - return True - - return False - -def IsNotFoundExtensionUsed(): - return "notfound.extension" in custom_extensions - -def IsSphinxTabsUsed(): - for extension in custom_extensions: - if extension.startswith("sphinx_tabs."): - return True - - return False - -def AreRedirectsDefined(): - return ("sphinx_reredirects" in custom_extensions) or ( - ("redirects" in globals()) and \ - (redirects is not None) and \ - (len(redirects) > 0)) - -def IsOpenGraphConfigured(): - if "sphinxext.opengraph" in custom_extensions: - return True - - for global_variable_name in list(globals()): - if global_variable_name.startswith("ogp_"): - return True - - return False - -def IsMyStParserUsed(): - return ("myst_parser" in custom_extensions) or \ - ("custom_myst_extensions" in globals()) - -def DeduplicateExtensions(extensionNames: [str]): - extensionNames = dict.fromkeys(extensionNames) - resultList = [] - encounteredCanonicalExtensions = [] - - for extensionName in extensionNames: - if extensionName in legacyCanonicalSphinxExtensionNames: - extensionName = "canonical." + extensionName - - if extensionName.startswith("canonical."): - if extensionName not in encounteredCanonicalExtensions: - encounteredCanonicalExtensions.append(extensionName) - resultList.append(extensionName) - else: - resultList.append(extensionName) - - return resultList - -if __name__ == "__main__": - requirements = [ - "furo", - "pyspelling", - "sphinx", - "sphinx-autobuild", - "sphinx-copybutton", - "sphinx-design", - "sphinxcontrib-jquery", - "watchfiles", - "GitPython" - - ] - - requirements.extend(custom_required_modules) - - if IsAnyCanonicalSphinxExtensionUsed(): - requirements.append("canonical-sphinx-extensions") - - if IsNotFoundExtensionUsed(): - requirements.append("sphinx-notfound-page") - - if IsSphinxTabsUsed(): - requirements.append("sphinx-tabs") - - if AreRedirectsDefined(): - requirements.append("sphinx-reredirects") - - if IsOpenGraphConfigured(): - requirements.append("sphinxext-opengraph") - - if IsMyStParserUsed(): - requirements.append("myst-parser") - requirements.append("linkify-it-py") - - # removes duplicate entries - requirements = list(dict.fromkeys(requirements)) - requirements.sort() - - with open(os.path.join(scriptdir, "requirements.txt"), 'w') as requirements_file: - requirements_file.write( - "# DO NOT MODIFY THIS FILE DIRECTLY!\n" - "#\n" - "# This file is generated automatically.\n" - "# Add custom requirements to the custom_required_modules\n" - "# array in the custom_conf.py file and run:\n" - "# make clean && make install\n") - - for requirement in requirements: - requirements_file.write(requirement) - requirements_file.write('\n') diff --git a/docs/.sphinx/conf.py b/docs/.sphinx/conf.py deleted file mode 120000 index d026d1f6b..000000000 --- a/docs/.sphinx/conf.py +++ /dev/null @@ -1 +0,0 @@ -../conf.py \ No newline at end of file diff --git a/docs/.sphinx/custom_conf.py b/docs/.sphinx/custom_conf.py deleted file mode 120000 index 8c6c81020..000000000 --- a/docs/.sphinx/custom_conf.py +++ /dev/null @@ -1 +0,0 @@ -../custom_conf.py \ No newline at end of file diff --git a/docs/.sphinx/get_vale_conf.py b/docs/.sphinx/get_vale_conf.py deleted file mode 100644 index 45a3baab2..000000000 --- a/docs/.sphinx/get_vale_conf.py +++ /dev/null @@ -1,42 +0,0 @@ -#! /usr/bin/env python - -import requests -import os - -DIR=os.getcwd() - -def main(): - - if os.path.exists(f"{DIR}/.sphinx/styles/Canonical"): - print("Vale directory exists") - else: - os.makedirs(f"{DIR}/.sphinx/styles/Canonical") - - url = "https://api.github.com/repos/canonical/praecepta/contents/styles/Canonical" - r = requests.get(url) - for item in r.json(): - download = requests.get(item["download_url"]) - file = open(".sphinx/styles/Canonical/" + item["name"], "w") - file.write(download.text) - file.close() - - if os.path.exists(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical"): - print("Vocab directory exists") - else: - os.makedirs(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical") - - url = "https://api.github.com/repos/canonical/praecepta/contents/styles/config/vocabularies/Canonical" - r = requests.get(url) - for item in r.json(): - download = requests.get(item["download_url"]) - file = open(".sphinx/styles/config/vocabularies/Canonical/" + item["name"], "w") - file.write(download.text) - file.close() - - config = requests.get("https://raw.githubusercontent.com/canonical/praecepta/main/vale.ini") - file = open(".sphinx/vale.ini", "w") - file.write(config.text) - file.close() - -if __name__ == "__main__": - main() diff --git a/docs/.sphinx/pa11y.json b/docs/.sphinx/pa11y.json deleted file mode 100644 index 8df0cb9cb..000000000 --- a/docs/.sphinx/pa11y.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "chromeLaunchConfig": { - "args": [ - "--no-sandbox" - ] - }, - "reporter": "cli", - "standard": "WCAG2AA" -} \ No newline at end of file diff --git a/docs/.sphinx/spellingcheck.yaml b/docs/.sphinx/spellingcheck.yaml deleted file mode 100644 index 467676ddd..000000000 --- a/docs/.sphinx/spellingcheck.yaml +++ /dev/null @@ -1,30 +0,0 @@ -matrix: -- name: rST files - aspell: - lang: en - d: en_GB - dictionary: - wordlists: - - .wordlist.txt - - .custom_wordlist.txt - output: .sphinx/.wordlist.dic - sources: - - _build/**/*.html - pipeline: - - pyspelling.filters.html: - comments: false - attributes: - - title - - alt - ignores: - - code - - pre - - spellexception - - link - - title - - div.relatedlinks - - strong.command - - div.visually-hidden - - img - - a.p-navigation__link - - a.contributor diff --git a/docs/.wokeignore b/docs/.wokeignore deleted file mode 100644 index c64a60376..000000000 --- a/docs/.wokeignore +++ /dev/null @@ -1,4 +0,0 @@ -# the cheat sheets contain a link to a repository with a block word which we -# cannot avoid for now, ie -# https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html -doc-cheat-sheet* diff --git a/docs/.wordlist.txt b/docs/.wordlist.txt deleted file mode 100644 index 6ffa1fedf..000000000 --- a/docs/.wordlist.txt +++ /dev/null @@ -1,55 +0,0 @@ -# This wordlist is from the Sphinx starter pack and should not be -# modified. Add any custom terms to .custom_wordlist.txt instead. - -addons -API -APIs -balancer -Charmhub -CLI -Diátaxis -Dqlite -dropdown -EBS -EKS -enablement -favicon -Furo -Git -GitHub -Grafana -IAM -installable -JSON -Juju -Kubeflow -Kubernetes -Launchpad -linter -LTS -Makefile -Matrix -Mattermost -MyST -namespace -namespaces -NodePort -Numbat -observability -OEM -OLM -Permalink -pre -Quickstart -ReadMe -reST -reStructuredText -RTD -subdirectories -subfolders -subtree -Ubuntu -UI -UUID -VM -YAML diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index a861ba84a..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# This Makefile stub allows you to customize starter pack (SP) targets. -# Consider this file as a bridge between your project -# and the starter pack's predefined targets that reside in Makefile.sp. -# -# You can add your own, non-SP targets here or override SP targets -# to fit your project's needs. For example, you can define and use targets -# named "install" or "run", but continue to use SP targets like "sp-install" -# or "sp-run" when working on the documentation. - -# Put it first so that "make" without argument is like "make help". -help: - @echo "\n" \ - "------------------------------------------------------------- \n" \ - "* watch, build and serve the documentation: make run \n" \ - "* only build: make html \n" \ - "* only serve: make serve \n" \ - "* clean built doc files: make clean-doc \n" \ - "* clean full environment: make clean \n" \ - "* check links: make linkcheck \n" \ - "* check spelling: make spelling \n" \ - "* check spelling (without building again): make spellcheck \n" \ - "* check inclusive language: make woke \n" \ - "* check accessibility: make pa11y \n" \ - "* check style guide compliance: make vale \n" \ - "* check style guide compliance on target: make vale TARGET=* \n" \ - "* other possible targets: make \n" \ - "------------------------------------------------------------- \n" - -%: - $(MAKE) -f Makefile.sp sp-$@ diff --git a/docs/Makefile.sp b/docs/Makefile.sp deleted file mode 100644 index d40405976..000000000 --- a/docs/Makefile.sp +++ /dev/null @@ -1,122 +0,0 @@ -# Minimal makefile for Sphinx documentation -# -# `Makefile.sp` is from the Sphinx starter pack and should not be -# modified. -# Add your customisation to `Makefile` instead. - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXDIR = .sphinx -SPHINXOPTS ?= -c . -d $(SPHINXDIR)/.doctrees -j auto -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build -VENVDIR = $(SPHINXDIR)/venv -PA11Y = $(SPHINXDIR)/node_modules/pa11y/bin/pa11y.js --config $(SPHINXDIR)/pa11y.json -VENV = $(VENVDIR)/bin/activate -TARGET = * -ALLFILES = *.rst **/*.rst -ADDPREREQS ?= - -.PHONY: sp-full-help sp-woke-install sp-pa11y-install sp-install sp-run sp-html \ - sp-epub sp-serve sp-clean sp-clean-doc sp-spelling sp-spellcheck sp-linkcheck sp-woke \ - sp-pa11y Makefile.sp sp-vale - -sp-full-help: $(VENVDIR) - @. $(VENV); $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - @echo "\n\033[1;31mNOTE: This help texts shows unsupported targets!\033[0m" - @echo "Run 'make help' to see supported targets." - -# Shouldn't assume that venv is available on Ubuntu by default; discussion here: -# https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847 -$(SPHINXDIR)/requirements.txt: - @python3 -c "import venv" || \ - (echo "You must install python3-venv before you can build the documentation."; exit 1) - python3 -m venv $(VENVDIR) - @if [ ! -z "$(ADDPREREQS)" ]; then \ - . $(VENV); pip install \ - $(PIPOPTS) --require-virtualenv $(ADDPREREQS); \ - fi - . $(VENV); python3 $(SPHINXDIR)/build_requirements.py - -# If requirements are updated, venv should be rebuilt and timestamped. -$(VENVDIR): $(SPHINXDIR)/requirements.txt - @echo "... setting up virtualenv" - python3 -m venv $(VENVDIR) - . $(VENV); pip install $(PIPOPTS) --require-virtualenv \ - --upgrade -r $(SPHINXDIR)/requirements.txt \ - --log $(VENVDIR)/pip_install.log - @test ! -f $(VENVDIR)/pip_list.txt || \ - mv $(VENVDIR)/pip_list.txt $(VENVDIR)/pip_list.txt.bak - @. $(VENV); pip list --local --format=freeze > $(VENVDIR)/pip_list.txt - @touch $(VENVDIR) - -sp-woke-install: - @type woke >/dev/null 2>&1 || \ - { echo "Installing \"woke\" snap... \n"; sudo snap install woke; } - -sp-pa11y-install: - @type $(PA11Y) >/dev/null 2>&1 || { \ - echo "Installing \"pa11y\" from npm... \n"; \ - mkdir -p $(SPHINXDIR)/node_modules/ ; \ - npm install --prefix $(SPHINXDIR) pa11y; \ - } - -sp-install: $(VENVDIR) - -sp-run: sp-install - . $(VENV); sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) - -# Doesn't depend on $(BUILDDIR) to rebuild properly at every run. -sp-html: sp-install - . $(VENV); $(SPHINXBUILD) -W --keep-going -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) - -sp-epub: sp-install - . $(VENV); $(SPHINXBUILD) -b epub "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) - -sp-serve: sp-html - cd "$(BUILDDIR)"; python3 -m http.server --bind 127.0.0.1 8000 - -sp-clean: sp-clean-doc - @test ! -e "$(VENVDIR)" -o -d "$(VENVDIR)" -a "$(abspath $(VENVDIR))" != "$(VENVDIR)" - rm -rf $(VENVDIR) - rm -f $(SPHINXDIR)/requirements.txt - rm -rf $(SPHINXDIR)/node_modules/ - rm -rf $(SPHINXDIR)/styles - rm -rf $(SPHINXDIR)/vale.ini - -sp-clean-doc: - git clean -fx "$(BUILDDIR)" - rm -rf $(SPHINXDIR)/.doctrees - -sp-spellcheck: - . $(VENV) ; python3 -m pyspelling -c $(SPHINXDIR)/spellingcheck.yaml -j $(shell nproc) - -sp-spelling: sp-html sp-spellcheck - -sp-linkcheck: sp-install - . $(VENV) ; $(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) || { grep --color -F "[broken]" "$(BUILDDIR)/output.txt"; exit 1; } - exit 0 - -sp-woke: sp-woke-install - woke $(ALLFILES) --exit-1-on-failure \ - -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml - -sp-pa11y: sp-pa11y-install sp-html - find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y) - -sp-vale: sp-install - @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install vale - @. $(VENV); test -f $(SPHINXDIR)/vale.ini || python3 $(SPHINXDIR)/get_vale_conf.py - @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --config "$(SPHINXDIR)/vale.ini" $(TARGET) > /dev/null \; - @echo "" - @echo "Running Vale against $(TARGET). To change target set TARGET= with make command" - @echo "" - @. $(VENV); vale --config "$(SPHINXDIR)/vale.ini" --glob='*.{md,txt,rst}' $(TARGET) - - - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile.sp - . $(VENV); $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index e0c23fdd7..000000000 --- a/docs/conf.py +++ /dev/null @@ -1,213 +0,0 @@ -import sys -import os -import requests -from urllib.parse import urlparse -from git import Repo, InvalidGitRepositoryError -import time - -sys.path.append('./') -from custom_conf import * -sys.path.append('.sphinx/') -from build_requirements import * - -# Configuration file for the Sphinx documentation builder. -# You should not do any modifications to this file. Put your custom -# configuration into the custom_conf.py file. -# If you need to change this file, contribute the changes upstream. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -############################################################ -### Extensions -############################################################ - -extensions = [ - 'sphinx_design', - 'sphinx_copybutton', - 'sphinxcontrib.jquery', -] - -# Only add redirects extension if any redirects are specified. -if AreRedirectsDefined(): - extensions.append('sphinx_reredirects') - -# Only add myst extensions if any configuration is present. -if IsMyStParserUsed(): - extensions.append('myst_parser') - - # Additional MyST syntax - myst_enable_extensions = [ - 'substitution', - 'deflist', - 'linkify' - ] - myst_enable_extensions.extend(custom_myst_extensions) - -# Only add Open Graph extension if any configuration is present. -if IsOpenGraphConfigured(): - extensions.append('sphinxext.opengraph') - -extensions.extend(custom_extensions) -extensions = DeduplicateExtensions(extensions) - -### Configuration for extensions - -# Used for related links -if not 'discourse_prefix' in html_context and 'discourse' in html_context: - html_context['discourse_prefix'] = html_context['discourse'] + '/t/' - -# The URL prefix for the notfound extension depends on whether the documentation uses versions. -# For documentation on documentation.ubuntu.com, we also must add the slug. -url_version = '' -url_lang = '' - -# Determine if the URL uses versions and language -if 'READTHEDOCS_CANONICAL_URL' in os.environ and os.environ['READTHEDOCS_CANONICAL_URL']: - url_parts = os.environ['READTHEDOCS_CANONICAL_URL'].split('/') - - if len(url_parts) >= 2 and 'READTHEDOCS_VERSION' in os.environ and os.environ['READTHEDOCS_VERSION'] == url_parts[-2]: - url_version = url_parts[-2] + '/' - - if len(url_parts) >= 3 and 'READTHEDOCS_LANGUAGE' in os.environ and os.environ['READTHEDOCS_LANGUAGE'] == url_parts[-3]: - url_lang = url_parts[-3] + '/' - -# Set notfound_urls_prefix to the slug (if defined) and the version/language affix -if slug: - notfound_urls_prefix = '/' + slug + '/' + url_lang + url_version -elif len(url_lang + url_version) > 0: - notfound_urls_prefix = '/' + url_lang + url_version -else: - notfound_urls_prefix = '' - -notfound_context = { - 'title': 'Page not found', - 'body': '

Sorry, but the documentation page that you are looking for was not found.

\n\n

Documentation changes over time, and pages are moved around. We try to redirect you to the updated content where possible, but unfortunately, that didn\'t work this time (maybe because the content you were looking for does not exist in this version of the documentation).

\n

You can try to use the navigation to locate the content you\'re looking for, or search for a similar page.

\n', -} - -# Default image for OGP (to prevent font errors, see -# https://github.com/canonical/sphinx-docs-starter-pack/pull/54 ) -if not 'ogp_image' in locals(): - ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg' - -############################################################ -### General configuration -############################################################ - -exclude_patterns = [ - '_build', - 'Thumbs.db', - '.DS_Store', - '.sphinx', -] -exclude_patterns.extend(custom_excludes) - -rst_epilog = ''' -.. include:: /reuse/links.txt -''' -if 'custom_rst_epilog' in locals(): - rst_epilog = custom_rst_epilog - -source_suffix = { - '.rst': 'restructuredtext', - '.md': 'markdown', -} - -if not 'conf_py_path' in html_context and 'github_folder' in html_context: - html_context['conf_py_path'] = html_context['github_folder'] - -# For ignoring specific links -linkcheck_anchors_ignore_for_url = [ - r'https://github\.com/.*' -] -linkcheck_anchors_ignore_for_url.extend(custom_linkcheck_anchors_ignore_for_url) - -# Tags cannot be added directly in custom_conf.py, so add them here -for tag in custom_tags: - tags.add(tag) - -# html_context['get_contribs'] is a function and cannot be -# cached (see https://github.com/sphinx-doc/sphinx/issues/12300) -suppress_warnings = ["config.cache"] - -############################################################ -### Styling -############################################################ - -# Find the current builder -builder = 'dirhtml' -if '-b' in sys.argv: - builder = sys.argv[sys.argv.index('-b')+1] - -# Setting templates_path for epub makes the build fail -if builder == 'dirhtml' or builder == 'html': - templates_path = ['.sphinx/_templates'] - notfound_template = '404.html' - -# Theme configuration -html_theme = 'furo' -html_last_updated_fmt = '' -html_permalinks_icon = '¶' - -if html_title == '': - html_theme_options = { - 'sidebar_hide_name': True - } - -############################################################ -### Additional files -############################################################ - -html_static_path = ['.sphinx/_static'] - -html_css_files = [ - 'custom.css', - 'header.css', - 'github_issue_links.css', - 'furo_colors.css', - 'footer.css' -] -html_css_files.extend(custom_html_css_files) - -html_js_files = ['header-nav.js', 'footer.js'] -if 'github_issues' in html_context and html_context['github_issues'] and not disable_feedback_button: - html_js_files.append('github_issue_links.js') -html_js_files.extend(custom_html_js_files) - -############################################################# -# Display the contributors - -def get_contributors_for_file(github_url, github_folder, pagename, page_source_suffix, display_contributors_since=None): - filename = f"{pagename}{page_source_suffix}" - paths=html_context['github_folder'][1:] + filename - - try: - repo = Repo(".") - except InvalidGitRepositoryError: - cwd = os.getcwd() - ghfolder = html_context['github_folder'][:-1] - if ghfolder and cwd.endswith(ghfolder): - repo = Repo(cwd.rpartition(ghfolder)[0]) - else: - print("The local Git repository could not be found.") - return - - since = display_contributors_since if display_contributors_since and display_contributors_since.strip() else None - - commits = repo.iter_commits(paths=paths, since=since) - - contributors_dict = {} - for commit in commits: - contributor = commit.author.name - if contributor not in contributors_dict or commit.committed_date > contributors_dict[contributor]['date']: - contributors_dict[contributor] = { - 'date': commit.committed_date, - 'sha': commit.hexsha - } - # The github_page contains the link to the contributor's latest commit. - contributors_list = [{'name': name, 'github_page': f"{github_url}/commit/{data['sha']}"} for name, data in contributors_dict.items()] - sorted_contributors_list = sorted(contributors_list, key=lambda x: x['name']) - return sorted_contributors_list - -html_context['get_contribs'] = get_contributors_for_file -############################################################# diff --git a/docs/custom_conf.py b/docs/custom_conf.py deleted file mode 100644 index 7b9137ef3..000000000 --- a/docs/custom_conf.py +++ /dev/null @@ -1,234 +0,0 @@ -import datetime - -# Custom configuration for the Sphinx documentation builder. -# All configuration specific to your project should be done in this file. -# -# The file is included in the common conf.py configuration file. -# You can modify any of the settings below or add any configuration that -# is not covered by the common conf.py file. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html -# -# If you're not familiar with Sphinx and don't want to use advanced -# features, it is sufficient to update the settings in the "Project -# information" section. - -############################################################ -### Project information -############################################################ - -# Product name -project = 'Ubuntu WSL' -author = 'Canonical Group Ltd' - -# The title you want to display for the documentation in the sidebar. -# You might want to include a version number here. -# To not display any title, set this option to an empty string. -html_title = project + ' documentation' - -# The default value uses CC-BY-SA as the license and the current year -# as the copyright year. -# -# If your documentation needs a different copyright license, use that -# instead of 'CC-BY-SA'. Also, if your documentation is included as -# part of the code repository of your project, it'll inherit the license -# of the code. So you'll need to specify that license here (instead of -# 'CC-BY-SA'). -# -# For static works, it is common to provide the year of first publication. -# Another option is to give the first year and the current year -# for documentation that is often changed, e.g. 2022–2023 (note the en-dash). -# -# A way to check a GitHub repo's creation date is to obtain a classic GitHub -# token with 'repo' permissions here: https://github.com/settings/tokens -# Next, use 'curl' and 'jq' to extract the date from the GitHub API's output: -# -# curl -H 'Authorization: token ' \ -# -H 'Accept: application/vnd.github.v3.raw' \ -# https://api.github.com/repos/canonical/ | jq '.created_at' - -copyright = '%s CC-BY-SA, %s' % (datetime.date.today().year, author) - -## Open Graph configuration - defines what is displayed as a link preview -## when linking to the documentation from another website (see https://ogp.me/) -# The URL where the documentation will be hosted (leave empty if you -# don't know yet) -# NOTE: If no ogp_* variable is defined (e.g. if you remove this section) the -# sphinxext.opengraph extension will be disabled. -ogp_site_url = 'https://canonical-starter-pack.readthedocs-hosted.com/' -# The documentation website name (usually the same as the product name) -ogp_site_name = project -# The URL of an image or logo that is used in the preview -ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg' - -# Update with the favicon for your product (default is the circle of friends) -html_favicon = '../meta/Ubuntu/src/DistroLauncher/images/icon.svg' - - -# (Some settings must be part of the html_context dictionary, while others -# are on root level. Don't move the settings.) -html_context = { - - # Change to the link to the website of your product (without "https://") - # For example: "ubuntu.com/lxd" or "microcloud.is" - # If there is no product website, edit the header template to remove the - # link (see the readme for instructions). - 'product_page': 'ubuntu.com/wsl', - - # Add your product tag (the orange part of your logo, will be used in the - # header) to ".sphinx/_static" and change the path here (start with "_static") - # (default is the circle of friends) - 'product_tag': '_static/tag.png', - - # Change to the discourse instance you want to be able to link to - # using the :discourse: metadata at the top of a file - # (use an empty value if you don't want to link) - 'discourse': 'https://discourse.ubuntu.com/c/wsl/27', - - # Change to the Mattermost channel you want to link to - # (use an empty value if you don't want to link) - #'mattermost': 'https://chat.canonical.com/canonical/channels/documentation', - - # Change to the Matrix channel you want to link to - # (use an empty value if you don't want to link) - 'matrix': 'https://matrix.to/#/#ubuntu-wsl:ubuntu.com', - - # Change to the GitHub URL for your project - # This is used, for example, to link to the source files and allow creating GitHub issues directly from the documentation. - 'github_url': 'https://github.com/ubuntu/WSL', - - # Change to the branch for this version of the documentation - 'github_version': 'main', - - # Change to the folder that contains the documentation - # (usually "/" or "/docs/") - 'github_folder': '/docs/', - - # Change to an empty value if your GitHub repo doesn't have issues enabled. - # This will disable the feedback button and the issue link in the footer. - 'github_issues': 'enabled', - - # Controls the existence of Previous / Next buttons at the bottom of pages - # Valid options: none, prev, next, both - 'sequential_nav': "none", - - # Controls if to display the contributors of a file or not - "display_contributors": True, - - # Controls time frame for showing the contributors - "display_contributors_since": "" -} - -# If your project is on documentation.ubuntu.com, specify the project -# slug (for example, "lxd") here. -slug = "" - -############################################################ -### Redirects -############################################################ - -# Set up redirects (https://documatt.gitlab.io/sphinx-reredirects/usage.html) -# For example: 'explanation/old-name.html': '../how-to/prettify.html', -# You can also configure redirects in the Read the Docs project dashboard -# (see https://docs.readthedocs.io/en/stable/guides/redirects.html). -# NOTE: If this variable is not defined, set to None, or the dictionary is empty, -# the sphinx_reredirects extension will be disabled. -redirects = { - 'guides/autoinstall': '../../tutorials/cloud-init', -} -############################################################ -### Link checker exceptions -############################################################ - -# Links to ignore when checking links -linkcheck_ignore = [ - 'http://127.0.0.1:8000', - 'https://askubuntu.com', - ] - -# Pages on which to ignore anchors -# (This list will be appended to linkcheck_anchors_ignore_for_url) -custom_linkcheck_anchors_ignore_for_url = [] - -############################################################ -### Additions to default configuration -############################################################ - -## The following settings are appended to the default configuration. -## Use them to extend the default functionality. - -# Remove this variable to disable the MyST parser extensions. -custom_myst_extensions = [] - -# Add custom Sphinx extensions as needed. -# This array contains recommended extensions that should be used. -# NOTE: The following extensions are handled automatically and do -# not need to be added here: myst_parser, sphinx_copybutton, sphinx_design, -# sphinx_reredirects, sphinxcontrib.jquery, sphinxext.opengraph -custom_extensions = [ - 'sphinx_tabs.tabs', - 'canonical.youtube-links', - 'canonical.related-links', - 'canonical.custom-rst-roles', - 'canonical.terminal-output', - 'notfound.extension' - ] - -# Add custom required Python modules that must be added to the -# .sphinx/requirements.txt file. -# NOTE: The following modules are handled automatically and do not need to be -# added here: canonical-sphinx-extensions, furo, linkify-it-py, myst-parser, -# pyspelling, sphinx, sphinx-autobuild, sphinx-copybutton, sphinx-design, -# sphinx-notfound-page, sphinx-reredirects, sphinx-tabs, sphinxcontrib-jquery, -# sphinxext-opengraph -custom_required_modules = [] - -# Add files or directories that should be excluded from processing. -custom_excludes = [ - 'doc-cheat-sheet*', - ] - -# Add CSS files (located in .sphinx/_static/) -custom_html_css_files = [] - -# Add JavaScript files (located in .sphinx/_static/) -custom_html_js_files = [] - -## The following settings override the default configuration. - -# Specify a reST string that is included at the end of each file. -# If commented out, use the default (which pulls the reuse/links.txt -# file into each reST file). -# custom_rst_epilog = '' - -# By default, the documentation includes a feedback button at the top. -# You can disable it by setting the following configuration to True. -disable_feedback_button = False - -# Add tags that you want to use for conditional inclusion of text -# (https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#tags) -custom_tags = [] - -# If you are using the :manpage: role, set this variable to the URL for the version -# that you want to link to: -# manpages_url = "https://manpages.ubuntu.com/manpages/noble/en/man{section}/{page}.{section}.html" - -############################################################ -### Additional configuration -############################################################ - -## Add any configuration that is not covered by the common conf.py file. - -# Define a :center: role that can be used to center the content of table cells. -rst_prolog = ''' -.. role:: center - :class: align-center -''' - -# Define a selector that only adds copy buttons to code blocks without the class `no-copy` -copybutton_selector = "div:not(.no-copy) > div.highlight > pre" - -# Define prompts to be excluded from copying when a copy button is used -copybutton_prompt_text = r"^.*?[\$>]\s+" -copybutton_prompt_is_regexp = True diff --git a/docs/explanations/index.md b/docs/explanations/index.md deleted file mode 100644 index 5cfaff0c9..000000000 --- a/docs/explanations/index.md +++ /dev/null @@ -1,9 +0,0 @@ -(explanations)= - -# Explanations - -```{toctree} -:titlesonly: - -up4w -``` diff --git a/docs/explanations/up4w.md b/docs/explanations/up4w.md deleted file mode 100644 index dfc914f1f..000000000 --- a/docs/explanations/up4w.md +++ /dev/null @@ -1,10 +0,0 @@ -# Ubuntu Pro for WSL - -Ubuntu Pro for WSL is an automation tool that runs on Windows hosts to -manage Ubuntu WSL instances, providing them with compliance by attaching them -to an [Ubuntu Pro subscription](https://ubuntu.com/pro) and enrolling them into -[Landscape](https://ubuntu.com/landscape). - -Documentation for UP4W can currently be found at the following link: - -[Ubuntu Pro for WSL Documentation](https://canonical-ubuntu-pro-for-wsl.readthedocs-hosted.com/en/latest/) diff --git a/docs/guides/assets/autoinstall/autoinstall-screenshot-1.png b/docs/guides/assets/autoinstall/autoinstall-screenshot-1.png deleted file mode 100644 index 8017016af..000000000 Binary files a/docs/guides/assets/autoinstall/autoinstall-screenshot-1.png and /dev/null differ diff --git a/docs/guides/assets/autoinstall/autoinstall-screenshot-2.png b/docs/guides/assets/autoinstall/autoinstall-screenshot-2.png deleted file mode 100644 index d4b3fdbb0..000000000 Binary files a/docs/guides/assets/autoinstall/autoinstall-screenshot-2.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/choose-distribution.png b/docs/guides/assets/install-ubuntu-wsl2/choose-distribution.png deleted file mode 100644 index 78fc36dbe..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/choose-distribution.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/click-item.png b/docs/guides/assets/install-ubuntu-wsl2/click-item.png deleted file mode 100644 index 4ac46e379..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/click-item.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/create-username.png b/docs/guides/assets/install-ubuntu-wsl2/create-username.png deleted file mode 100644 index a1a83db74..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/create-username.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/help-message.png b/docs/guides/assets/install-ubuntu-wsl2/help-message.png deleted file mode 100644 index 72d44badd..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/help-message.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu-windows.png b/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu-windows.png deleted file mode 100644 index b17fca8e6..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu-windows.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu.png b/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu.png deleted file mode 100644 index 38ff2b002..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu.png and /dev/null differ diff --git a/docs/guides/assets/install-ubuntu-wsl2/search-windlows-subsystem.png b/docs/guides/assets/install-ubuntu-wsl2/search-windlows-subsystem.png deleted file mode 100644 index d758be220..000000000 Binary files a/docs/guides/assets/install-ubuntu-wsl2/search-windlows-subsystem.png and /dev/null differ diff --git a/docs/guides/contributing.md b/docs/guides/contributing.md deleted file mode 100644 index 5fa2c4668..000000000 --- a/docs/guides/contributing.md +++ /dev/null @@ -1,13 +0,0 @@ -# Contributing - -% Include content from [../CONTRIBUTING.md](../CONTRIBUTING.md) -```{include} ../../CONTRIBUTING.md - :start-after: - :end-before: -``` - -% Include content from [../CONTRIBUTING.md](../CONTRIBUTING.md) -```{include} ../../CONTRIBUTING.md - :start-after: - :end-before: -``` diff --git a/docs/guides/index.md b/docs/guides/index.md deleted file mode 100644 index ffd93e7e6..000000000 --- a/docs/guides/index.md +++ /dev/null @@ -1,11 +0,0 @@ -(guides)= - -# How-to guides - -```{toctree} -:titlesonly: - -install-ubuntu-wsl2 -run-workflows-azure -contributing -``` diff --git a/docs/guides/install-ubuntu-wsl2.md b/docs/guides/install-ubuntu-wsl2.md deleted file mode 100644 index 0f6513ebe..000000000 --- a/docs/guides/install-ubuntu-wsl2.md +++ /dev/null @@ -1,138 +0,0 @@ -# Install Ubuntu on WSL2 -*Authored by Oliver Smith ([oliver.smith@canonical.com](mailto:oliver.smith@canonical.com)) and edited by Edu Gómez Escandell ([edu.gomez.escandell@canonical.com](mailto:edu.gomez.escandell@canonical.com))* - -## What you will learn - -* How to enable and install WSL on Windows 10 and Windows 11 -* How to install `Ubuntu 24.04 LTS` using the Microsoft Store or WSL commands in the terminal - -## What you will need - -* Windows 10 or 11 running on either a physical device or virtual machine -* All of the latest Windows updates installed - -## Install WSL - -You can install WSL from the command line. Open a PowerShell prompt as an Administrator (we recommend using [Windows Terminal](https://github.com/microsoft/terminal?tab=readme-ov-file#installing-and-running-windows-terminal)) and run: - -```{code-block} text -> wsl --install -``` - -This command will enable the features necessary to run WSL and also install the default Ubuntu distribution of Linux available in the Microsoft Store. It is recommended to reboot your machine after this initial installation to complete the setup. You can also install WSL from the Microsoft Store. - -## Install Ubuntu WSL - -WSL supports a variety of Linux distributions including the latest Ubuntu LTS release. Check our [reference on distributions](../reference/distributions.md) to see which one you prefer. - -There are multiple ways of installing distros on WSL, here we focus on two: the Microsoft Store application and WSL commands run in the terminal. The result is the same regardless of the method. - -### Method 1: Microsoft Store application - -Find the distribution you prefer on the Microsoft Store and then click **Get**. - -![Installation page for Ubuntu 24.04 LTS in the Microsoft store.](assets/install-ubuntu-wsl2/choose-distribution.png) - -Ubuntu will then be installed on your machine. Once installed, you can either launch the application directly from the Microsoft Store or search for Ubuntu in your Windows search bar. - -![Search results for Ubuntu 24.04 LTS in Windows search bar.](assets/install-ubuntu-wsl2/search-ubuntu-windows.png) - -### Method 2: WSL commands in the terminal - -It is possible to install the same Ubuntu versions available on the Microsoft Store directly from the command line. -In a PowerShell terminal, you can run `wsl --list --online` to see an output with all available distros and versions: - -```{code-block} text -:class: no-copy -The following is a list of valid distributions that can be installed. -The default distribution is denoted by '*'. -Install using 'wsl --install -d '. - - NAME FRIENDLY NAME -* Ubuntu Ubuntu - Debian Debian GNU/Linux - kali-linux Kali Linux Rolling - Ubuntu-18.04 Ubuntu 18.04 LTS - Ubuntu-20.04 Ubuntu 20.04 LTS - Ubuntu-22.04 Ubuntu 22.04 LTS - Ubuntu-24.04 Ubuntu 24.04 LTS -... - -``` - -Your list may be different once new distributions become available. - -You can install a version using a NAME from the output: - -```{code-block} text -> wsl --install -d Ubuntu-24.04 -``` - -You'll see an indicator of the installation progress in the terminal: - -```{code-block} text -:class: no-copy -Installing: Ubuntu 24.04 LTS -[==========================72,0%========== ] -``` - -Use `wsl -l -v` to see all your currently installed distros and the version of WSL they are using: - -```{code-block} text -:class: no-copy - NAME STATE VERSION - Ubuntu-20.04 Stopped 2 -* Ubuntu-24.04 Stopped 2 -``` - -## Note on installing images without the Microsoft Store - -If you do not have access to the Microsoft Store or need to install -a custom image it is possible to import a distribution as a tar file: - -```{code-block} text -> wsl --import -``` -Appx and MSIX packages for a given distro can also be downloaded and installed. -Please refer to Microsoft's documentation for more detailed information on these installation methods: - -- [Importing Linux distributions](https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro) -- [Installing distributions without the Microsoft Store](https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions) - -```{warning} -You should always try to use the latest LTS release of Ubuntu, as it offers the best security, reliability and support when using Ubuntu WSL. - -Currently we do not have a recommended store for downloading tar and Appx/MSIX files for Ubuntu distros. -``` - -## Run and configure Ubuntu - -To open an Ubuntu 24.04 terminal run the following command in PowerShell: - -```{code-block} text -> ubuntu2404.exe -``` - -Congratulations, you now have an Ubuntu terminal running on your Windows machine. - -Once it has finished its initial setup, you will be prompted to create a username and password. They don't need to match your Windows user credentials. - -Finally, it’s always good practice to install the latest updates by running the following commands within the Ubuntu terminal, entering your password when prompted: - -```{code-block} text -$ sudo apt update -$ sudo apt full-upgrade -y -``` - -## Enjoy Ubuntu on WSL - -In this guide, we’ve shown you how to install Ubuntu WSL on Windows 10 or 11. - -We hope you enjoy working with Ubuntu in WSL. Don’t for to check out [our blog](https://ubuntu.com/blog) for the latest news on all things Ubuntu. - -### Further Reading - -* [Setting up WSL for Data Science](https://ubuntu.com/blog/upgrade-data-science-workflows-ubuntu-wsl) -* [Whitepaper: Ubuntu WSL for Data Scientists](https://ubuntu.com/engage/ubuntu-wsl-for-data-scientists) -* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/) -* [Ask Ubuntu](https://askubuntu.com/) diff --git a/docs/guides/run-workflows-azure.md b/docs/guides/run-workflows-azure.md deleted file mode 100644 index ace293797..000000000 --- a/docs/guides/run-workflows-azure.md +++ /dev/null @@ -1,52 +0,0 @@ -# How to run your WSL GitHub workflow on Azure -> Read more: [How we improved testing Ubuntu on WSL – and how you can too!](https://ubuntu.com/blog/improved-testing-ubuntu-wsl) - -Most of the time, what works on Ubuntu desktop works on WSL as well. However, there are some exceptions. Furthermore, you may want to test software that lives both on Windows and inside WSL. In these cases, you may want to run your automated testing on a Windows machine with WSL rather than a regular ubuntu machine. - -There exist Windows GitHub runners, but they do not support the latest version of WSL. The reason is that WSL is now a Microsoft Store application, which requires a logged-in user. GitHub runners, however, run as a service. This means that they are not on a user session, hence they cannot run WSL (or any other store application). -> Read more: [What’s new in the Store version of WSL?](https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-in-the-microsoft-store-is-now-generally-available-on-windows-10-and-11/) - -## Summary - -We propose you run your automated tests on a Windows virtual machine hosted on Azure. This machine will run the GitHub actions runner not as a service, but as a command-line application. - -## Step-by-step - -This guide will show you how to set up an Azure VM to run your WSL workflows. - -1. Create a Windows 11 VM on Azure: follow Azure's instructions, no special customisation is necessary. - > Note: You can use any other hosting service. We use Azure in this guide because that is what we use for our CI. - -1. Install WSL with `wsl --install`. - -1. Enable automatic logon: use the registry to set up your machine to log on automatically. [Explanation here](https://learn.microsoft.com/en-us/troubleshoot/windows-server/user-profiles-and-logon/turn-on-automatic-logon). - -1. Add your runner to your repository: head to your repository's page on GitHub > Settings > Actions > Runners > New self-hosted runner. - Follow the instructions. Make sure you do not enable running it as a service. - -1. Set up your runner as a startup application: - 1. Go to the directory you installed the GitHub runner. - 2. Right-click on the `run.cmd` file, and click _Show more options_ > _Send to_ > _Desktop (create shortcut)_. - 3. Press Win+R, type `shell:startup` and press **OK**. A directory will open. - 4. Find the shortcut in the desktop and drag it to the startup directory. - -1. Set up your repository secrets - To add a new secret, head to your repository's page on GitHub > Settings > Secrets > Actions > New repository secret. - You'll need the following secret: - - `AZURE_VM_CREDS`: See the documentation [here](https://github.com/Azure/login#configure-deployment-credentials). - -1. Create your GitHub workflow. This workflow must have at least three jobs which depend each on the previous one. - 1. Start up the VM - 1. Your workflow(s) - 1. Stop the VM - - It is also recommended to add a `concurrency` directive to prevent different workflows from interleaving steps 1 and 3. - -1. Use our actions. We developed some actions to help you build your workflow. They are documented in the [WSL GitHub actions reference](reference::actions). - -## Example repositories -The following repositories use some variation of the workflow explained here. -- [Ubuntu/WSL-example hello world example](https://github.com/ubuntu/wsl-actions-example/blob/main/.github/workflows/test_wsl.yaml) -- [Ubuntu/WSL-example cloud-init testing](https://github.com/ubuntu/wsl-actions-example/blob/main/.github/workflows/test_cloud_init.yaml) -- [Ubuntu/WSL end-to-end tests](https://github.com/ubuntu/WSL/blob/main/.github/workflows/e2e.yaml) - \ No newline at end of file diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index f47bc55d5..000000000 --- a/docs/index.md +++ /dev/null @@ -1,81 +0,0 @@ -# Ubuntu WSL - -Benefit from the unrivalled developer experience of Ubuntu without leaving -Windows. - -Windows Subsystem for Linux (WSL) lets developers run a GNU/Linux environment -on Windows. The Ubuntu distribution for WSL is tightly integrated with the -Windows OS, supporting remote development from popular IDEs, cross-OS file -management and seamless local testing of web applications. Ubuntu WSL provides -a high-quality command line interface that is also suitable for launching -Linux-native graphical applications. - -Ubuntu WSL can be used to build projects in a performant Linux environment -without the overhead of traditional virtual machine or dual-boot setups. -Organisations that manage a Microsoft infrastructure can empower developers who -prefer a Linux-based workflow. With [Ubuntu Pro for WSL](explanations/up4w), large -fleets of Ubuntu WSL machines can also be administered with ease and security. - -Ubuntu WSL is for the programmer who wants a fully-featured Linux development -environment but must use a Windows device, the system administrator who -requires a secure way of supporting Linux on hundreds of Windows machines, and -the cross-platform app developer who needs to create projects that work on -Linux, Windows and the browser. - -## In this documentation - -````{grid} 1 1 2 2 - -```{grid-item-card} [Tutorials](tutorials/index) - -**Start here** with hands-on tutorials for new users to learn Ubuntu WSL -``` - -```{grid-item-card} [How-to guides](guides/index) - -**Follow step-by-step** instructions for performing common tasks with Ubuntu WSL, including making your own contributions to the project -``` - -```` - -````{grid} 1 1 2 2 -:reverse: - -```{grid-item-card} [Reference](reference/index) - -**Read technical descriptions** of important factual information relating to Ubuntu WSL -``` - -```{grid-item-card} [Explanations](explanations/index) - -**Read explanatory notes** on important concepts -``` - -```` - -## Project and community - -Ubuntu WSL and Ubuntu Pro for WSL are members of the Ubuntu family. These are open-source projects that warmly welcome community contributions, suggestions, fixes and constructive feedback. Check out our [contribution page](guides/contributing) for guidelines on how best to bring your ideas, bug reports and more. - -```{important} -We do not directly maintain WSL, which is a Microsoft product. -If you have identified a problem or bug in WSL then submit an Issue in -[Microsoft's WSL project repository](https://github.com/microsoft/WSL/issues/). - -``` - -- [Code of Conduct](https://ubuntu.com/community/ethos/code-of-conduct) -- [Contribute to the project](guides/contributing) -- [Ask and answer questions on the forum](https://discourse.ubuntu.com/c/wsl/27) - - -```{toctree} -:hidden: -:titlesonly: - -self -tutorials/index -guides/index -reference/index -explanations/index -``` diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 954237b9b..000000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/reference/actions.md b/docs/reference/actions.md deleted file mode 100644 index 1f88f58b2..000000000 --- a/docs/reference/actions.md +++ /dev/null @@ -1,78 +0,0 @@ -(reference::actions)= -# GitHub actions - -(reference::actions::download-rootfs)= -## Download rootfs -Download the latest Rootfs tarball for a particular release of Ubuntu WSL. -This can be used when you need better granularity than what is offered by [wsl-install](reference::actions::wsl-install), or you want to cache the rootfs. - -Its arguments are: -- `distros`: a comma-separated list of distros to download. Use the names as shown in WSL. Read more: [Ubuntu WSL distributions](reference::distros). Defaults to `Ubuntu`. -- `path`: the path where to store the tarball. The tarball will end up as `${path}\${distro}.tar.gz`. PowerShell-style environment variables will be expanded. If there already exists a tarball at the download path, a checksum comparison will be made to possibly skip the download. - -Example usage: -```yaml - - name: Download Jammy rootfs - uses: Ubuntu/WSL/.github/actions/download-rootfs@main - with: - distro: Ubuntu-22.04 - path: '${env:UserProfile}\Downloads\rootfs' -``` - -(reference::actions::wsl-install)= -## WSL install -> See also: [download-rootfs](reference::actions::download-rootfs) - -This action installs the Windows Subsystem for Linux application, and optionally an Ubuntu WSL application. - -Its arguments are: -- `distro`: Optional argument - - Blank (default): don't install any Ubuntu WSL distro - - Distro name: any of the available distros in the Microsoft store. Write its name as shown in WSL. Read more: [Ubuntu WSL distributions](reference::distros) - -Example usage: -```yaml - - name: Install or update WSL - uses: Ubuntu/WSL/.github/actions/wsl-install@main - with: - distro: Ubuntu-20.04 -``` - -## WSL checkout -This action checks out your repository in a WSL distro. If you want to check it out on the Windows file system, use the regular `actions/checkout` action instead. Example usage: - -Its arguments are: -- `distro`: an installed WSL distro. Write its name as it would appear on WSL. Read more: [Ubuntu WSL distributions](reference::distros) -- `working-dir`: the path where the repository should be cloned. Set to `~` by default. -- `submodules:`: Whether to fetch sub-modules or not. False by default. - -Example usage: -```yaml - - name: Check out the repository - uses: Ubuntu/WSL/.github/actions/wsl-checkout@main - with: - distro: Ubuntu-20.04 - working-dir: /tmp/github/ - submodules: true -``` - -## WSL bash -This action runs arbitrary bash code in your distro. - -Its arguments are: - - `distro`: an installed WSL distro. Write its name as it would appear on WSL. Read more: [Ubuntu WSL distributions](reference::distros) - - `exec`: the script to run. - - `working-dir`: path to the WSL directory to run the script in. Set to `~` by default. - -Example usage: -```yaml - - name: Install pip - uses: Ubuntu/WSL/.github/actions/wsl-bash@main - with: - distro: Ubuntu-20.04 - working-dir: /tmp/github/ - exec: | - DEBIAN_FRONTEND=noninteractive sudo apt update - DEBIAN_FRONTEND=noninteractive sudo apt install python3-pip -``` - diff --git a/docs/reference/distributions.md b/docs/reference/distributions.md deleted file mode 100644 index 5b57e0cb2..000000000 --- a/docs/reference/distributions.md +++ /dev/null @@ -1,24 +0,0 @@ -(reference::distros)= -# Distributions -Our flagship distribution is Ubuntu. This is the one that is installed by default when you install WSL for the first time. However, we develop several flavours. It may be the case that one or more of these flavours fits your needs better. - -Each of these flavours corresponds to a different application on the Microsoft Store, and once installed, they'll create different distros in your WSL. These are the applications we develop and maintain: -- [Ubuntu](https://apps.microsoft.com/detail/9PDXGNCFSCZV?hl=en-us&gl=US) ships the latest stable LTS release of Ubuntu. When new LTS versions are released, Ubuntu can be upgraded once the first point release is available. -- [Ubuntu 18.04.6 LTS](https://apps.microsoft.com/detail/9PNKSF5ZN4SW?hl=en-us&gl=US), [Ubuntu 20.04.6 LTS](https://apps.microsoft.com/detail/9MTTCL66CPXJ?hl=en-us&gl=US), and [Ubuntu 22.04.3 LTS](https://apps.microsoft.com/detail/9PN20MSR04DW?hl=en-us&gl=US) are the LTS versions of Ubuntu and receive updates for five years. Upgrades to future LTS releases will not be proposed. -- [Ubuntu (Preview)](https://apps.microsoft.com/detail/9P7BDVKVNXZ6?hl=en-us&gl=US) is a daily build of the latest development version of Ubuntu previewing new features as they are developed. It does not receive the same level of QA as stable releases and should not be used for production workloads. - -(naming)= -## Naming - -Due to different limitations in different contexts, these applications will have different names in different contexts. Here is a table matching them. - -1. App name is the name you'll see in the Microsoft Store and Winget. -2. AppxPackage is the name you'll see in `Get-AppxPackage`. -3. Distro name is the name you'll see when doing `wsl -l -v` or `wsl -l --online`. -4. Executable is the program you need to run to start the distro. - -| App name | AppxPackage name | Distro name | Executable | -| -------------------- | -------------------------------------- | ---------------- | ------------------- | -| `Ubuntu` | `CanonicalGroupLimited.Ubuntu` | `Ubuntu` | `ubuntu.exe` | -| `Ubuntu (Preview)` | `CanonicalGroupLimited.UbuntuPreview` | `Ubuntu-Preview` | `ubuntupreview.exe` | -| `Ubuntu XX.YY.Z LTS` | `CanonicalGroupLimited.UbuntuXX.YYLTS` | `Ubuntu-XX.YY` | `ubuntuXXYY.exe` | diff --git a/docs/reference/index.md b/docs/reference/index.md deleted file mode 100644 index 886f989ac..000000000 --- a/docs/reference/index.md +++ /dev/null @@ -1,10 +0,0 @@ -(reference)= - -# Reference - -```{toctree} -:titlesonly: - -distributions -actions -``` \ No newline at end of file diff --git a/docs/reuse/links.txt b/docs/reuse/links.txt deleted file mode 100644 index 04cfff56e..000000000 --- a/docs/reuse/links.txt +++ /dev/null @@ -1,4 +0,0 @@ -.. _reStructuredText style guide: https://canonical-documentation-with-sphinx-and-readthedocscom.readthedocs-hosted.com/style-guide/ -.. _Read the Docs at Canonical: https://library.canonical.com/documentation/read-the-docs -.. _How to publish documentation on Read the Docs: https://library.canonical.com/documentation/publish-on-read-the-docs -.. _Example product documentation: https://canonical-example-product-documentation.readthedocs-hosted.com/ diff --git a/docs/tutorials/assets/data-science-engineering/julia-fractal.png b/docs/tutorials/assets/data-science-engineering/julia-fractal.png deleted file mode 100644 index f60b6a8db..000000000 Binary files a/docs/tutorials/assets/data-science-engineering/julia-fractal.png and /dev/null differ diff --git a/docs/tutorials/assets/data-science-engineering/octave.png b/docs/tutorials/assets/data-science-engineering/octave.png deleted file mode 100644 index cccdbc81b..000000000 Binary files a/docs/tutorials/assets/data-science-engineering/octave.png and /dev/null differ diff --git a/docs/tutorials/assets/data-science-engineering/save-file.png b/docs/tutorials/assets/data-science-engineering/save-file.png deleted file mode 100644 index 207e53311..000000000 Binary files a/docs/tutorials/assets/data-science-engineering/save-file.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/bot-framework-emulator.png b/docs/tutorials/assets/dotnet-systemd/bot-framework-emulator.png deleted file mode 100644 index 2512c41de..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/bot-framework-emulator.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/emulator-settings.png b/docs/tutorials/assets/dotnet-systemd/emulator-settings.png deleted file mode 100644 index 5780115d4..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/emulator-settings.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/ipconfig.png b/docs/tutorials/assets/dotnet-systemd/ipconfig.png deleted file mode 100644 index d54bc437c..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/ipconfig.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/nano-service-file.png b/docs/tutorials/assets/dotnet-systemd/nano-service-file.png deleted file mode 100644 index 1e76573cf..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/nano-service-file.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/open-a-bot.png b/docs/tutorials/assets/dotnet-systemd/open-a-bot.png deleted file mode 100644 index 3367c004b..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/open-a-bot.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/program-cs.png b/docs/tutorials/assets/dotnet-systemd/program-cs.png deleted file mode 100644 index b3ade6be4..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/program-cs.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/start-chatting-service.png b/docs/tutorials/assets/dotnet-systemd/start-chatting-service.png deleted file mode 100644 index 03c768dc3..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/start-chatting-service.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/start-chatting.png b/docs/tutorials/assets/dotnet-systemd/start-chatting.png deleted file mode 100644 index fb68058cc..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/start-chatting.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/systemctl-status-inactive.png b/docs/tutorials/assets/dotnet-systemd/systemctl-status-inactive.png deleted file mode 100644 index 692719635..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/systemctl-status-inactive.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/systemctl-status-running.png b/docs/tutorials/assets/dotnet-systemd/systemctl-status-running.png deleted file mode 100644 index a8f111389..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/systemctl-status-running.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/templates.png b/docs/tutorials/assets/dotnet-systemd/templates.png deleted file mode 100644 index 8e8dfe120..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/templates.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/welcome-to-dotnet.png b/docs/tutorials/assets/dotnet-systemd/welcome-to-dotnet.png deleted file mode 100644 index 3ed29e8c9..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/welcome-to-dotnet.png and /dev/null differ diff --git a/docs/tutorials/assets/dotnet-systemd/your-bot-is-ready.png b/docs/tutorials/assets/dotnet-systemd/your-bot-is-ready.png deleted file mode 100644 index 5100c2566..000000000 Binary files a/docs/tutorials/assets/dotnet-systemd/your-bot-is-ready.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/default-dir.png b/docs/tutorials/assets/gpu-cuda/default-dir.png deleted file mode 100644 index 33d531ea9..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/default-dir.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/device-query.png b/docs/tutorials/assets/gpu-cuda/device-query.png deleted file mode 100644 index f2fe692d3..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/device-query.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/done-done.png b/docs/tutorials/assets/gpu-cuda/done-done.png deleted file mode 100644 index 71dc4e8ff..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/done-done.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/downloads-folder.png b/docs/tutorials/assets/gpu-cuda/downloads-folder.png deleted file mode 100644 index 6dc2c1af9..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/downloads-folder.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/install-drivers.png b/docs/tutorials/assets/gpu-cuda/install-drivers.png deleted file mode 100644 index 3bebd8fa1..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/install-drivers.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/install-finished.png b/docs/tutorials/assets/gpu-cuda/install-finished.png deleted file mode 100644 index 1a41c4e68..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/install-finished.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/installation-options.png b/docs/tutorials/assets/gpu-cuda/installation-options.png deleted file mode 100644 index 0e3558179..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/installation-options.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/installing.png b/docs/tutorials/assets/gpu-cuda/installing.png deleted file mode 100644 index 55436b8b2..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/installing.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/license.png b/docs/tutorials/assets/gpu-cuda/license.png deleted file mode 100644 index 2b4ed5960..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/license.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/make.png b/docs/tutorials/assets/gpu-cuda/make.png deleted file mode 100644 index 05c89c8f3..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/make.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/nvidia-allow-changes.png b/docs/tutorials/assets/gpu-cuda/nvidia-allow-changes.png deleted file mode 100644 index 64a005af5..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/nvidia-allow-changes.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/please-wait-install.png b/docs/tutorials/assets/gpu-cuda/please-wait-install.png deleted file mode 100644 index 5a02a9468..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/please-wait-install.png and /dev/null differ diff --git a/docs/tutorials/assets/gpu-cuda/splash-screen.png b/docs/tutorials/assets/gpu-cuda/splash-screen.png deleted file mode 100644 index 0af266aab..000000000 Binary files a/docs/tutorials/assets/gpu-cuda/splash-screen.png and /dev/null differ diff --git a/docs/tutorials/assets/interop/jupyter-python.jpg b/docs/tutorials/assets/interop/jupyter-python.jpg deleted file mode 100644 index ffe087d49..000000000 Binary files a/docs/tutorials/assets/interop/jupyter-python.jpg and /dev/null differ diff --git a/docs/tutorials/assets/interop/jupyter-script.png b/docs/tutorials/assets/interop/jupyter-script.png deleted file mode 100644 index 635ccf6e0..000000000 Binary files a/docs/tutorials/assets/interop/jupyter-script.png and /dev/null differ diff --git a/docs/tutorials/assets/interop/jupyter.png b/docs/tutorials/assets/interop/jupyter.png deleted file mode 100644 index 79e093510..000000000 Binary files a/docs/tutorials/assets/interop/jupyter.png and /dev/null differ diff --git a/docs/tutorials/assets/interop/spreadsheet.png b/docs/tutorials/assets/interop/spreadsheet.png deleted file mode 100644 index 06e315615..000000000 Binary files a/docs/tutorials/assets/interop/spreadsheet.png and /dev/null differ diff --git a/docs/tutorials/assets/interop/ubuntu-home.png b/docs/tutorials/assets/interop/ubuntu-home.png deleted file mode 100644 index 974830758..000000000 Binary files a/docs/tutorials/assets/interop/ubuntu-home.png and /dev/null differ diff --git a/docs/tutorials/assets/vscode/aditional-tasks.png b/docs/tutorials/assets/vscode/aditional-tasks.png deleted file mode 100644 index e8176ccbe..000000000 Binary files a/docs/tutorials/assets/vscode/aditional-tasks.png and /dev/null differ diff --git a/docs/tutorials/assets/vscode/download-vs-code.png b/docs/tutorials/assets/vscode/download-vs-code.png deleted file mode 100644 index ef7adea21..000000000 Binary files a/docs/tutorials/assets/vscode/download-vs-code.png and /dev/null differ diff --git a/docs/tutorials/assets/vscode/downloading-vscode-server.png b/docs/tutorials/assets/vscode/downloading-vscode-server.png deleted file mode 100644 index e2778a1a5..000000000 Binary files a/docs/tutorials/assets/vscode/downloading-vscode-server.png and /dev/null differ diff --git a/docs/tutorials/assets/vscode/hello-world.png b/docs/tutorials/assets/vscode/hello-world.png deleted file mode 100644 index f00f7b9fe..000000000 Binary files a/docs/tutorials/assets/vscode/hello-world.png and /dev/null differ diff --git a/docs/tutorials/assets/vscode/msstore.png b/docs/tutorials/assets/vscode/msstore.png deleted file mode 100644 index 13f451260..000000000 Binary files a/docs/tutorials/assets/vscode/msstore.png and /dev/null differ diff --git a/docs/tutorials/assets/vscode/remote-extension.png b/docs/tutorials/assets/vscode/remote-extension.png deleted file mode 100644 index 564c96abd..000000000 Binary files a/docs/tutorials/assets/vscode/remote-extension.png and /dev/null differ diff --git a/docs/tutorials/cloud-init.md b/docs/tutorials/cloud-init.md deleted file mode 100644 index 1b98857cd..000000000 --- a/docs/tutorials/cloud-init.md +++ /dev/null @@ -1,213 +0,0 @@ -# Automatic setup with cloud-init -*Authored by Carlos Nihelton ([carlos.santanadeoliveira@canonical.com](mailto:carlos.santanadeoliveira@canonical.com))* - -Cloud-init is an industry-standard multi-distribution method for cross-platform cloud instance initialisation. -Ubuntu WSL users can now leverage it to perform an automatic setup to get a working instance with minimal touch. - -> See more: [cloud-init official documentation](https://cloudinit.readthedocs.io/en/latest/index.html). - -The latest release of Ubuntu (Noble Numbat 24.04 LTS) comes with cloud-init already preinstalled, so you'll need that specific application to follow this tutorial. Ubuntu 24.04 LTS can be installed from [this link to the Microsoft Store](https://apps.microsoft.com/detail/9nz3klhxdjp5?hl=en-us&gl=US). A previous version of this tutorial used Ubuntu (Preview), because that comes with the latest in-development features. You can still use it to follow the instructions below, if you prefer. This feature is now available in the default Ubuntu application as well as Ubuntu 22.04 LTS. - -## What you will learn - -- How to write cloud-config user data to a specific WSL instance. -- How to automatically set up a WSL instance with cloud-init. -- How to verify that cloud-init succeeded with the configuration supplied. - -## What you will need - -- Windows 11 with WSL 2 already enabled -- The latest Ubuntu 24.04 LTS application from the Microsoft Store - -## Write the cloud-config file - -Locate your Windows user home directory. It typically is `C:\Users\`. - -> You can be sure about that path by running `echo $env:USERPROFILE` in PowerShell. - -Inside your Windows user home directory, create a new folder named `.cloud-init` (notice the `.` à la Linux -configuration directories), and inside the new directory, create an empty file named `Ubuntu-24.04.user-data`. That file name must -match the name of the distro instance that will be created in the next step. - -Open that file with your text editor of choice (`notepad.exe` is just fine) and paste in the following contents: - -```{code-block} yaml -#cloud-config -locale: pt_BR -users: -- name: jdoe - gecos: John Doe - groups: [adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev] - sudo: ALL=(ALL) NOPASSWD:ALL - shell: /bin/bash - -write_files: -- path: /etc/wsl.conf - append: true - content: | - [user] - default=jdoe - -packages: [ginac-tools, octave] - -runcmd: - - sudo git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg - - sudo apt-get install zip curl -y - - /opt/vcpkg/bootstrap-vcpkg.sh -``` - -Save it and close it. - -> That example will create a user named `jdoe` and set it as default via `/etc/wsl.conf`, install the packages -> `ginac-tools` and `octave` and install `vcpkg` from the git repository, since there is no deb or snap of that -> application (hence the reason for being included in this tutorial - it requires an unusual setup). - - -> See more: [WSL data source reference](https://cloudinit.readthedocs.io/en/latest/reference/datasources/wsl.html). - -## Register a new Ubuntu-24.04 instance - -In PowerShell, run: - -```{code-block} text -> ubuntu2404.exe -``` - -This command will register a new Ubuntu-24.04 instance that will be configured automatically by cloud-init. -The process can take several minutes, depending on your computer and network speeds. - -> If you want to be sure that there is now an Ubuntu-24.04 instance, run `wsl -l -v`. -> Notice that the application is named `Ubuntu24.04LTS` but the WSL instance created is named `Ubuntu-24.04`. -> See more about that naming convention in [our reference documentation](naming). - -## Verify automatic configuration by cloud-init - -When the setup is complete, the WSL instance's shell will be logged in as the user `jdoe`. -You should see the standard welcome text: - -```{code-block} text -:class: no-copy -Installing, this may take a few minutes... -Installation successful! -To run a command as administrator (user "root"), use "sudo ". -See "man sudo_root" for details. - -Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.6.36.3-microsoft-standard-WSL2 x86_64) - - * Documentation: https://help.ubuntu.com - * Management: https://landscape.canonical.com - * Support: https://ubuntu.com/pro - - System information as of ter 01 out 2024 14:32:47 -03 - - System load: 1.64 Processes: 63 - Usage of /: 0.2% of 1006.85GB Users logged in: 0 - Memory usage: 4% IPv4 address for eth0: 172.22.8.90 - Swap usage: 0% - - -This message is shown once a day. To disable it please create the -/home/jdoe/.hushlogin file. -jdoe@mib01:~$ -``` - -Once logged into the new distro instance's shell, verify that: - -1. The default user matches what was configured in the user data file (in our case `jdoe`). - -```{code-block} text -jdoe@mib:~$ whoami -``` - -This should be verified with the output message: - -```{code-block} text -:class: no-copy -jdoe -``` - -2. The supplied cloud-config user data was approved by cloud-init validation. - -```{code-block} text -jdoe@mib:~$ sudo cloud-init schema --system -``` - -Verified with the output: - -```{code-block} text -:class: no-copy -Valid schema user-data -``` - -3. The locale is set - -```{code-block} text -jdoe@mib:~$ locale -``` - -Verified with: - -```{code-block} text -:class: no-copy -LANG=pt_BR -LANGUAGE= -LC_CTYPE="pt_BR" -LC_NUMERIC="pt_BR" -LC_TIME="pt_BR" -LC_COLLATE="pt_BR" -LC_MONETARY="pt_BR" -LC_MESSAGES="pt_BR" -LC_PAPER="pt_BR" -LC_NAME="pt_BR" -LC_ADDRESS="pt_BR" -LC_TELEPHONE="pt_BR" -LC_MEASUREMENT="pt_BR" -LC_IDENTIFICATION="pt_BR" -LC_ALL= - -``` - -4. The packages were installed and the commands they provide are available. - -```{code-block} text -jdoe@mib:~$ apt list --installed | egrep 'ginac|octave' -``` - -Verified: - -```{code-block} text -:class: no-copy - -WARNING: apt does not have a stable CLI interface. Use with caution in scripts. - -ginac-tools/noble,now 1.8.7-1 amd64 [installed] -libginac11/noble,now 1.8.7-1 amd64 [installed,automatic] -octave-common/noble,now 8.4.0-1 all [installed,automatic] -octave-doc/noble,now 8.4.0-1 all [installed,automatic] -octave/noble,now 8.4.0-1 amd64 [installed] -``` - -5. Lastly, verify that the commands requested were also run. In this case we set up `vcpkg` from git, as recommended by its - documentation (there is no deb or snap available for that program). - -```{code-block} text -jdoe@mib:~$ /opt/vcpkg/vcpkg version -``` - -This should also be verified with: - -```{code-block} text -:class: no-copy -vcpkg package management program version 2024-01-11-710a3116bbd615864eef5f9010af178034cb9b44 - -See LICENSE.txt for license information. -``` - -## Enjoy! - -That’s all folks! In this tutorial, we’ve shown you how to use cloud-init to automatically set up Ubuntu on WSL 2 with minimal touch. - -This workflow will guarantee a solid foundation for your next Ubuntu WSL project. - -We hope you enjoy using Ubuntu inside WSL! - diff --git a/docs/tutorials/data-science-and-engineering.md b/docs/tutorials/data-science-and-engineering.md deleted file mode 100644 index 1e0e2a630..000000000 --- a/docs/tutorials/data-science-and-engineering.md +++ /dev/null @@ -1,93 +0,0 @@ -# Use WSL for data science and engineering -*Authored by Oliver Smith ([oliver.smith@canonical.com](mailto:oliver.smith@canonical.com)) and edited by Edu Gómez Escandell ([edu.gomez.escandell@canonical.com](mailto:edu.gomez.escandell@canonical.com))* - -WSL is an ideal platform to run your Linux workflows while using your Windows machines. Here we show an example of how to set up GNU octave and run a toy program. - -First, you'll need to set up Ubuntu on WSL, see [here](../guides/install-ubuntu-wsl2.md). - -## GNU octave - -> ⓘ GNU Octave is software featuring a [high-level programming language](https://en.wikipedia.org/wiki/High-level_programming_language), primarily intended for [numerical computations](https://en.wikipedia.org/wiki/Numerical_analysis). Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with [MATLAB](https://en.wikipedia.org/wiki/MATLAB). [[GNU / Octave](https://octave.org/about.html) ] - -We will use it to calculate and draw a beautiful Julia fractal. The goal here is to use Octave to demonstrate how WSLg works, not to go through the theory of fractals. - -From an Ubuntu WSL terminal prompt run: - -```{code-block} text -$ sudo apt update -$ sudo apt install -y octave -``` - -Then start the application: - -```{code-block} text -$ octave --gui & -``` - -Do not forget the ampersand `&` at the end of the line, so the application is started in the background and we can continue using the same terminal window. - -![Octave graphical interface running after the "octave" command was run with the gui flag in WSL.](assets/data-science-engineering/octave.png) - -In Octave, click on the `New script` icon to open a new editor window and copy/paste the following code: - -```{code-block} octave -#{ -Inspired by the work of Bruno Girin ([Geek Thoughts: Fractals with Octave: Classic Mandelbrot and Julia](http://brunogirin.blogspot.com/2008/12/fractals-with-octave-classic-mandelbrot.html)) -Calculate a Julia set -zmin: Minimum value of c -zmax: Maximum value of c -hpx: Number of horizontal pixels -niter: Number of iterations -c: A complex number -#} -function M = julia(zmin, zmax, hpx, niter, c) - %% Number of vertical pixels - vpx=round(hpx*abs(imag(zmax-zmin)/real(zmax-zmin))); - %% Prepare the complex plane - [zRe,zIm]=meshgrid(linspace(real(zmin),real(zmax),hpx), - linspace(imag(zmin),imag(zmax),vpx)); - z=zRe+i*zIm; - M=zeros(vpx,hpx); - %% Generate Julia - for s=1:niter - mask=abs(z)<2; - M(mask)=M(mask)+1; - z(mask)=z(mask).^2+c; - end - M(mask)=0; -end -``` - -This code is the function that will calculate the Julia set. Save it to a file named `julia.m`. Since it is a function definition, the name of the file must match the name of the function. - -Open a second editor window with the New Script button and copy and paste the following code: - -```{code-block} octave -Jc1=julia(-1.6+1.2i, 1.6-1.2i, 640, 128, -0.75+0.2i); -imagesc(Jc1) -axis off -colormap('default'); -``` - -This code calls the function defined in `julia.m`. You can later change the parameters if you want to explore the Julia fractal. - -Save it to a file named `juliatest.m`. - -And finally, press the button **Save File and Run**. - -![Octave graphical interface showing the "Save and Run button" for the julia test file.](assets/data-science-engineering/save-file.png) - -After a few seconds, depending on your hardware and the parameters, a Julia fractal is displayed. - -![Visualisation of a julia fractal.](assets/data-science-engineering/julia-fractal.png) - -Like Octave, this window is displayed using WSLg completely transparently to the user. - -Enjoy! - -### Further Reading -* [An introduction to numerical computation applications using Ubuntu WSL](https://www.youtube.com/watch?v=08WDGV0u58Y) -* [Setting up WSL for Data Science](https://ubuntu.com/blog/upgrade-data-science-workflows-ubuntu-wsl) -* [Whitepaper: Ubuntu WSL for Data Scientists](https://ubuntu.com/engage/ubuntu-wsl-for-data-scientists) -* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/) -* [Ask Ubuntu](https://askubuntu.com/) diff --git a/docs/tutorials/dotnet-systemd.md b/docs/tutorials/dotnet-systemd.md deleted file mode 100644 index be1f48ccf..000000000 --- a/docs/tutorials/dotnet-systemd.md +++ /dev/null @@ -1,251 +0,0 @@ -# Run a .NET Echo Bot as a systemd service on Ubuntu WSL -*Authored by Oliver Smith ([oliver.smith@canonical.com](mailto:oliver.smith@canonical.com))* - -In this tutorial we will take advantage of WSL's systemd support to run a chatbot as a systemd service for easier deployment. - -We will create the bot using .NET on Ubuntu WSL and it will be accessible from the Windows host. - -.NET is an open-source development platform from Microsoft that enables developers to build multi-platform applications from a single codebase. - -## Requirements - -* A PC running Windows 11 -* The latest version of WSL from the Microsoft Store -* Ubuntu, Ubuntu 22.04 LTS or Ubuntu 24.04 LTS -* Visual Studio Code (recommended) - -Systemd support is required for this tutorial and is available on WSL version 0.67.6 or higher. - -In your PowerShell terminal, you can check your current WSL version by running: - -```{code-block} text -> wsl --version -``` - -Inside WSL, you can check that systemd is enabled on your Ubuntu distribution with the following command: - -```{code-block} text -$ cat /etc/wsl.conf -``` - -If enabled the output will be: - -```{code-block} text -:class: no-copy -[boot] -systemd=true -``` - -If systemd is set to `false` then open the file with `sudo nano /etc/wsl.conf`, set it to `true` and save. -Make sure to restart your distribution after you have made this change. - -## Install .NET - -To install .NET 6 on Ubuntu 24.04 LTS we first need to add the backports archive for .NET. - -```{note} -If you are using Ubuntu 22.04 LTS you can skip the command for installing backports and install the .NET 6 bundle directly. -``` - -Run this command to install backports, which includes .NET 6: - -```{code-block} text -$ sudo add-apt-repository ppa:dotnet/backports -``` - -To install a bundle with both the SDK and runtime for .NET 6 run: - -```{code-block} text -$ sudo apt install dotnet6 -``` - -Run `dotnet --version` to confirm that the package was installed successfully. - -## Install and run the Bot Framework EchoBot template - -Create a new directory for the project and navigate to it before proceeding: - -```{code-block} text -$ mkdir ~/mybot -$ cd mybot -``` - -Once inside we can install the EchoBot C# template by running: - -```{code-block} text -$ dotnet new -i Microsoft.Bot.Framework.CSharp.EchoBot -``` - -We can then verify the template has been installed correctly: - -```{code-block} text -$ dotnet new --list -``` - -You should be able to find the `Bot Framework Echo Bot` template in the list. - -![Selecting "Bot Framework Echo Bot" from Dotnet templates in a terminal.](assets/dotnet-systemd/templates.png) - -Create a new Echo Bot project, with `echoes` as the name for our bot, using the following command: - -```{code-block} text -$ dotnet new echobot -n echoes -``` - -After this has completed we can navigate into the new directory that has been created. - -```{code-block} text -$ cd ~/mybot/echoes -``` - -From inside this directory the project should be ready to run. Test it with: - -```{code-block} text -$ sudo dotnet run -``` - -If everything was set up correctly you should see a similar output to the one below: - -![Bash snippets confirming that Echo bot was installed and set up correctly.](assets/dotnet-systemd/welcome-to-dotnet.png) - -Leave the EchoBot App running in WSL for now. Open a new browser window on your Windows host and navigate to `localhost:3978` where you should see the following window: - -![Windows desktop showing the Echo bot app running in a browser on local host.](assets/dotnet-systemd/your-bot-is-ready.png) - -Leave everything running as we move to the next step. - -## Install the Bot Emulator on Windows and connect to your bot - -Download the Bot Emulator from the official [Microsoft GitHub](https://github.com/Microsoft/BotFramework-Emulator/releases/tag/v4.14.1), taking care to select [BotFramework-Emulator-4.14.1-windows-setup.exe](https://github.com/microsoft/BotFramework-Emulator/releases/download/v4.14.1/BotFramework-Emulator-4.14.1-windows-setup.exe) and install. - -Running it will present you with the following screen, but before you can connect to your bot you need to change a few settings. - -![Bot Framework Emulator homepage.](assets/dotnet-systemd/bot-framework-emulator.png) - -First, get the IP address of your machine by running `ipconfig` in a PowerShell terminal. - -![Output of the "ipconfig" command showing network adapter details, including IPv4 addresses for Wi-Fi and WSL.](assets/dotnet-systemd/ipconfig.png) - -Then select the settings icon in the bottom-left corner of the Bot Framework Emulator and enter your IP under ‘localhost override'. - -![Bot Emulator settings page.](assets/dotnet-systemd/emulator-settings.png) - -Click **Save** and navigate back to the Welcome tab. - -Click **Open Bot** and under ‘Bot URL’ input: - -```text -http://localhost:3978/api/messages -``` - -!["Open a bot" dialog.](assets/dotnet-systemd/open-a-bot.png) - -And click **Connect** to connect to your Echo Bot running in WSL and start chatting! - -![Live chat with Echo bot.](assets/dotnet-systemd/start-chatting.png) - -Congratulations, your Echo Chat Bot App is running on Ubuntu WSL as an App. Now it is time to make it run as a service. - -## Running your Echo Bot as a systemd service - -Return to your running WSL distro and end the app with `Ctrl+C`. - -Then install the .NET systemd extension with: - -```{code-block} text -$ sudo dotnet add package Microsoft.Extensions.Hosting.Systemd -``` - -We can open our project with VS Code by running this command in the 'echoes' directory: - -```{code-block} text -$ code . -``` - -Navigate to ‘Program.cs’ and insert `.UseSystemd()` as a new line in the location shown in the screenshot. - -![The method for using systemd being added to line 21 of the file.](assets/dotnet-systemd/program-cs.png) - -Save and close the project in VS Code and return to your WSL terminal. - -Next we need to create a service file for your bot using your favourite editor, for example. - -```{code-block} text -$ sudo nano /etc/systemd/system/echoes.service -``` - -Then paste the snippet below taking care to replace `` with your username. - -```{code-block} text -[Unit] -Description=The first ever WSL Ubuntu systemd .NET ChatBot Service - -[Service] -WorkingDirectory=/home//mybot/echoes -Environment=DOTNET_CLI_HOME=/temp -ExecStart=dotnet run -SyslogIdentifier=echoes - -[Install] -WantedBy=multi-user.target -``` - -Save your file and reload your services with: - -```{code-block} text -$ sudo systemctl daemon-reload -``` - -To reload the services. You can check if your service is ready by running: - -```{code-block} text -$ systemctl status echoes.service -``` - -You should get the following output: - -![Results of running "systemctl status echoes.service" in the terminal.](assets/dotnet-systemd/systemctl-status-inactive.png) - -Now start your service: - -```{code-block} text -$ sudo systemctl start echoes.service -``` - -Then check its status again: - -```{code-block} text -$ sudo systemctl status echoes.service -``` - -If everything has been configured correctly you should get an output similar to the below. - -![Results of running "sudo systemctl" in the terminal.](assets/dotnet-systemd/systemctl-status-running.png) - -Return to your Windows host and reconnect to your Bot Emulator using the same information as before and confirm that your bot is running, but this time as a systemd service! - -![Live chat with Echo bot.](assets/dotnet-systemd/start-chatting-service.png) - -You can stop your bot from running at any time with the command: - -```{code-block} text -$ sudo systemctl stop echoes.service -``` - -## Tutorial complete! - -You now have a simple Echo Bot running as a systemd service on WSL that you can access from your host Windows machine. - -If you would like to expand on this example try reviewing some of the more advanced [Bot Framework samples](https://github.com/Microsoft/BotBuilder-Samples/blob/main/README.md) on the Microsoft GitHub. - -To read more about how Ubuntu supports .NET developers, making it easier than ever to build multi-platform services and applications, read our [previous announcement](https://ubuntu.com/blog/install-dotnet-on-ubuntu). - -### Further Reading - -* [.NET on Ubuntu](https://ubuntu.com/blog/install-dotnet-on-ubuntu) -* [Bot Framework samples](https://github.com/Microsoft/BotBuilder-Samples/blob/main/README.md) -* [Working with Visual Studio Code on Ubuntu WSL](vscode.md) -* [Enabling GPU acceleration on Ubuntu on WSL2 with the NVIDIA CUDA Platform](gpu-cuda.md) -* [Windows and Ubuntu interoperability on WSL2](interop.md) -* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/) -* [Ask Ubuntu](https://askubuntu.com/) diff --git a/docs/tutorials/gpu-cuda.md b/docs/tutorials/gpu-cuda.md deleted file mode 100644 index df57ac115..000000000 --- a/docs/tutorials/gpu-cuda.md +++ /dev/null @@ -1,147 +0,0 @@ -# Enabling GPU acceleration with the NVIDIA CUDA Platform -*Authored by Carlos Nihelton ([carlos.santanadeoliveira@canonical.com](mailto:carlos.santanadeoliveira@canonical.com))* - -While WSL's default setup allows you to develop cross-platform applications without leaving Windows, enabling GPU acceleration inside WSL provides users with direct access to the hardware. This provides support for GPU-accelerated AI/ML training and the ability to develop and test applications built on top of technologies, such as OpenVINO, OpenGL, and CUDA that target Ubuntu while staying on Windows. - -## What you will learn - -* How to install a Windows graphical device driver compatible with WSL2 -* How to install the NVIDIA CUDA toolkit for WSL 2 on Ubuntu -* How to compile and run a sample CUDA application on Ubuntu on WSL2 - -## What you will need - -* A Windows 10 version 21H2 or newer physical machine equipped with an NVIDIA graphics card and administrative permission to be able to install device drivers -* Ubuntu on WSL2 previously installed -* Familiarity with Linux command line utilities and interacting with Ubuntu on WSL2 - -> ⓘ Note: If you need more introductory topics, such as how to install Ubuntu on WSL, refer to previous tutorials that can be found [here](../guides/install-ubuntu-wsl2.md). - - -## Prerequisites - -The following steps assume a specific hardware configuration. Although the concepts are essentially the same for other architectures, different hardware configurations will require the appropriate graphics drivers and CUDA toolkit. - -Make sure the following prerequisites are met before moving forward: - -* A physical machine with Windows 10 version 21H2 or higher -* NVIDIA’s graphic card -* Ubuntu 20.04 or higher installed on WSL 2 -* Broadband internet connection able to download a few GB of data - -## Install the appropriate Windows vGPU driver for WSL - -> ⓘ Specific drivers are needed to enable use of a virtual GPU, which is how Ubuntu applications are able to access your GPU hardware, so you’ll need to follow this step even if your system drivers are up-to-date. - -Please refer to the official [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for up-to-date links matching your specific GPU vendor. You can find these in `Install support for Linux GUI apps > Prerequisites` . For this example, we will download the `NVIDIA GPU Driver for WSL`. - -![Install support for Linux GUI apps page on Microsoft WSL documentation.](assets/gpu-cuda/install-drivers.png) - -> ⓘ **Note:** This is the only device driver you’ll need to install. Do not install any display driver on Ubuntu. - -Once downloaded, double-click on the executable file and click `Yes` to allow the program to make changes to your computer. - -![Windows file explorer showing the downloaded NVIDIA GPU driver for WSL.](assets/gpu-cuda/downloads-folder.png) - -![Windows Package Installer confirmation page for NVIDIA Package Launcher.](assets/gpu-cuda/nvidia-allow-changes.png) - -Confirm the default directory and allow the self-extraction process to proceed. - -![Default directory confirmation page for NVIDIA Display Driver.](assets/gpu-cuda/default-dir.png) - -![NVIDIA Display Driver installation progress screen.](assets/gpu-cuda/please-wait-install.png) - -A splash screen appears with the driver version number and quickly turns into the main installer window. Read and accept the license terms to continue. - -![NVIDIA Graphics Driver startup page.](assets/gpu-cuda/splash-screen.png) - -![NVIDIA software license agreement.](assets/gpu-cuda/license.png) - -Confirm the wizard defaults by clicking `Next` and wait until the end of the installation. You might be prompted to restart your computer. - -![NVIDIA Graphics Driver installation options with "Express" checked.](assets/gpu-cuda/installation-options.png) - -![NVIDIA Virtual Host controller installation progress.](assets/gpu-cuda/installing.png) - -This step ends with a screen similar to the image below. - -![NVIDIA Graphics Driver installation success page.](assets/gpu-cuda/install-finished.png) - -## Install NVIDIA CUDA on Ubuntu - -> ⓘ Normally, CUDA toolkit for Linux will have the device driver for the GPU packaged with it. On WSL 2, the CUDA driver used is part of the Windows driver installed on the system, and, therefore, care must be taken `not` to install this Linux driver as previously mentioned. - -The following commands will install the WSL-specific CUDA toolkit version 11.6 on Ubuntu 22.04 AMD64 architecture. Be aware that older versions of CUDA (<=10) don’t support WSL 2. Also notice that attempting to install the CUDA toolkit packages straight from the Ubuntu repository (`cuda`, `cuda-11-0`, or `cuda-drivers`) will attempt to install the Linux NVIDIA graphics driver, which is not what you want on WSL 2. So, first remove the old GPG key: - -```{code-block} text -$ sudo apt-key del 7fa2af80 -``` - -Then setup the appropriate package for Ubuntu WSL with the following commands: - -```{code-block} text -$ wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin - -$ sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600 - -$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/3bf863cc.pub - -$ sudo add-apt-repository 'deb https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/ /' - -$ sudo apt-get update - -$ sudo apt-get -y install cuda -``` - -Once complete, you should see a series of outputs that end in `done.`: - -![Terminal output showing successful installation of NVIDIA CUDA toolkit on Ubuntu.](assets/gpu-cuda/done-done.png) - -Congratulations! You should have a working installation of CUDA by now. Let’s test it in the next step. - -## Compile a sample application - -NVIDIA provides an open source repository on GitHub with samples for CUDA Developers to explore the features available in the CUDA Toolkit. Building one of these is a great way to test your CUDA installation. Let’s choose the simplest one just to validate that our installation works. - -Let’s say you have a `~/Dev/` directory where you usually put your working projects. Navigate inside the directory and `git clone` the [cuda-samples repository](https://github.com/nvidia/cuda-samples): - -```{code-block} text -$ cd ~/Dev -$ git clone https://github.com/nvidia/cuda-samples -``` - -To build the application, go to the cloned repository directory and run `make`: - -```{code-block} text -$ cd ~/Dev/cuda-samples/Samples/1_Utilities/deviceQuery -$ make -``` - -A successful build will look like the screenshot below. - -![Terminal output showing the successful compilation of a CUDA sample application.](assets/gpu-cuda/make.png) - -Once complete, run the application with: - -```{code-block} text -$ ./deviceQuery -``` - -You should see a similar output to the following detailing the functionality of your CUDA setup (the exact results depend on your hardware setup): - -![Terminal output showing the results of running the device query sample application.](assets/gpu-cuda/device-query.png) - -## Enjoy Ubuntu on WSL! - -That’s all folks! In this tutorial, we’ve shown you how to enable GPU acceleration on Ubuntu on WSL 2 and demonstrated its functionality with the NVIDIA CUDA toolkit, from installation through to compiling and running a sample application. - -We hope you enjoy using Ubuntu inside WSL for your Data Science projects. Don’t forget to check out [our blog](https://ubuntu.com/blog) for the latest news on all things Ubuntu. - -### Further Reading - -* [Setting up WSL for Data Science](https://ubuntu.com/blog/wsl-for-data-scientist) -* [Ubuntu WSL for Data Scientists Whitepaper](https://ubuntu.com/engage/ubuntu-wsl-for-data-scientists) -* [NVIDIA's CUDA Post Installation Actions](gpu-cuda.md) -* [Install Ubuntu on WSL2](../guides/install-ubuntu-wsl2.md) -* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/) -* [Ask Ubuntu](https://askubuntu.com/) diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md deleted file mode 100644 index 755e016d5..000000000 --- a/docs/tutorials/index.md +++ /dev/null @@ -1,14 +0,0 @@ -(tutorials)= - -# Tutorials - -```{toctree} -:titlesonly: - -vscode -interop -dotnet-systemd -gpu-cuda -data-science-and-engineering -cloud-init -``` diff --git a/docs/tutorials/interop.md b/docs/tutorials/interop.md deleted file mode 100644 index ff4c02736..000000000 --- a/docs/tutorials/interop.md +++ /dev/null @@ -1,432 +0,0 @@ -# Windows and Ubuntu interoperability -*Authored by Didier Roche-Tolomelli ([didier.roche@canonical.com](mailto:didier.roche@canonical.com))* - -Some tools used during the development process are only available or are performed best on one platform and transferring data from one system to another to visualise or share can be tedious. WSL solves this problem with a feature called `interoperability`. - -Interoperability is the ability to transparently execute commands and applications, share files, network and environment variables across Windows and Ubuntu. - -We’ll illustrate all these notions by generating data from your Ubuntu WSL instance using your Windows user profile directory, perform some transformations via PowerShell scripts, and finally, visualise those on Windows. We are going to cross the chasm between the two worlds not just once, but many times, seamlessly! - -## What you will learn - -* How to access a service provided by a web server running on your Ubuntu WSL instance from Windows. -* Share environment variables between Windows and Ubuntu, back and forth. -* Access files across filesystems, and discover where they are located on both sides. -* Run Windows commands (command line and graphical) from your WSL instance and chain them. - -## What you will need - -* Know how to use command line tools on Windows or Linux. -* A PC with Windows 10 or 11. -* Optional: [LibreOffice](https://www.libreoffice.org/download/download-libreoffice/) or MS Excel to visualise and manipulate generated data from Ubuntu. - -## Install Ubuntu on WSL2 - -This tutorial assumes that you already have WSL2 installed with the latest LTS release of Ubuntu. - -If not, check out our getting started tutorial for Windows 10 and Windows 11: - -* [Install Ubuntu on WSL2](../guides/install-ubuntu-wsl2.md) - -For this tutorial, we will assume that you have installed the [Ubuntu](https://www.microsoft.com/en-us/p/ubuntu/9pdxgncfsczv?rtc=1&activetab=pivot:overviewtab) main WSL application. - -Once you have completed the relevant tutorial, the following steps will work on either Windows 10 or 11. - -Note: in this tutorial, we consider that interoperability is turned on in WSL.conf, which is the default behaviour. If you have disabled it, you can either use the ubuntu reconfiguration tool on Ubuntu 22.04+, or, for earlier versions, directly modify back `wsl.conf` yourself as described on [wsl.conf documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config). The settings you are interested in are `[Interop]`: `enabled` and `appendWindowsPath` both set to true (or not being present, which defaults to true). - -## Share ports between WSL and Windows - -### Install Jupyter notebook on WSL. - -Let’s install [Jupyter notebook](https://jupyter.org/), a web-based interactive computing platform where we will generate some statistics. - -1. In PowerShell, start an Ubuntu WSL instance: - -```{code-block} text -> ubuntu.exe -``` - -2. Now in the instance, install the python package manager [pip](https://pypi.org/project/pip/): - -```{code-block} text -$ sudo apt update -$ sudo apt install python3-pip -``` - -3. Get Jupyter notebook installed via pip: - -```{code-block} text -$ pip install notebook -``` - -### Executing Jupyter notebook. - -Finally, let’s start Jupyter, by adding it to the user PATH first: - -```{code-block} text -$ export PATH=$PATH:~/.local/bin -$ jupyter notebook --no-browser -``` - -This should generate output like the following: - -```{code-block} text -:class: no-copy -[I 10:52:23.760 NotebookApp] Writing notebook server cookie secret to /home/u/.local/share/jupyter/runtime/notebook_cookie_secret -[I 10:52:24.205 NotebookApp] Serving notebooks from local directory: /home/u -[I 10:52:24.205 NotebookApp] Jupyter Notebook 6.4.10 is running at: -[I 10:52:24.205 NotebookApp] http://localhost:8888/?token=1d80ee69da6238f22bb683a4acd00025d32d15dde91cbdf4 -[I 10:52:24.205 NotebookApp] or http://127.0.0.1:8888/?token=1d80ee69da6238f22bb683a4acd00025d32d15dde91cbdf4 -[I 10:52:24.205 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). -[C 10:52:24.209 NotebookApp] -To access the notebook, open this file in a browser: -file:///home/u/.local/share/jupyter/runtime/nbserver-5744-open.html -Or copy and paste one of these URLs: -http://localhost:8888/?token=1d80ee69da6238f22bb683a4acd00025d32d15dde91cbdf4 -or http://127.0.0.1:8888/?token=1d80ee69da6238f22bb683a4acd00025d32d15dde91cbdf4 -[I 10:53:03.628 NotebookApp] 302 GET / (127.0.0.1) 0.600000ms -[I 10:53:03.633 NotebookApp] 302 GET /tree? (127.0.0.1) 1.040000ms -``` - -If you look closely at the output, you will see that the Jupyter notebook is now running, and its interface is exposed via its internal web server on localhost, port 8888. - -### Accessing port 8888 - -This port can be accessed directly from our Ubuntu WSL instance via curl, lynx (a command line web browser), or any GUI web browser executed in WSL. - -However, this tutorial is not about running Linux GUI applications from WSL (which you can do), or visualising data in the command line, but interoperability! So, as you can guess, any network port exposed locally is also available from Windows directly, if no conflict occurs. - -Let’s try this right away: from Windows, launch a web browser and enter the `URL printed above` with the corresponding token, for example: `http://localhost:8888/?token=1d80ee69da6238f22bb683a4acd00025d32d15dde91cbdf4`. - -![Jupyter Notebook running in a web browser on local host, showing an empty notebook list.](assets/interop/jupyter.png) - -It works! You can thus easily expose and share any services that are using network ports between your Windows machine and WSL instances! - ->ⓘ **Note:** you need to keep this command line Window opened to have your Jupyter instance running. If you close it, the service will shut down and you won’t have access to it anymore. Other command-line operations in the same WSL instance should be done on another terminal. - -## Get access to Windows environment variables on WSL - -Our next step is to be able to generate some statistics on our Windows user personal directory. For Jupyter to access those, we need to know how to get access from our Ubuntu instance to the Windows partition(s). You may already know about it by reading documentation or blog posts, but let’s do something even cooler: let’s discover it by using environment variables! - -On another terminal, under PowerShell, let’s first check our Windows user profile directory: - -```{code-block} text -PS C:\Users\myuser> echo $env:USERPROFILE -``` - -The path will be outputted: - -```{code-block} text -:class: no-copy -C:\Users\myuser -``` - -Let’s share it with Ubuntu by setting `WSLENV`: - -```{code-block} text -PS C:\Users\myuser> $env:WSLENV="USERPROFILE" -PS C:\Users\myuser> ubuntu.exe -``` - -The last command will start ubuntu where we can test that the variable has been shared: - -```{code-block} text -$ echo $USERPROFILE -``` - -Running this command will again show the path: - -```{code-block} text -:class: no-copy -C:\Users\myuser -``` - -Awesome! Setting `WSLENV="ENVVAR1:ENVVAR2:…"` allows us to share multiple environment variables from Windows to our Ubuntu instance. We can then retrieve the value under Ubuntu. - -However, you may notice that the environment variable value was shared as is, which is fine in most cases but not for path-related content. Let’s check: - -```{code-block} text -$ ls 'C:\Users\myuser' -``` - -This will fail to list any files and output the following message: - -```{code-block} text -:class: no-copy -ls: cannot access 'C:\Users\myuser': No such file or directory -``` - -Indeed, `C:\Users\myuser` is not a compatible Linux-path where the Windows file system is located under WSL. - -Yet we haven’t done all that for nothing! `WSLENV` variable declaration can be suffixed with `/p`, which then translates any paths between Windows and your Linux instance. - -Let’s try again. Run `exit` to shutdown Ubuntu, then in PowerShell set `WSLENV` again using the `/p` suffix then start Ubuntu: - -```{code-block} text - -PS C:\Users\myuser> $env:WSLENV="USERPROFILE/p" -PS C:\Users\myuser> ubuntu.exe -``` - -Now in Ubuntu test the environmental variable like before: - -```{code-block} text -$ echo $USERPROFILE -``` - -The output should show that the path has been translated: - -```{code-block} text -:class: no-copy -/mnt/c/Users/myuser -``` - -Now let's check the Windows files with the Linux `ls` command: - -```{code-block} text -$ ls /mnt/c/Users/myuser -``` - -This should now list the files in the directory as expected: - -```{code-block} text -:class: no-copy -AppData -'Application Data' -Contacts -Cookies -Desktop -[…] -``` - -There we go! We now know where our user profile data is accessible on WSL thanks to environment variables sharing. More generally, environment variables could be used in your scripts, or any services in your WSL instance, where parameters are controlled from Windows. - -Going further: - -* There are many other flags available for environment variables sharing via `WSLENV`. Check out the reference section to have a look at some handy links explaining each of them. -* The place where your Windows filesystems are mounted can vary depending on your configuration. This can be changed with our configuration tool on Ubuntu 22.04+ or by modifying the `automount` section [in wsl.conf](https://learn.microsoft.com/en-us/windows/wsl/wsl-config). - -With this, we are now ready to generate some statistics on your Windows user profile directory from our WSL instance! - -## Accessing Windows file from Ubuntu to run our script - -After this little detour into the command line world to discover which path to use, let’s go back to our Jupyter interface in our browser running on Windows. - -We are going to create a `stats-raw.csv` file, containing statistics about our user profile directory. - -Some preliminary warnings: accessing Windows filesystem from Ubuntu is using the [9P protocol](https://en.wikipedia.org/wiki/9P_(protocol)), which might mean slower access and indexing of files than native performance. So that this section doesn’t take too long to complete, we are advising you to choose a subdirectory or your Windows user profile directory, with fewer files and directories to run over. Here, we will be calling this `/mnt/c/Users/mysuser/path/my/subdirectory`. - -From the main screen of Jupyter, create a new notebook to start developing an interactive Python solution. You can do this by clicking on the **New** button, and then clicking on the **Python 3** option, as we can see below. - -![Jupyter interface showing the creation of a new Python 3 notebook. The "New" button is clicked, revealing a dropdown menu with "Python 3" highlighted.](assets/interop/jupyter-python.jpg) - -Copy this to the first cell, taking care to edit the input directory: - -```python -import os -import mimetypes -import csv - -data = {} - -for root, dirs, files in os.walk("/mnt/c/Users/mysuser/path/my/subdirectory"): - for f in files: - mime_type, encoding = mimetypes.guess_type(os.path.join(root, f)) - if not mime_type: - continue - if mime_type not in data: - data[mime_type] = 0 - data[mime_type] += 1 - -csv_cols = ["mime_type", "count"] -with open("stats-raw.csv", "w") as f: - writer = csv.writer(f) - writer.writerow(csv_cols) - for mime_type, count in data.items(): - writer.writerow([mime_type, count]) - -print(data) -``` - -This script will enumerate all files under `/mnt/c/Users/mysuser/path/my/subdirectory`, get the mime types of each entry, and count them. It will write the result in your Ubuntu user home directory as a [Comma-separated Values](https://en.wikipedia.org/wiki/Comma-separated_values) file named `stats-raw.csv` and print it as well for your viewing pleasure. :) - -Let’s execute it by clicking on the “Run” button in the web interface. - -![Python script in a Jupyter notebook.](assets/interop/jupyter-script.png) - -Note that while the entry is running, you will have a `In [*]` with the star marker. This will be replaced by `In [1]:` when completed. Once this is completed and the results have been printed, let’s ensure that the CSV file is present on disk using an Ubuntu terminal: - -```{code-block} text -$ cat stats-raw.csv -``` - -The output should look like this: - -```{code-block} text -:class: no-copy -mime_type,count -text/plain,468 -chemical/x-cerius,3 -application/x-pkcs12,5 -application/zip,27 -text/x-chdr,522 -text/markdown,840 -text/x-c++src,235 -application/json,1199 -application/xml,305 -application/javascript,250 -text/css,49 -image/png,3459 -image/svg+xml,534 -application/vnd.ms-pki.seccat,2 -application/x-msdos-program,583 -chemical/x-pdb,20 -chemical/x-cache,13 -chemical/x-ncbi-asn1-binary,3 -image/vnd.microsoft.icon,91 -[…] - -``` - -## Accessing Ubuntu files from Windows - -So, we now have a stat file on Ubuntu, which is the result of computation on files stored on the Windows partition. We now want to analyse this file using Windows tools, but can we access it from Windows? - -Of course, interoperability goes both ways, and we already know exactly how to discover where those are available on Windows: introducing sharing environment variable round 2! - -### Start PowerShell from Ubuntu and share the HOME directory - -Similarly to `USERPROFILE`, we want, this time, to share the user `HOME` variable with Windows, and let interoperability translate it to a Windows-compatible path. In an Ubuntu terminal set the environment variable, making sure to use the `/p` suffix then open a Windows command prompt: - -```{code-block} text -$ export WSLENV=HOME/p -$ cmd.exe -``` - -We can check if the path has been translated with: - -```{code-block} text -C:\Windows> set HOME -``` - -The following output confirms a Windows-compatible path: - -```{code-block} text -:class: no-copy -HOME=\\wsl.localhost\Ubuntu\home\u -``` - - -First, we are able to export the `HOME` variable to subprocess, telling us that we want to translate the path back to Windows compatible paths by appending `/p` as we previously saw. But this is not all: we are running `cmd.exe` from an Ubuntu terminal (which is itself running inside a PowerShell terminal), and get the corresponding Windows path! Even if that sounds a little bit like the movie Inception, using this feature is just seamless: you are launching any process, Linux or Windows, from your Ubuntu terminal. Inputs and outputs are connected and this complex machinery works flawlessly! - -### Accessing Linux files from Windows - -Open Windows Explorer and navigate to that path to confirm they are visible there: - -![Screenshot of Windows file explorer containing the stats-raw csv file.](assets/interop/ubuntu-home.png) - -Let’s now create a PowerShell script, from Windows, on this Ubuntu filesystem and save it there: - -You can open any editor, from Notepad to a full-fledged IDE. Create a file named `filter-less-than-five.ps1` under `\\wsl.localhost\Ubuntu\home\` (with the following content: - -```{code-block} powershell -$csvImport = $input | ConvertFrom-CSV - -# Create Array for Exporting out data -$csvArray = [System.Collections.ArrayList]@() - -# Filter lines where count less than 5 -Foreach ($csvImportedItem in $csvImport){ - if([int]$csvImportedItem.count -ge 5){ - $csvArray += $csvImportedItem - } -} - -$csvArray | convertTo-CSV -NoTypeInformation -``` - -This script will take a CSV-formatted content as input, filter any item which has less than 5 occurrences and will then export it to the standard output as another CSV-formatted content. - -After saving, let’s check that it’s available on the WSL side: - -```{code-block} text -$ cat filter-less-than-five.ps1 -``` - -You should see the file content there. - -This PowerShell script, written from Windows on your Linux instance will be quite handy to create a pipeline between applications. - -## Execute and connect Linux and Windows executables. - -This is all very impressive, we have been able to share network, environment variables, paths and files, as well execute processes interchangeably between Ubuntu and Windows. Let’s go one step further by chaining all of this together in a single, but effective line: - -```{code-block} text -$ cat stats-raw.csv | powershell.exe -ExecutionPolicy Bypass -File $HOME/filter-less-than-five.ps1 | tee stats.csv -``` - -This yields the output: - -```{code-block} text -:class: no-copy -"mime_type","count" -"text/plain","468" -"application/x-pkcs12","5" -"application/zip","27" -"text/x-chdr","522" -"text/markdown","840" -"text/x-c++src","235" -"application/json","1199" -"application/xml","305" -[…] -``` - -Let’s figure out what happens here: - -1. We are executing a Linux application `cat` to display file content, hosted on Ubuntu. -2. We are then executing `powershell.exe` from Ubuntu which: - - 1. Takes as input the content piped from Ubuntu. - 2. This PowerShell application uses a script, hosted on Ubuntu (that we wrote from Windows in the previous section), converted transparently to a Windows path for PowerShell to be able to consume it. - 3. Then, the script proceeds with some operations on the content and prints on stdout the filtered CSV data. - -3. This is then piped back to Ubuntu, to be processed by the `tee` command, which writes `stats.csv` to the Ubuntu filesystem, and displays the resulting output. - -This simple command exercises many concepts of interoperability we saw in previous sections. However, as you can see, this is completely transparent to us! - -This deep integration for back-and-forth access between systems allows users to create awesome pipelines, taking the best tool that is available, independent of their host operating system. To make that easy, WSL transparently converts any paths and does the heavy lifting for you so that you don’t need to do the manual conversion! - -Finally, we can even run the default associated GUI Windows application associated with those files, from Ubuntu: - -```{code-block} text -$ explorer.exe stats.csv -``` - -Note: You can’t deny it’s really amazing to be able to execute explorer.exe from Ubuntu. :) - -This will open LibreOffice, Microsoft Excel, or any other tool you may have associated with CSV files. From there, you will be able to draw beautiful charts and do data analysis, but that’s another story… - -![Windows desktop showing the PowerShell terminal and data visualizations for file statistics in LibreOffice Calc.](assets/interop/spreadsheet.png) - -## Enjoy Ubuntu on WSL! - -That’s all folks! In this tutorial, we’ve shown you many aspects of interoperability on WSL. To sum it up, we can: - -* **Run Ubuntu commands from a Windows PowerShell prompt** such as cut, grep, or awk. -* **Run Windows commands from an Ubuntu Terminal** such as explorer.exe, notepad.exe and many others. -* **Share network ports** between Ubuntu and Windows systems. -* **Share environment variables** between Ubuntu and Windows systems. -* **Open files** on the `Windows` file system from `Ubuntu`. -* Browse the Ubuntu file system **from Windows Explorer**. -* **Pipe and connect any commands or applications** between Ubuntu and Windows systems. - -We hope you enjoy using Ubuntu inside WSL. Don’t forget to check out our other tutorials for tips on how to optimise your WSL experience. - -### Further Reading - -* [WSL ENV documentation](https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/) -* [WSL.conf documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config) -* [Jupyter notebook](https://jupyter.org/) -* [Install Ubuntu on WSL2](../guides/install-ubuntu-wsl2.md) -* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/) -* [Ask Ubuntu](https://askubuntu.com/) diff --git a/docs/tutorials/vscode.md b/docs/tutorials/vscode.md deleted file mode 100644 index 759691131..000000000 --- a/docs/tutorials/vscode.md +++ /dev/null @@ -1,165 +0,0 @@ -# Working with Visual Studio Code -*Authored by Oliver Smith ([oliver.smith@canonical.com](mailto:oliver.smith@canonical.com))* - -The easiest way to access your Ubuntu development environment in WSL is by using Visual Studio Code via the built-in `Remote` extension. - -## What you will learn: - -* How to set up Visual Studio Code for remote development on Ubuntu on WSL -* How to start a basic Node.js webserver on Ubuntu using Visual Studio Code - -## What you will need: - -* A PC with Windows 10 or 11 -* (Optional) This tutorial uses [Windows Terminal Preview](https://www.microsoft.com/en-us/p/windows-terminal-preview/9n8g5rfz9xk3?activetab=pivot:overviewtab), which you can get from the Microsoft Store - -## Install Ubuntu on WSL2 - -This tutorial assumes that you already have WSL2 installed with the latest LTS release of Ubuntu. - -If not, check out our getting started tutorials for Windows 10 and Windows 11: - -* [Install Ubuntu on WSL2](../guides/install-ubuntu-wsl2.md) - -Once you have completed the relevant tutorial, the following steps will work on either Windows 10 or 11. - -## Install Visual Studio Code on Windows - -One of the advantages of WSL is that it can interact with the native Windows version of Visual Studio Code using its remote development extension. - -To install Visual Studio Code visit the Microsoft Store and search for Visual Studio Code. - -Then click **Install**. - -![Installation page for Visual Studio Code on the Microsoft Store.](assets/vscode/msstore.png) - -Alternatively, you can install Visual Studio Code from the web link [here](https://code.visualstudio.com/Download). - -![Visual Studio Code download page showing download options for Windows, Linux, and Mac.](assets/vscode/download-vs-code.png) - -During installation, under the 'Additional Tasks' step, ensure the `Add to PATH` option is checked. - -![Visual Studio Code's "Additional Tasks" setup dialog with the "Add to Path" and "Register Code as an editor for supported file types" options checked.](assets/vscode/aditional-tasks.png) - -Once the installation is complete, open Visual Studio Code. - -## Install the Remote Development Extension - -Navigate to the `Extensions` menu in the sidebar and search for `Remote Development`. - -This is an extension pack that allows you to open any folder in a container, remote machine, or in WSL. Alternatively, you can just install `Remote - WSL`. - -![Installation page for the Remote Development Visual Studio Code extension.](assets/vscode/remote-extension.png) - -Once installed we can test it out by creating an example local web server with Node.js - -## Install Node.js and create a new project - -Open your WSL Ubuntu terminal and ensure everything is up to date by typing: - -```{code-block} text -$ sudo apt update -``` - -Then: - -```{code-block} text -$ sudo apt upgrade -``` - -Entering your password and pressing `Y` when prompted. - -Next, install Node.js and npm: - -```{code-block} text -$ sudo apt-get install nodejs -$ sudo apt install npm -``` - -Press `Y` when prompted. - -Now, create a new folder for our server. - -```{code-block} text -$ mkdir serverexample/ -``` - -Then navigate into it: - -```{code-block} text -$ cd serverexample/ -``` - -Now, open up your folder in Visual Studio Code, you can do this by typing: - -```{code-block} text -$ code . -``` - -The first time you do this, it will trigger a download for the necessary dependencies: - -![Bash snippet showing the installation of Visual Studio Code Server's required dependencies.](assets/vscode/downloading-vscode-server.png) - -Once complete, your native version of Visual Studio Code will open the folder. - -## Creating a basic web server - -In Visual Studio Code, create a new file called `package.json` and add the following text ([original example](https://learn.microsoft.com/en-gb/archive/blogs/cdndevs/visual-studio-code-and-local-web-server#3-add-a-packagejson-file-to-the-project-folder)) - -```{code-block} json -{ - "name": "Demo", - "version": "1.0.0", - "description": "demo project.", - "scripts": { - "lite": "lite-server --port 10001", - "start": "npm run lite" - }, - "author": "", - "license": "ISC", - "devDependencies": { - "lite-server": "^1.3.1" - } -} -``` - -Save the file and then, in the same folder, create a new one called `index.html` - -Add the following text, then save and close: - -```{code-block} html -

Hello World

-``` - -Now return to your Ubuntu terminal (or use the Visual Studio Code terminal window) and type the following to install a server defined by the above specifications detailed in `package.json`: - -```{code-block} text -$ npm install -``` - -Finally, type the following to launch the web server: - -```{code-block} text -$ npm start -``` - -You can now navigate to `localhost:10001` in your native Windows web browser by using `CTRL+LeftClick` on the terminal links. - -![Windows desktop showing a web server being run from a terminal with "npm start", A Visual Studio Code project with a "hello world" html file, and a web browser showing the "hello world" page being served on local host.](assets/vscode/hello-world.png) - -That’s it! - -By using Ubuntu on WSL you’re able to take advantage of the latest Node.js packages available on Linux as well as the more streamlined command line tools. - -## Enjoy Ubuntu on WSL! - -In this tutorial, we’ve shown you how to connect the Windows version of Visual Studio Code to your Ubuntu on WSL filesystem and launch a basic Node.js webserver. - -We hope you enjoy using Ubuntu inside WSL. Don’t forget to check out our other tutorials for tips on how to optimise your WSL setup for Data Science. - -### Further Reading - -* [Install Ubuntu on WSL2](../guides/install-ubuntu-wsl2.md) -* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/) -* [Setting up WSL for Data Science](https://ubuntu.com/blog/wsl-for-data-scientist) -* [Ask Ubuntu](https://askubuntu.com/)