From 17a8a41293b6d18159f67a889aa0cbd0e2d2aae0 Mon Sep 17 00:00:00 2001 From: Junghwan Park Date: Sat, 6 May 2023 21:02:12 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Feature:=20devcontainer=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/Dockerfile | 8 ++++++++ .devcontainer/devcontainer.json | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..8b72dbce --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,8 @@ +FROM mcr.microsoft.com/vscode/devcontainers/python:3.9 + +COPY ../requirements-noplot.txt /tmp/pip-tmp/requirements.txt + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install git gcc unzip make -y \ + && pip3 install --disable-pip-version-check --no-cache-dir -r /tmp/pip-tmp/requirements.txt \ + && rm -rf /tmp/pip-tmp diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..48008959 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +{ + "name": "PyTorch Tutorials-kr", + "build": { + "context": "..", + "dockerfile": "Dockerfile", + "args": {} + }, + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "workbench.startupEditor": "none", + "files.autoSave": "afterDelay", + "python.dataScience.enabled": true, + "python.dataScience.alwaysTrustNotebooks": true, + "python.insidersChannel": "weekly", + "python.showStartPage": false + }, + "extensions": ["ms-python.python", "lextudio.restructuredtext"] +} From 720d5917c98796f4581f6ce30cd596acdbb23a08 Mon Sep 17 00:00:00 2001 From: Junghwan Park Date: Sat, 6 May 2023 21:21:45 +0900 Subject: [PATCH 2/4] =?UTF-8?q?Feature:=20make=20serve=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20noplot=EC=9A=A9=20requirements=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 13 +++++++++++++ requirements-noplot.txt | 9 +++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 122ce436..eaa533e3 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,19 @@ html-noplot: @echo @echo "HTML-ONLY build finished. The HTML pages are in $(BUILDDIR)/html." +serve: + @echo + @echo "Open your browser and visit http://localhost:8000" + cd $(BUILDDIR)/html && python -m http.server + +serve-docs: + make docs + make serve + +serve-noplot: + make html-noplot + make serve + clean-cache: make clean rm -rf advanced beginner intermediate recipes diff --git a/requirements-noplot.txt b/requirements-noplot.txt index 9d5ed93d..d47c2534 100644 --- a/requirements-noplot.txt +++ b/requirements-noplot.txt @@ -10,14 +10,11 @@ sphinx-sitemap==2.2.0 sphinxext-opengraph==0.6.3 sphinxcontrib-katex==0.8.6 jinja2==3.0.3 -plotly==5.14.0 +bs4 +pillow==9.3.0 +plotly==5.14.0 torch -torchvision -torchtext -torchaudio -torchdata -networkx # PyTorch Korea Theme pytorch-sphinx-theme@https://github.com/PyTorchKorea/pytorch_sphinx_theme/archive/master.zip From b8995d85171229e099297bf731bfe681189ff5b5 Mon Sep 17 00:00:00 2001 From: Junghwan Park Date: Sat, 6 May 2023 21:38:23 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Feature:=20devcontainer=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EC=B6=94=EA=B0=80=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 48008959..cfc9f561 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,10 +1,21 @@ { - "name": "PyTorch Tutorials-kr", + // devcontainer name + "name": "PyTorchKorea-tutorials-kr", + + // Container build settings "build": { "context": "..", "dockerfile": "Dockerfile", "args": {} }, + + // Ports to open + "forwardPorts": [ + // Python built-in web server + 8000 + ], + + // VSCode settings "settings": { "terminal.integrated.shell.linux": "/bin/bash", "workbench.startupEditor": "none", @@ -14,5 +25,23 @@ "python.insidersChannel": "weekly", "python.showStartPage": false }, - "extensions": ["ms-python.python", "lextudio.restructuredtext"] + + // VSCode extensions to install + "extensions": [ + "ms-python.python", + "streetsidesoftware.code-spell-checker", + + // reStructuredText + "lextudio.restructuredtext", + + // Markdown + "bierner.github-markdown-preview", + "DavidAnson.vscode-markdownlint", + "docsmsft.docs-linting", + "johnpapa.read-time", + "yzhang.markdown-all-in-one", + ], + + // User, more info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } From dca24369204294928ea22f68b927672f17a569f7 Mon Sep 17 00:00:00 2001 From: Junghwan Park Date: Sat, 6 May 2023 21:51:58 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Feature:=20make=20serve=20=EC=95=88?= =?UTF-8?q?=EB=82=B4=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eaa533e3..f6b8b9a4 100644 --- a/Makefile +++ b/Makefile @@ -129,8 +129,11 @@ html-noplot: @echo "HTML-ONLY build finished. The HTML pages are in $(BUILDDIR)/html." serve: - @echo - @echo "Open your browser and visit http://localhost:8000" + @echo "---------------------------------------------------------------------------------" + @echo "* Open your browser and visit http://localhost:8000/ *" + @echo "* If you're using Codespace, click on the 'Ports' tab and then 'Open Browser' *" + @echo "* or try https://$(CODESPACE_NAME)-8000.preview.app.github.dev/ *" + @echo "---------------------------------------------------------------------------------" cd $(BUILDDIR)/html && python -m http.server serve-docs: