Skip to content

Commit 3b2078c

Browse files
committed
Add technical documentation
1 parent 25a0d35 commit 3b2078c

File tree

15 files changed

+641
-149
lines changed

15 files changed

+641
-149
lines changed

.github/.workflow/deploy.yml

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,30 @@
1-
name: Deploy MyST Book to GitHub Pages
1+
name: Deploy Jupyter Book
22

33
on:
4-
# Trigger on every push to main
54
push:
6-
branches: ["master"]
7-
# Allow manual triggers from the Actions tab
8-
workflow_dispatch:
5+
branches:
6+
- main
97

10-
# Sets permissions so the workflow can deploy to GitHub Pages
118
permissions:
12-
contents: read
9+
contents: write
1310
pages: write
1411
id-token: write
1512

16-
# Only allow one concurrent deployment; cancel in-flight runs
17-
concurrency:
18-
group: "pages"
19-
cancel-in-progress: false
20-
2113
jobs:
2214
build:
2315
runs-on: ubuntu-latest
24-
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v4
2716

28-
- name: Set up Python 3.11
29-
uses: actions/setup-python@v5
30-
with:
31-
python-version: "3.11"
32-
cache: "pip"
17+
steps:
18+
- uses: actions/checkout@v3
3319

3420
- name: Install dependencies
35-
run: pip install -r requirements.txt
21+
run: pip install jupyter-book
3622

37-
- name: Build Jupyter Book (MyST Markdown → HTML)
38-
run: jupyter-book build . --all
23+
- name: Build the book
24+
run: jupyter-book build .
3925

40-
- name: Upload artifact for Pages
41-
uses: actions/upload-pages-artifact@v3
42-
with:
43-
path: "./_build/html"
44-
45-
deploy:
46-
needs: build
47-
runs-on: ubuntu-latest
48-
environment:
49-
name: github-pages
50-
url: ${{ steps.deployment.outputs.page_url }}
51-
steps:
5226
- name: Deploy to GitHub Pages
53-
id: deployment
54-
uses: actions/deploy-pages@v4
27+
uses: peaceiris/actions-gh-pages@v3
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
publish_dir: ./_build/html

_build/.doctrees/README.doctree

-9.01 KB
Binary file not shown.
2.08 KB
Binary file not shown.

_build/.doctrees/index.doctree

353 Bytes
Binary file not shown.

_build/.doctrees/worker.doctree

16.4 KB
Binary file not shown.

_build/html/README.html

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<link rel="stylesheet" type="text/css" href="_static/styles/sphinx-book-theme.css?v=eba8b062" />
3333
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css?v=13237357" />
3434
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
35-
<link rel="stylesheet" type="text/css" href="_static/mystnb.8ecb98da25f57f5357bf6f572d296f466b2cfe2517ffebfabe82451661e28f02.css" />
35+
<link rel="stylesheet" type="text/css" href="_static/mystnb.8ecb98da25f57f5357bf6f572d296f466b2cfe2517ffebfabe82451661e28f02.css?v=6644e6bb" />
3636
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css?v=4fa983c6" />
3737
<link rel="stylesheet" type="text/css" href="_static/sphinx-design.min.css?v=95c83b7e" />
3838

