Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 22 additions & 2 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build-package:
runs-on: ubuntu-latest
container:
image: python:3.12
image: python:3.13
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -46,4 +46,24 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: web
path: web/src/dist/**
path: web/src/dist/**
deploy:
needs: build-package
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Download web
uses: actions/download-artifact@v4
with:
name: web
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::143841941773:role/github
- run: |
aws s3 sync . s3://horus-dev.sondehub.org/ --delete
aws s3 cp --content-type application/wasm ./assets/pyodide.asm.wasm s3://horus-dev.sondehub.org/assets/pyodide.asm.wasm
aws cloudfront create-invalidation --distribution-id E2BZ39U4B3U231 --paths '/*'
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build-package:
runs-on: ubuntu-latest
container:
image: python:3.12
image: python:3.13
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ web/webhorus-*
webhorus/setup.py
web/src/dev-dist
.vscode/
*.so
_*.c
_*.o

web/.yarn/*
.yarn/*
Expand Down
27 changes: 22 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
FROM python:3.12 AS base
FROM python:3.13 AS base
RUN apt-get update
RUN pip install pyodide-build
COPY ./ /webhorus

WORKDIR /webhorus
RUN git clone https://github.com/emscripten-core/emsdk.git
WORKDIR /webhorus/emsdk
RUN bash -c 'PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) && \
./emsdk install ${PYODIDE_EMSCRIPTEN_VERSION} && \
./emsdk activate ${PYODIDE_EMSCRIPTEN_VERSION}'
RUN bash -c 'source emsdk_env.sh && cd .. && \
pyodide build --outdir web/src/public/assets/'

RUN mkdir -p /webhorus/web/src/public/assets/

WORKDIR /asn1tools
ADD https://github.com/eerimoq/asn1tools.git#0.167.0 /asn1tools
RUN bash -c 'source /webhorus/emsdk/emsdk_env.sh && \
pyodide build --outdir /webhorus/web/src/public/assets/'

WORKDIR /bitstruct
ADD https://github.com/eerimoq/bitstruct.git#8.21.0 /bitstruct
RUN bash -c 'source /webhorus/emsdk/emsdk_env.sh && \
pyodide build --outdir /webhorus/web/src/public/assets/'

COPY ./ /webhorus
WORKDIR /webhorus
RUN bash -c 'source /webhorus/emsdk/emsdk_env.sh && \
pyodide build --outdir /webhorus/web/src/public/assets/ && ls /webhorus/web/src/public/assets/'

FROM scratch AS export
COPY --from=base /webhorus/web/src/public/assets/webhorus*.whl /
COPY --from=base /webhorus/web/src/public/assets/webhorus*.whl /
COPY --from=base /webhorus/web/src/public/assets/asn1tools*.whl /
COPY --from=base /webhorus/web/src/public/assets/bitstruct*.whl /
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
It's advised not to install this python package locally as it will break horusdemodlib and crcmod packages.
It's advised not to install this python package locally as it will break horusdemodlib packages.

Build process (docker)
```
Expand Down
11 changes: 0 additions & 11 deletions crcmod/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion horusdemodlib
Submodule horusdemodlib updated 130 files
107 changes: 106 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "webhorus"
version = "0.2.0"
version = "0.2.1"
description = ""
authors = ["xssfox <xss@sprocketfox.io>"]
readme = "README.md"
Expand All @@ -10,8 +10,8 @@ include = [
packages = [
{ include = "webhorus", from="."},
{ include = "pywenet", from="."},
{ include = "crcmod", from="."},
{ include = "horusdemodlib", from="horusdemodlib"},
{ include = "horusbinaryv3", from="horusdemodlib"},
{ include = "rx", from="wenet"},

]
Expand All @@ -22,11 +22,12 @@ script = "build_lib.py"
generate-setup-file = true

[tool.poetry.dependencies]
python = "^3.12"
python = "^3.13"
crc = "^7.1.0"
cffi = "^1.17.1"
python-dateutil = "^2.9.0.post0"
requests = "^2.32.3"
asn1tools = "^0.165.0"

[tool.poetry.group.dev.dependencies]
setuptools = "^75.8.2"
Expand Down
4 changes: 2 additions & 2 deletions pywenet/drs232_ldpc_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re

ffibuilder = FFI()

import os

def preprocess_h():
# data = open("./wenet/src/H2064_516_sparse.h","r").read().replace("#include <stdint.h>","")
Expand Down Expand Up @@ -269,7 +269,7 @@ def preprocess_h():
"./wenet/src/phi0.c",
],
include_dirs = [ "./wenet/src"],
extra_compile_args = ["-sSTACK_SIZE=5MB"]
extra_compile_args = ["-sSTACK_SIZE=5MB"] if os.environ.get("PYODIDE_EMSCRIPTEN_VERSION") else [] # hack to only set this on web builds
) # library name, for the linker

if __name__ == "__main__":
Expand Down
14 changes: 7 additions & 7 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"dependencies": {
"@jtarrio/webrtlsdr": "^0.1.0",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"bootstrap": "^5.3.8",
"leaflet": "^1.9.4",
"plotly.js-dist-min": "^3.0.1",
"pyodide": "^0.27.3",
"plotly.js-dist-min": "^3.3.1",
"pyodide": "^0.29.0",
"rollup-plugin-copy": "^3.5.0",
"vite": "^6.2.2",
"vite": "^7.3.0",
"vite-plugin-prebundle-workers": "^0.2.0",
"vite-plugin-pwa": "^0.21.1",
"vite-plugin-static-copy": "^2.3.0"
"vite-plugin-pwa": "^1.2.0",
"vite-plugin-static-copy": "^3.1.4"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"sass-embedded": "^1.85.1"
"sass-embedded": "^1.97.1"
},
"type": "module"
}
Loading