Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Websockets with Lightbug server #57

Open
wants to merge 103 commits into
base: feature/websocket
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
7876360
create pr
saviorand Aug 25, 2024
e7463e2
extract to websocket module
saviorand Aug 25, 2024
4f51217
wip switch to nigthly
saviorand Aug 25, 2024
24f4c7c
wip migrate pointers
saviorand Aug 25, 2024
c21bef8
wip fixed the bind bug
saviorand Aug 26, 2024
09f1981
fixed unsafepointer
saviorand Aug 27, 2024
c78fa3f
temporary fix for string null terminator bug
saviorand Aug 31, 2024
466a7e3
add gojo as dependency
saviorand Sep 1, 2024
9187217
Merge branch 'chore/update-nightly-21-08-24' into feature/websocket-poc
saviorand Sep 1, 2024
eb81224
switch to span
thatstoasty Aug 31, 2024
6222584
unify protocol funcs
thatstoasty Aug 31, 2024
84350a9
moved mojoproject
thatstoasty Aug 31, 2024
d80f7c5
updated tests
thatstoasty Aug 31, 2024
90fd3ab
comment out test
thatstoasty Aug 31, 2024
b9846e4
wip reconciling bytes vs as_bytes changes
thatstoasty Aug 31, 2024
045573f
add gojo as dependency
saviorand Sep 1, 2024
3559ca0
unify protocol funcs
thatstoasty Aug 31, 2024
fc7b399
wip updating
thatstoasty Sep 2, 2024
e770848
update magic
thatstoasty Sep 2, 2024
17ccc2a
readd mojoproject
thatstoasty Sep 2, 2024
b3d3747
install nightly
thatstoasty Sep 2, 2024
23b7d3f
add recipe, not working yet until external is resolved
thatstoasty Sep 2, 2024
639cd66
integrate into lightbug
saviorand Sep 2, 2024
7f49d76
add max dep
thatstoasty Sep 2, 2024
72d269f
try build
thatstoasty Sep 2, 2024
32567c6
updated header parsing logic to handle spaces and carriage returns be…
thatstoasty Sep 3, 2024
9de3560
clean up usage of to_string by passing ownership instead of copying
thatstoasty Sep 3, 2024
89b1d6d
cleanup bytes
thatstoasty Sep 3, 2024
f5df35b
remove arg types from send
thatstoasty Sep 3, 2024
97552fb
fix bytes slice ref
thatstoasty Sep 3, 2024
251c856
add more aliases
thatstoasty Sep 3, 2024
5eddea7
rm unused function
thatstoasty Sep 3, 2024
8cb4ded
Merge pull request #58 from thatstoasty/24.5-updates
saviorand Sep 4, 2024
89a19c5
merge latest nightly
saviorand Sep 4, 2024
82ae68b
add interfaces
saviorand Sep 8, 2024
d009fea
add to serve
saviorand Sep 8, 2024
58f51d3
fix errors
saviorand Sep 8, 2024
1b9f2f0
handshake implementation
saviorand Sep 8, 2024
50b5dc3
clean up
saviorand Sep 8, 2024
2bd041b
websocket server draft
saviorand Sep 8, 2024
c398f62
cleanup src
thatstoasty Sep 8, 2024
3bb59bb
revert changed substring
thatstoasty Sep 8, 2024
2c54e9b
Merge pull request #59 from thatstoasty/chore/update-nightly-21-08-24
saviorand Sep 10, 2024
e4b3d0b
get tests to pass
saviorand Sep 10, 2024
e317223
update README
saviorand Sep 10, 2024
fb7df37
update the ci workflow
saviorand Sep 13, 2024
cb5a09a
remove redundant command
saviorand Sep 13, 2024
38eb99f
use magic run
saviorand Sep 13, 2024
f713e4e
fix deps
saviorand Sep 13, 2024
6433f4d
separate jobs
saviorand Sep 13, 2024
bf2a287
fix separate jobs
saviorand Sep 13, 2024
f5eae33
reuse path
saviorand Sep 13, 2024
5135846
simplify ci workflow
saviorand Sep 13, 2024
e31def3
use magic run
saviorand Sep 13, 2024
428c00a
source profile
saviorand Sep 13, 2024
3979c4f
hard code home
saviorand Sep 13, 2024
ec09421
reduce to two jobs
saviorand Sep 13, 2024
b338959
move install to jobs
saviorand Sep 13, 2024
da922be
checkout in jobs
saviorand Sep 13, 2024
a3502c3
use ubuntu
saviorand Sep 13, 2024
5a5cf4b
add strategy
saviorand Sep 13, 2024
04cee6f
add linux to platofrms
saviorand Sep 13, 2024
fcb5414
add magic install
saviorand Sep 13, 2024
69bf0a9
change gojo version
saviorand Sep 13, 2024
49d0d66
update max version
saviorand Sep 13, 2024
63e266c
max dev version
saviorand Sep 13, 2024
b9f5a4a
change max version range
saviorand Sep 13, 2024
935b33e
add nightly channel
saviorand Sep 13, 2024
c147d9e
no dev version
saviorand Sep 13, 2024
2cfe24f
add the publish step
saviorand Sep 14, 2024
c314cf9
main release and branch workflows
saviorand Sep 14, 2024
7834194
update recipe path
saviorand Sep 14, 2024
de9abfa
update recipe
saviorand Sep 14, 2024
2c7b570
remove mojoenv example
saviorand Sep 14, 2024
46b564b
fix client
saviorand Sep 14, 2024
dac7979
move the recipe
saviorand Sep 14, 2024
3efdc77
fix flag
saviorand Sep 14, 2024
ccf5006
fix path
saviorand Sep 14, 2024
2079a61
use small time
saviorand Sep 14, 2024
4af579a
add arm64 build
saviorand Sep 14, 2024
c2878ab
update the README
saviorand Sep 14, 2024
15dce14
update readme
saviorand Sep 14, 2024
cd2209b
update main workflow
saviorand Sep 14, 2024
8ecd3ec
prepare for release
saviorand Sep 14, 2024
d7869d1
bump to v4 artifact action
saviorand Sep 14, 2024
1dface7
Merge pull request #55 from saviorand/chore/update-nightly-21-08-24
saviorand Sep 14, 2024
313595b
0.1.3 release
saviorand Sep 14, 2024
cf22edc
Refactor request, response and header parsing and data structure to b…
bgreni Sep 16, 2024
7932d9c
uncomment client test
saviorand Sep 20, 2024
de0f946
mojo format all files
saviorand Sep 20, 2024
0e79892
Fix client test headers
bgreni Sep 20, 2024
0814562
update readme and client example
saviorand Sep 20, 2024
1483253
fix the client test
saviorand Sep 20, 2024
805372e
Merge pull request #61 from bgreni/header-refactor
saviorand Sep 20, 2024
ae1c2ba
0.1.4 release
saviorand Sep 21, 2024
8488c46
Merge branch 'main' into feature/websocket-poc
saviorand Sep 22, 2024
2850cd9
todos
saviorand Sep 22, 2024
7a84f17
wip fixing issues
saviorand Sep 22, 2024
812865c
wip select logic
saviorand Sep 24, 2024
936e59e
fix select logic
saviorand Sep 24, 2024
8a778ff
got to read
saviorand Sep 24, 2024
c73a990
write works
saviorand Sep 24, 2024
e7cb89a
make upgrade loop optional
saviorand Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Branch workflow

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