@@ -165,7 +165,10 @@
165165
</script></div>
166166
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
167167
<div class="bd-toc-item navbar-nav active">
168-
168+
<ul class="nav bd-sidenav">
169+
<li class="toctree-l1"><a class="reference internal" href="worker.html">Worker</a></li>
170+
</ul>
171+
169172
</div>
170173
</nav></div>
171174
</div>
@@ -314,12 +317,9 @@ <h2> Contents </h2>
314317
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#file-structure">File Structure</a></li>
315318
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#one-time-setup-do-this-once-per-repo">One-Time Setup (do this once per repo)</a><ul class="nav section-nav flex-column">
316319
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clone-the-repo-and-copy-these-files-in">1. Clone the repo and copy these files in</a></li>
317-
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#enable-github-pages-with-github-actions-as-the-source">2. Enable GitHub Pages with GitHub Actions as the source</a></li>
318320
</ul>
319321
</li>
320322
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#local-preview">Local Preview</a></li>
321-
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#adding-more-pages">Adding More Pages</a></li>
322-
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#troubleshooting">Troubleshooting</a></li>
323323
</ul>
324324
</nav>
325325
</div>
@@ -334,7 +334,7 @@ <h2> Contents </h2>
334334
<section class="tex2jax_ignore mathjax_ignore" id="openlambda-github-pages-myst-markdown-site">
335335
<h1>OpenLambda GitHub Pages — MyST Markdown Site<a class="headerlink" href="#openlambda-github-pages-myst-markdown-site" title="Link to this heading">#</a></h1>
336336
<p>This repo deploys automatically to GitHub Pages using <a class="reference external" href="https://jupyterbook.org">Jupyter Book</a>
337-
with <a class="reference external" href="https://myst-parser.readthedocs.io/">MyST Markdown</a>.</p>
337+
with <a class="reference external" href="https://myst-parser.readthedocs.io/">MyST Markdown</a> as the technical documentation of Open Lambda.</p>
338338
<hr class="docutils" />
339339
<section id="file-structure">
340340
<h2>File Structure<a class="headerlink" href="#file-structure" title="Link to this heading">#</a></h2>
@@ -365,18 +365,7 @@ <h3>1. Clone the repo and copy these files in<a class="headerlink" href="#clone-
365365
</pre></div>
366366
</div>
367367
</section>
368-
<section id="enable-github-pages-with-github-actions-as-the-source">
369-
<h3>2. Enable GitHub Pages with GitHub Actions as the source<a class="headerlink" href="#enable-github-pages-with-github-actions-as-the-source" title="Link to this heading">#</a></h3>
370-
<p>Go to the repo on GitHub:</p>
371-
<ol class="arabic simple">
372-
<li><p><strong>Settings</strong><strong>Pages</strong> (left sidebar)</p></li>
373-
<li><p>Under <strong>Source</strong>, select <strong>GitHub Actions</strong> (not “Deploy from a branch”)</p></li>
374-
<li><p>Save</p></li>
375-
</ol>
376-
<p>That’s it. Every push to <code class="docutils literal notranslate"><span class="pre">main</span></code> will now rebuild and redeploy the site automatically.</p>
377368
</section>
378-
</section>
379-
<hr class="docutils" />
380369
<section id="local-preview">
381370
<h2>Local Preview<a class="headerlink" href="#local-preview" title="Link to this heading">#</a></h2>
382371
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>-r<span class="w"> </span>requirements.txt
@@ -386,49 +375,6 @@ <h2>Local Preview<a class="headerlink" href="#local-preview" title="Link to this
386375
</pre></div>
387376
</div>
388377
</section>
389-
<hr class="docutils" />
390-
<section id="adding-more-pages">
391-
<h2>Adding More Pages<a class="headerlink" href="#adding-more-pages" title="Link to this heading">#</a></h2>
392-
<ol class="arabic simple">
393-
<li><p>Create a new <code class="docutils literal notranslate"><span class="pre">.md</span></code> file, e.g. <code class="docutils literal notranslate"><span class="pre">worker.md</span></code></p></li>
394-
<li><p>Add it to <code class="docutils literal notranslate"><span class="pre">_toc.yml</span></code>:</p></li>
395-
</ol>
396-
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">format</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">jb-book</span>
397-
<span class="nt">root</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">index</span>
398-
<span class="nt">chapters</span><span class="p">:</span>
399-
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">file</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">worker</span>
400-
</pre></div>
401-
</div>
402-
<ol class="arabic simple" start="3">
403-
<li><p>Push — the site rebuilds automatically.</p></li>
404-
</ol>
405-
</section>
406-
<hr class="docutils" />
407-
<section id="troubleshooting">
408-
<h2>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Link to this heading">#</a></h2>
409-
<div class="pst-scrollable-table-container"><table class="table">
410-
<thead>
411-
<tr class="row-odd"><th class="head"><p>Problem</p></th>
412-
<th class="head"><p>Fix</p></th>
413-
</tr>
414-
</thead>
415-
<tbody>
416-
<tr class="row-even"><td><p>Build fails: <code class="docutils literal notranslate"><span class="pre">jupyter-book</span> <span class="pre">not</span> <span class="pre">found</span></code></p></td>
417-
<td><p>Make sure <code class="docutils literal notranslate"><span class="pre">requirements.txt</span></code> lists <code class="docutils literal notranslate"><span class="pre">jupyter-book&gt;=1.0.0</span></code></p></td>
418-
</tr>
419-
<tr class="row-odd"><td><p>Pages shows 404</p></td>
420-
<td><p>Confirm <strong>Settings → Pages → Source</strong> is set to <strong>GitHub Actions</strong></p></td>
421-
</tr>
422-
<tr class="row-even"><td><p>Old content still showing</p></td>
423-
<td><p>Hard-refresh browser (<code class="docutils literal notranslate"><span class="pre">Ctrl+Shift+R</span></code>) or wait ~1 min for CDN</p></td>
424-
</tr>
425-
<tr class="row-odd"><td><p>Action fails with permissions error</p></td>
426-
<td><p>Go to <strong>Settings → Actions → General → Workflow permissions</strong> and enable “Read and write permissions”</p></td>
427-
</tr>
428-
</tbody>
429-
</table>
430-
</div>
431-
</section>
432378
</section>
433379

