Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Oct 25, 2023
1 parent 71bba11 commit 512d461
Show file tree
Hide file tree
Showing 10 changed files with 1,167 additions and 469 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
07824c48
869dbe33
1,449 changes: 1,069 additions & 380 deletions chapters/append/cheatsheets.html

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions chapters/append/lab-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ <h1 class="title"><span id="sec-append-lab" class="quarto-section-identifier">Ap
<p>This section aims to clarify the relationship between the assets you’ll make in each portfolio exercise and labs in this book.</p>
<table class="table">
<colgroup>
<col style="width: 25%">
<col style="width: 75%">
<col style="width: 21%">
<col style="width: 78%">
</colgroup>
<thead>
<tr class="header">
Expand All @@ -358,22 +358,22 @@ <h1 class="title"><span id="sec-append-lab" class="quarto-section-identifier">Ap
<tbody>
<tr class="odd">
<td><a href="../sec1/1-1-env-as-code.html"><span>Chapter&nbsp;1</span></a>: Environments as Code</td>
<td>Create a Quarto side that uses <code>{renv}</code> and <code>{venv}</code> to create standalone R and Python virtual environments, create a page on the website for each.</td>
<td>Create a Quarto site that uses <code>{renv}</code> and <code>{venv}</code> to create standalone R and Python virtual environments. Add an R EDA page and Python modeling.</td>
</tr>
<tr class="even">
<td><a href="../sec1/1-3-data-access.html"><span>Chapter&nbsp;3</span></a>: Data Architecture</td>
<td>Move data into a DuckDB database.</td>
</tr>
<tr class="odd">
<td><a href="../sec1/1-2-proj-arch.html"><span>Chapter&nbsp;2</span></a>: Project Architecture</td>
<td>Create an API that serves a Python machine-learning model using <code>{vetiver}</code> and <code>{fastAPI}</code>. Call that API from a Shiny App in both R and Python.</td>
</tr>
<tr class="odd">
<td><a href="../sec1/1-3-data-access.html"><span>Chapter&nbsp;3</span></a>: Data Architecture</td>
<td>Move data into a DuckDB database and serve model predictions from an API.</td>
</tr>
<tr class="even">
<td><a href="../sec1/1-4-monitor-log.html"><span>Chapter&nbsp;4</span></a>: Logging and Monitoring</td>
<td>Add logging to the app from <a href="../sec1/1-2-proj-arch.html">Chapter&nbsp;<span>2</span></a>.</td>
</tr>
<tr class="odd">
<td><a href="../sec1/1-5-deployments.html"><span>Chapter&nbsp;5</span></a>: Code Promotion</td>
<td><a href="../sec1/1-5-deployments.html"><span>Chapter&nbsp;5</span></a>: Deployments</td>
<td>Put a static Quarto site up on GitHub Pages using GitHub Actions that renders the project.</td>
</tr>
<tr class="even">
Expand All @@ -382,27 +382,36 @@ <h1 class="title"><span id="sec-append-lab" class="quarto-section-identifier">Ap
</tr>
<tr class="odd">
<td><a href="../sec2/2-1-cloud.html"><span>Chapter&nbsp;7</span></a>: Cloud</td>
<td>Stand up an EC2 instance. Put model into S3.</td>
<td><p>Stand up an EC2 instance.</p>
<p>Put the model into S3.</p></td>
</tr>
<tr class="even">
<td><a href="../sec2/2-2-cmd-line.html"><span>Chapter&nbsp;8</span></a>: Command Line</td>
<td>Log into the server with <code>.pem</code> key and create SSH key.</td>
</tr>
<tr class="odd">
<td><a href="../sec2/2-3-linux.html"><span>Chapter&nbsp;9</span></a>: Linux Admin</td>
<td>Add R, Python, RStudio Server, JupyterHub, palmer penguin fastAPI + App.</td>
<td>Create a user on the server and add SSH key.</td>
</tr>
<tr class="even">
<td><a href="../sec2/2-4-app-admin.html"><span>Chapter&nbsp;10</span></a>: Application Admin</td>
<td>Add R, Python, RStudio Server, JupyterHub, API, and App to EC2 instance from <a href="../sec2/2-1-cloud.html">Chapter&nbsp;<span>7</span></a>.</td>
</tr>
<tr class="odd">
<td><a href="../sec2/2-6-networking.html"><span>Chapter&nbsp;12</span></a>: Networking</td>
<td>Add proxy (nginx) to reach all services from the web.</td>
<td><a href="../sec2/2-5-scale.html"><span>Chapter&nbsp;11</span></a>: Scaling</td>
<td>Resize the server.</td>
</tr>
<tr class="even">
<td><a href="../sec2/2-7-dns.html"><span>Chapter&nbsp;13</span></a>: DNS</td>
<td>Add a real URL to the EC2 instance. Put the Shiny app into an iFrame on the site.</td>
<td><a href="../sec2/2-6-networking.html"><span>Chapter&nbsp;12</span></a>: Networking</td>
<td>Add proxy (NGINX) to reach all services from the web.</td>
</tr>
<tr class="odd">
<td><a href="../sec2/2-8-ssl.html"><span>Chapter&nbsp;14</span></a>: SSL</td>
<td>Add SSL/HTTPS to the EC2 instance.</td>
<td><a href="../sec2/2-7-dns.html"><span>Chapter&nbsp;13</span></a>: DNS</td>
<td>Add a URL to the EC2 instance. Put the Shiny app into an iFrame on the Quarto site.</td>
</tr>
<tr class="even">
<td><a href="../sec2/2-5-scale.html"><span>Chapter&nbsp;11</span></a>: Servers</td>
<td>Resize servers.</td>
<td><a href="../sec2/2-8-ssl.html"><span>Chapter&nbsp;14</span></a>: SSL</td>
<td>Add SSL/HTTPS to the EC2 instance.</td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions chapters/sec1/1-1-env-as-code.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h2 id="toc-title">Table of contents</h2>
</ul></li>
<li><a href="#whats-happening-under-the-hood" id="toc-whats-happening-under-the-hood" class="nav-link" data-scroll-target="#whats-happening-under-the-hood"><span class="header-section-number">1.4</span> What’s happening under the hood</a></li>
<li><a href="#comprehension-questions" id="toc-comprehension-questions" class="nav-link" data-scroll-target="#comprehension-questions"><span class="header-section-number">1.5</span> Comprehension Questions</a></li>
<li><a href="#lab1" id="toc-lab1" class="nav-link" data-scroll-target="#lab1"><span class="header-section-number">1.6</span> Lab 1: Create and use a virtual environment</a>
<li><a href="#lab1" id="toc-lab1" class="nav-link" data-scroll-target="#lab1"><span class="header-section-number">1.6</span> Lab: Create and use a virtual environment</a>
<ul class="collapse">
<li><a href="#eda-in-r" id="toc-eda-in-r" class="nav-link" data-scroll-target="#eda-in-r"><span class="header-section-number">1.6.1</span> EDA in R</a></li>
<li><a href="#modeling-in-python" id="toc-modeling-in-python" class="nav-link" data-scroll-target="#modeling-in-python"><span class="header-section-number">1.6.2</span> Modeling in Python</a></li>
Expand Down Expand Up @@ -558,7 +558,7 @@ <h2 data-number="1.5" class="anchored" data-anchor-id="comprehension-questions">
</ol>
</section>
<section id="lab1" class="level2" data-number="1.6">
<h2 data-number="1.6" class="anchored" data-anchor-id="lab1"><span class="header-section-number">1.6</span> Lab 1: Create and use a virtual environment</h2>
<h2 data-number="1.6" class="anchored" data-anchor-id="lab1"><span class="header-section-number">1.6</span> Lab: Create and use a virtual environment</h2>
<p>In this lab, we will start working on our penguin explorer website. We will create a simple website using <a href="https://quarto.org">Quarto</a>, an open-source scientific and technical publishing system that makes it easy to render R and Python code into beautiful documents, websites, reports, and presentations.</p>
<p>We will create pages for a simple exploratory data analysis and model building from the <a href="https://allisonhorst.github.io/palmerpenguins/">Palmer Penguins</a> dataset. To get to practice with both R and Python, I’m going to do the EDA page in R and the modeling in Python. By the end of this lab, we’ll have both pages created using standalone Python and R virtual environments.</p>
<p>If you’re starting, check out the Quarto website to use Quarto in the editor of your choice.</p>
Expand Down
4 changes: 2 additions & 2 deletions chapters/sec1/1-2-proj-arch.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ <h2 id="toc-title">Table of contents</h2>
<li><a href="#create-an-api-if-you-need-it" id="toc-create-an-api-if-you-need-it" class="nav-link" data-scroll-target="#create-an-api-if-you-need-it"><span class="header-section-number">2.8</span> Create an API if you need it</a></li>
<li><a href="#write-a-data-flow-chart" id="toc-write-a-data-flow-chart" class="nav-link" data-scroll-target="#write-a-data-flow-chart"><span class="header-section-number">2.9</span> Write a data flow chart</a></li>
<li><a href="#comprehension-questions" id="toc-comprehension-questions" class="nav-link" data-scroll-target="#comprehension-questions"><span class="header-section-number">2.10</span> Comprehension Questions</a></li>
<li><a href="#lab2" id="toc-lab2" class="nav-link" data-scroll-target="#lab2"><span class="header-section-number">2.11</span> Lab 2: Build the processing layer</a>
<li><a href="#lab2" id="toc-lab2" class="nav-link" data-scroll-target="#lab2"><span class="header-section-number">2.11</span> Lab: Build the processing layer</a>
<ul class="collapse">
<li><a href="#step-1-write-the-model-outside-the-bundle" id="toc-step-1-write-the-model-outside-the-bundle" class="nav-link" data-scroll-target="#step-1-write-the-model-outside-the-bundle"><span class="header-section-number">2.11.1</span> Step 1: Write the model outside the bundle</a></li>
<li><a href="#step-2-create-an-api-for-model-predictions" id="toc-step-2-create-an-api-for-model-predictions" class="nav-link" data-scroll-target="#step-2-create-an-api-for-model-predictions"><span class="header-section-number">2.11.2</span> Step 2: Create an API for model predictions</a></li>
Expand Down Expand Up @@ -646,7 +646,7 @@ <h2 data-number="2.10" class="anchored" data-anchor-id="comprehension-questions"
</ol>
</section>
<section id="lab2" class="level2" data-number="2.11">
<h2 data-number="2.11" class="anchored" data-anchor-id="lab2"><span class="header-section-number">2.11</span> Lab 2: Build the processing layer</h2>
<h2 data-number="2.11" class="anchored" data-anchor-id="lab2"><span class="header-section-number">2.11</span> Lab: Build the processing layer</h2>
<p>In <a href="1-1-env-as-code.html">Chapter&nbsp;<span>1</span></a>, we did some EDA of the Palmer Penguins data set and built an ML model. In this lab, we will take that work we did and turn it into the actual presentation layer for our project.</p>
<section id="step-1-write-the-model-outside-the-bundle" class="level3" data-number="2.11.1">
<h3 data-number="2.11.1" class="anchored" data-anchor-id="step-1-write-the-model-outside-the-bundle"><span class="header-section-number">2.11.1</span> Step 1: Write the model outside the bundle</h3>
Expand Down
6 changes: 3 additions & 3 deletions chapters/sec1/1-3-data-access.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ <h2 id="toc-title">Table of contents</h2>
</ul></li>
<li><a href="#data-connection-packages" id="toc-data-connection-packages" class="nav-link" data-scroll-target="#data-connection-packages"><span class="header-section-number">3.5</span> Data Connection Packages</a></li>
<li><a href="#comprehension-questions" id="toc-comprehension-questions" class="nav-link" data-scroll-target="#comprehension-questions"><span class="header-section-number">3.6</span> Comprehension Questions</a></li>
<li><a href="#lab-3-use-a-database-and-an-api" id="toc-lab-3-use-a-database-and-an-api" class="nav-link" data-scroll-target="#lab-3-use-a-database-and-an-api"><span class="header-section-number">3.7</span> Lab 3: Use a database and an API</a>
<li><a href="#lab-use-a-database-and-an-api" id="toc-lab-use-a-database-and-an-api" class="nav-link" data-scroll-target="#lab-use-a-database-and-an-api"><span class="header-section-number">3.7</span> Lab: Use a database and an API</a>
<ul class="collapse">
<li><a href="#step-1-put-the-data-in-duckdb" id="toc-step-1-put-the-data-in-duckdb" class="nav-link" data-scroll-target="#step-1-put-the-data-in-duckdb"><span class="header-section-number">3.7.1</span> Step 1: Put the data in DuckDB</a></li>
<li><a href="#step-2-call-the-model-api-from-code" id="toc-step-2-call-the-model-api-from-code" class="nav-link" data-scroll-target="#step-2-call-the-model-api-from-code"><span class="header-section-number">3.7.2</span> Step 2: Call the model API from code</a></li>
Expand Down Expand Up @@ -659,8 +659,8 @@ <h2 data-number="3.6" class="anchored" data-anchor-id="comprehension-questions">
<li>How can environment variables be used to keep secrets secure in your code?</li>
</ol>
</section>
<section id="lab-3-use-a-database-and-an-api" class="level2" data-number="3.7">
<h2 data-number="3.7" class="anchored" data-anchor-id="lab-3-use-a-database-and-an-api"><span class="header-section-number">3.7</span> Lab 3: Use a database and an API</h2>
<section id="lab-use-a-database-and-an-api" class="level2" data-number="3.7">
<h2 data-number="3.7" class="anchored" data-anchor-id="lab-use-a-database-and-an-api"><span class="header-section-number">3.7</span> Lab: Use a database and an API</h2>
<p>In this lab, we will build the data and the presentation layers for our penguin mass model exploration. We’re going to create an app to explore the model, which will look like this: <img src="images/penguin_app.png" class="img-fluid"></p>
<p>Let’s start by moving the data into an actual data layer.</p>
<section id="step-1-put-the-data-in-duckdb" class="level3" data-number="3.7.1">
Expand Down
6 changes: 3 additions & 3 deletions chapters/sec1/1-4-monitor-log.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ <h2 id="toc-title">Table of contents</h2>
<li><a href="#working-with-metrics" id="toc-working-with-metrics" class="nav-link" data-scroll-target="#working-with-metrics"><span class="header-section-number">4.3.1</span> Working with Metrics</a></li>
</ul></li>
<li><a href="#comprehension-questions" id="toc-comprehension-questions" class="nav-link" data-scroll-target="#comprehension-questions"><span class="header-section-number">4.4</span> Comprehension Questions</a></li>
<li><a href="#lab-4-an-app-with-logging" id="toc-lab-4-an-app-with-logging" class="nav-link" data-scroll-target="#lab-4-an-app-with-logging"><span class="header-section-number">4.5</span> Lab 4: An App with Logging</a></li>
<li><a href="#lab-an-app-with-logging" id="toc-lab-an-app-with-logging" class="nav-link" data-scroll-target="#lab-an-app-with-logging"><span class="header-section-number">4.5</span> Lab: An App with Logging</a></li>
</ul>
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/akgold/do4ds/edit/main/chapters/sec1/1-4-monitor-log.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
</div>
Expand Down Expand Up @@ -531,8 +531,8 @@ <h2 data-number="4.4" class="anchored" data-anchor-id="comprehension-questions">
</ol></li>
</ol>
</section>
<section id="lab-4-an-app-with-logging" class="level2" data-number="4.5">
<h2 data-number="4.5" class="anchored" data-anchor-id="lab-4-an-app-with-logging"><span class="header-section-number">4.5</span> Lab 4: An App with Logging</h2>
<section id="lab-an-app-with-logging" class="level2" data-number="4.5">
<h2 data-number="4.5" class="anchored" data-anchor-id="lab-an-app-with-logging"><span class="header-section-number">4.5</span> Lab: An App with Logging</h2>
<p>Let’s return to the last lab’s prediction generator app and add a little logging. This is easy in both R and Python. We declare that we’re using the logger and then put logging statements into our code.</p>
<p>I decided to log when the app starts, just before and after each request, and an error logger if an HTTP error code comes back from the API.</p>
<p>With the logging now added, here’s what the app looks like in R:</p>
Expand Down
4 changes: 2 additions & 2 deletions chapters/sec1/1-5-deployments.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h2 id="toc-title">Table of contents</h2>
<li><a href="#configuring-per-environment-behavior" id="toc-configuring-per-environment-behavior" class="nav-link" data-scroll-target="#configuring-per-environment-behavior"><span class="header-section-number">5.3.1</span> Configuring per-environment behavior</a></li>
</ul></li>
<li><a href="#comprehension-questions" id="toc-comprehension-questions" class="nav-link" data-scroll-target="#comprehension-questions"><span class="header-section-number">5.4</span> Comprehension Questions</a></li>
<li><a href="#lab5" id="toc-lab5" class="nav-link" data-scroll-target="#lab5"><span class="header-section-number">5.5</span> Lab 5: Host a website with automatic updates</a></li>
<li><a href="#lab5" id="toc-lab5" class="nav-link" data-scroll-target="#lab5"><span class="header-section-number">5.5</span> Lab: Host a website with automatic updates</a></li>
</ul>
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/akgold/do4ds/edit/main/chapters/sec1/1-5-deployments.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
</div>
Expand Down Expand Up @@ -523,7 +523,7 @@ <h2 data-number="5.4" class="anchored" data-anchor-id="comprehension-questions">
</ol>
</section>
<section id="lab5" class="level2" data-number="5.5">
<h2 data-number="5.5" class="anchored" data-anchor-id="lab5"><span class="header-section-number">5.5</span> Lab 5: Host a website with automatic updates</h2>
<h2 data-number="5.5" class="anchored" data-anchor-id="lab5"><span class="header-section-number">5.5</span> Lab: Host a website with automatic updates</h2>
<p>In labs 1 through 4, you’ve created a Quarto website for the penguin model. You’ve got sections on EDA and model building. But it’s still just on your computer.</p>
<p>In this lab, we will deploy that website to a public site on GitHub and set up GitHub Actions as CI/CD so the EDA and modeling steps re-render every time we make changes.</p>
<p>Before we get into the meat of the lab, there are a few things you need to do on your own. If you don’t know how, there are plenty of great tutorials online.</p>
Expand Down
Loading

0 comments on commit 512d461

Please sign in to comment.