You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#one-time-setup-do-this-once-per-repo">One-Time Setup (do this once per repo)</a><ulclass="nav section-nav flex-column">
316
319
<liclass="toc-h3 nav-item toc-entry"><aclass="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
-
<liclass="toc-h3 nav-item toc-entry"><aclass="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>
<h3>2. Enable GitHub Pages with GitHub Actions as the source<aclass="headerlink" href="#enable-github-pages-with-github-actions-as-the-source" title="Link to this heading">#</a></h3>
<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 <codeclass="docutils literal notranslate"><spanclass="pre">main</span></code> will now rebuild and redeploy the site automatically.</p>
377
368
</section>
378
-
</section>
379
-
<hrclass="docutils" />
380
369
<sectionid="local-preview">
381
370
<h2>Local Preview<aclass="headerlink" href="#local-preview" title="Link to this heading">#</a></h2>
@@ -386,49 +375,6 @@ <h2>Local Preview<a class="headerlink" href="#local-preview" title="Link to this
386
375
</pre></div>
387
376
</div>
388
377
</section>
389
-
<hrclass="docutils" />
390
-
<sectionid="adding-more-pages">
391
-
<h2>Adding More Pages<aclass="headerlink" href="#adding-more-pages" title="Link to this heading">#</a></h2>
392
-
<olclass="arabic simple">
393
-
<li><p>Create a new <codeclass="docutils literal notranslate"><spanclass="pre">.md</span></code> file, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">worker.md</span></code></p></li>
394
-
<li><p>Add it to <codeclass="docutils literal notranslate"><spanclass="pre">_toc.yml</span></code>:</p></li>
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#one-time-setup-do-this-once-per-repo">One-Time Setup (do this once per repo)</a><ulclass="nav section-nav flex-column">
482
428
<liclass="toc-h3 nav-item toc-entry"><aclass="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
-
<liclass="toc-h3 nav-item toc-entry"><aclass="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>
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.
0 commit comments