434380
<script type="text/x-thebe-config">
@@ -480,12 +426,9 @@ <h2>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Link to
480426
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#file-structure">File Structure</a></li>
481427
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#one-time-setup-do-this-once-per-repo">One-Time Setup (do this once per repo)</a><ul class="nav section-nav flex-column">
482428
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clone-the-repo-and-copy-these-files-in">1. Clone the repo and copy these files in</a></li>
483-
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#enable-github-pages-with-github-actions-as-the-source">2. Enable GitHub Pages with GitHub Actions as the source</a></li>
484429
</ul>
485430
</li>
486431
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#local-preview">Local Preview</a></li>
487-
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#adding-more-pages">Adding More Pages</a></li>
488-
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#troubleshooting">Troubleshooting</a></li>
489432
</ul>
490433
</nav></div>
491434

_build/html/_sources/README.md

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OpenLambda GitHub Pages — MyST Markdown Site
22

33
This repo deploys automatically to GitHub Pages using [Jupyter Book](https://jupyterbook.org)
4-
with [MyST Markdown](https://myst-parser.readthedocs.io/).
4+
with [MyST Markdown](https://myst-parser.readthedocs.io/) as the technical documentation of Open Lambda.
55

66
---
77

@@ -35,18 +35,6 @@ git commit -m "Add MyST Markdown Jupyter Book site"
3535
git push
3636
```
3737

38-
### 2. Enable GitHub Pages with GitHub Actions as the source
39-
40-
Go to the repo on GitHub:
41-
42-
1. **Settings****Pages** (left sidebar)
43-
2. Under **Source**, select **GitHub Actions** (not "Deploy from a branch")
44-
3. Save
45-
46-
That's it. Every push to `main` will now rebuild and redeploy the site automatically.
47-
48-
---
49-
5038
## Local Preview
5139

5240
```bash
@@ -55,30 +43,3 @@ jupyter-book build .
5543
# Open in browser:
5644
open _build/html/index.html
5745
```
58-
59-
---
60-
61-
## Adding More Pages
62-
63-
1. Create a new `.md` file, e.g. `worker.md`
64-
2. Add it to `_toc.yml`:
65-
66-
```yaml
67-
format: jb-book
68-
root: index
69-
chapters:
70-
- file: worker
71-
```
72-
73-
3. Push — the site rebuilds automatically.
74-
75-
---
76-
77-
## Troubleshooting
78-
79-
| Problem | Fix |
80-
|---|---|
81-
| Build fails: `jupyter-book not found` | Make sure `requirements.txt` lists `jupyter-book>=1.0.0` |
82-
| Pages shows 404 | Confirm **Settings → Pages → Source** is set to **GitHub Actions** |
83-
| Old content still showing | Hard-refresh browser (`Ctrl+Shift+R`) or wait ~1 min for CDN |
84-
| Action fails with permissions error | Go to **Settings → Actions → General → Workflow permissions** and enable "Read and write permissions" |

_build/html/_sources/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ myst:
1212
:target: https://opensource.org/licenses/Apache-2.0
1313
```
1414

15-
OpenLambda is an **Apache-licensed serverless computing project**, written (mostly) in Go
15+
Open-Lambda is an **Apache-licensed serverless computing project**, written (mostly) in Go
1616
and based on Linux containers. The primary goal of OpenLambda is to enable exploration of
1717
new approaches to serverless computing. We hope to eventually make it suitable for use in
1818
production as well.

_build/html/_sources/worker.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Worker
2+
3+
The OpenLambda **worker** is the core server-side component of a node. It listens for
4+
incoming HTTP requests, manages container lifecycle, and returns responses to callers.
5+
6+
## Overview
7+
8+
Each worker is a standalone Go binary that exposes a single HTTP endpoint:
9+
10+
```
11+
POST /runLambda/<lambda-name>
12+
```
13+
14+
When a request arrives the worker:
15+
16+
1. Checks whether the lambda's container image is already present on the node; if not, pulls it from the registry.
17+
2. Starts a Linux container from the image.
18+
3. Passes the request payload to the lambda function running inside the container.
19+
4. Waits for the function to return a result, then forwards that result back to the caller.
20+
5. Optionally keeps the container warm for a short period to reduce cold-start latency on subsequent calls.
21+
22+
## Configuration
23+
24+
The worker is configured via a JSON file (default `config.json`) in the working directory.
25+
Key fields:
26+
27+
| Field | Description | Default |
28+
|---|---|---|
29+
| `worker_port` | Port the HTTP server listens on | `8080` |
30+
| `registry` | URL of the lambda registry | `""` |
31+
| `sandbox` | Container backend (`docker` or `sock`) | `docker` |
32+
| `log_output` | Where to write logs (`stdout` or a file path) | `stdout` |
33+
34+
## Starting the Worker
35+
36+
```bash
37+
# From the repo root after building:
38+
./bin/worker --config config.json
39+
```
40+
41+
The worker prints its listening address on startup. You can verify it is running with:
42+
43+
```bash
44+
curl -w "\n" localhost:8080/status
45+
```
46+
47+
## Deploying Multiple Workers
48+
49+
Workers are stateless with respect to routing — each one operates independently. To scale
50+
horizontally, start one worker process per node and place a standard HTTP load balancer
51+
(Nginx, HAProxy, or similar) in front of them. No coordination between workers is required.
52+
53+
```{note}
54+
A centralized **boss** component for cluster-wide management is currently under development.
55+
Until then, manual deployment behind a load balancer is the recommended approach for
56+
multi-node setups.
57+
```
58+
59+
## Further Reading
60+
61+
- [Quickstart guide](doc.htm) — get a single worker running locally in minutes
62+
- [SOCK: Rapid Task Provisioning with Serverless-Optimized Containers](https://www.usenix.org/conference/atc18/presentation/oakes) — the research paper describing the container backend.

_build/html/genindex.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<link rel="stylesheet" type="text/css" href="_static/styles/sphinx-book-theme.css?v=eba8b062" />
3232
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css?v=13237357" />
3333
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
34-
<link rel="stylesheet" type="text/css" href="_static/mystnb.8ecb98da25f57f5357bf6f572d296f466b2cfe2517ffebfabe82451661e28f02.css" />
34+
<link rel="stylesheet" type="text/css" href="_static/mystnb.8ecb98da25f57f5357bf6f572d296f466b2cfe2517ffebfabe82451661e28f02.css?v=6644e6bb" />
3535
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css?v=4fa983c6" />
3636
<link rel="stylesheet" type="text/css" href="_static/sphinx-design.min.css?v=95c83b7e" />
3737

@@ -164,7 +164,10 @@
164164
</script></div>
165165
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
166166
<div class="bd-toc-item navbar-nav active">
167-
167+
<ul class="nav bd-sidenav">
168+
<li class="toctree-l1"><a class="reference internal" href="worker.html">Worker</a></li>
169+
</ul>
170+
168171
</div>
169172
</nav></div>
170173
</div>

0 commit comments

Comments
 (0)