Skip to content

Commit

Permalink
Significant expansion/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mattprintz committed Dec 26, 2023
1 parent 658d2c6 commit 10e6366
Show file tree
Hide file tree
Showing 24 changed files with 779 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ create.sql
.eslintcache
**/.venv/
.openai.toml
**/.jekyll-cache
31 changes: 5 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ The subkernel files within the context directory are required to define some com

## Install / setup

### beaker_kernel Python module
### Docker



### python (local)

Normal installation:
```bash
Expand All @@ -99,20 +103,6 @@ $ poetry config virtualenvs.create false
$ poetry install --no-dev
```

### Jupyter kernel

To install the kernel, simply copy or symlink the `beaker` directory in to one of the directories defined in the following document:

https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs


For example:
```bash
$ cp -r beaker /usr/share/jupyter/kernels/beaker
```

Once the directory exists and the jupyter service is restarted the kernel should be available for selection.

For development, the kernel is automatically installed in the proper location in your development virtual environment when you run `make dev-install` as explained in the Dev setup section.


Expand Down Expand Up @@ -160,14 +150,3 @@ are:
1. allow_orgin rule
2. disable_check_xsrf security issue to allow the proxy
kernel to make API calls

The main engineering on the back end goes in to the writing of
the LLM/Proxy kernel.

This custom kernel manages a "sub-kernel" that can be for any
language, etc as long as it is a good kernel and installed. The
proxy passes messages from the client/jupyter server back and
forth with the sub-kernel, but sometimes intercepts the
messages or performs extra messages. This message interception
allows for the client to request LLM queries and to generate
code cells back to the client based on the LLM response.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_site
14 changes: 14 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ruby:3.2

ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

WORKDIR /usr/src/app

COPY Gemfile ./
RUN gem install bundler
RUN bundle install

EXPOSE 4000
CMD jekyll serve -d /_site --watch --force_polling -H 0.0.0.0 -P 4000
11 changes: 11 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source "https://rubygems.org"

gem "jekyll"

gem "just-the-docs"

gem "jekyll-github-metadata", ">= 2.15"

gem "jekyll-include-cache", group: :jekyll_plugins

gem "html-proofer", "~> 5.0", :group => :development
142 changes: 142 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2)
async (2.6.5)
console (~> 1.10)
fiber-annotation
io-event (~> 1.1)
timers (~> 4.1)
base64 (0.2.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
console (1.23.3)
fiber-annotation
fiber-local
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
faraday (2.7.12)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.16.3)
fiber-annotation (0.2.0)
fiber-local (1.0.0)
forwardable-extended (2.6.0)
google-protobuf (3.25.1-x86_64-linux)
hashery (2.1.2)
html-proofer (5.0.8)
addressable (~> 2.3)
async (~> 2.1)
nokogiri (~> 1.13)
pdf-reader (~> 2.11)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
zeitwerk (~> 2.5)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-event (1.3.3)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-github-metadata (2.16.0)
jekyll (>= 3.4, < 5.0)
octokit (>= 4, < 7, != 4.4.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
just-the-docs (0.7.0)
jekyll (>= 3.8.5)
jekyll-include-cache
jekyll-seo-tag (>= 2.0)
rake (>= 12.3.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
octokit (6.1.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
pdf-reader (2.11.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (4.2.0)
ruby-rc4 (0.1.5)
ruby2_keywords (0.0.5)
safe_yaml (1.0.5)
sass-embedded (1.69.5-x86_64-linux-gnu)
google-protobuf (~> 3.23)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
timers (4.3.5)
ttfunk (1.7.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
yell (2.2.2)
zeitwerk (2.6.12)

PLATFORMS
x86_64-linux

DEPENDENCIES
html-proofer (~> 5.0)
jekyll
jekyll-github-metadata (>= 2.15)
jekyll-include-cache
just-the-docs

BUNDLED WITH
2.4.22
23 changes: 23 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Updating the documentation

The documentation will be automatically rebuilt and deployed upon merge to main on Github.

For local development, you can use the provided docker-compose which monitors the files for
changes and automatically updates as you modify the local files.

You can access the documentation preview by starting the service (see below) and opening
[http://localhost:4000](http://localhost:4000) in your browser.


To start:
```bash
cd docs
docker compose up -d --build
```

To stop:
```bash
cd docs
docker compose down
```

9 changes: 9 additions & 0 deletions docs/_base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: default
title: Home
nav_order: 1
has_toc: true
---

# Page

15 changes: 15 additions & 0 deletions docs/_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: "Beaker Kernel"
search_enabled: true
remote_theme: pmarsceill/just-the-docs

gems:
- just-the-docs
- jekyll-github-metadata
- jekyll-mentions
- jekyll-redirect-from
- jekyll-sitemap
- jemoji

aux_links:
"Beaker on Github":
- "//github.com/DARPA-ASKEM/beaker-kernel"
15 changes: 15 additions & 0 deletions docs/_config_local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: "Beaker Kernel"
search_enabled: true
theme: "just-the-docs"

gems:
- just-the-docs
- jekyll-github-metadata
- jekyll-mentions
- jekyll-redirect-from
- jekyll-sitemap
- jemoji

aux_links:
"Beaker on Github":
- "//github.com/DARPA-ASKEM/beaker-kernel"
3 changes: 3 additions & 0 deletions docs/_sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pre.highlight {
white-space: pre-line;
}
Loading

0 comments on commit 10e6366

Please sign in to comment.