permissions:
contents: write

jobs:
test:
uses: ./.github/workflows/test.yml

package:
uses: ./.github/workflows/package.yml
47 changes: 12 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,22 @@
name: Main pipeline
name: Main workflow

on:
push:
branches:
- main
branches: [main]

permissions:
contents: write

jobs:
setup:
name: Setup environment and install dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install modular
run: |
curl -s https://get.modular.com | sh -
modular auth examples
- name: Install Mojo
run: modular install mojo
- name: Add to PATH
run: echo "/home/runner/.modular/pkg/packages.modular.com_mojo/bin" >> $GITHUB_PATH
test:
name: Run tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Run the test suite
run: mojo run_tests.mojo
uses: ./.github/workflows/test.yml

package:
name: Create package
runs-on: ubuntu-latest
needs: setup
steps:
- name: Run the package command
run: mojo package lightbug_http -o lightbug_http.mojopkg
- name: Upload package to release
uses: svenstaro/upload-release-action@v2
with:
file: lightbug_http.mojopkg
tag: latest-build
overwrite: true
uses: ./.github/workflows/package.yml

publish:
uses: ./.github/workflows/publish.yml
secrets:
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}


23 changes: 23 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Create package

on:
workflow_call:

jobs:
package:
name: Package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run the package command
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile
magic run mojo package lightbug_http -o lightbug_http.mojopkg

- name: Upload package as artifact
uses: actions/upload-artifact@v4
with:
name: lightbug_http-package
path: lightbug_http.mojopkg
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and publish

on:
workflow_call:
secrets:
PREFIX_API_KEY:
required: true

jobs:
publish:
name: Publish package
strategy:
matrix:
include:
- { target: linux-64, os: ubuntu-latest }
- { target: osx-arm64, os: macos-14 }
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 5
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Build package for target platform
env:
TARGET_PLATFORM: ${{ matrix.target }}
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
CONDA_BLD_PATH: ${{ runner.workspace }}/.rattler
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile

# Temporary method to fetch the rattler binary.
RATTLER_BINARY="rattler-build-aarch64-apple-darwin"
if [[ $TARGET_PLATFORM == "linux-64" ]]; then RATTLER_BINARY="rattler-build-x86_64-unknown-linux-musl"; fi
curl -SL --progress-bar https://github.com/prefix-dev/rattler-build/releases/latest/download/${RATTLER_BINARY} -o rattler-build
chmod +x rattler-build

# Build and push
magic run build --target-platform=$TARGET_PLATFORM
magic run publish
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release tag pipeline

on:
push:
tags:
- '*'
workflow_dispatch:

permissions:
contents: write

jobs:
test:
uses: ./.github/workflows/test.yml

package:
uses: ./.github/workflows/package.yml

publish:
uses: ./.github/workflows/publish.yml
secrets:
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}

upload-to-release:
name: Upload to release
needs: package
runs-on: ubuntu-latest
steps:
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- uses: actions/download-artifact@v4
with:
name: lightbug_http-package

- name: Upload package to release
uses: svenstaro/upload-release-action@v2
with:
file: lightbug_http.mojopkg
tag: ${{ steps.get_version.outputs.VERSION }}
overwrite: true
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run the testing suite

on:
workflow_call:

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run the test suite
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile
magic run mojo run_tests.mojo

13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
*.📦
*.mojopkg
.DS_Store
.mojoenv
install_id
install_id

# pixi environments
.pixi
*.egg-info

# magic environments
.magic

# Rattler
output
1 change: 0 additions & 1 deletion .mojoenv.example

This file was deleted.

15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: local
hooks:
- id: mojo-format
name: mojo-format
entry: magic run mojo format -l 120
language: system
files: '\.(mojo|🔥)$'
stages: [commit]
Loading