Skip to content
Merged
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ sandboxed execution of modular applications.

3. **Build and run everything**:

For development (fast, recommended):

```bash
just build-run-dev
```

For production (full assets, slower):

```bash
just build-run-all
```
Expand All @@ -46,8 +54,16 @@ or `just --show <command>` to see detailed documentation for any specific comman

## Key Commands

* `just build-run-all` - Complete workflow (recommended for first-time users)
### Build & Run

* `just build-run-dev` - **Development build** (~2-5 min, recommended for daily development)
* `just build-run-all` - **Production build** (~5-15 min, includes all web assets)
* `just dev-athena-fast` - Quick WASM rebuild for development iteration

### Utilities

* `just status` - Show current build status and configuration
* `just clean-hfs` - Clean up previous application state
* `just --help` - Just command help

For everything else - architecture, prerequisites, configuration,
Expand Down
2 changes: 1 addition & 1 deletion hermes/apps/athena/manifest_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
}
],
"www": "modules/http-proxy/lib/www"
}
}
72 changes: 53 additions & 19 deletions hermes/apps/athena/modules/http-proxy/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@ build-http-proxy:



# Common base for HTTP Proxy builds
# ==================================
# Sets up common files and directory structure used by both production and dev builds.
# This eliminates duplication between local-build-http-proxy and local-build-http-proxy-dev.
http-proxy-base:
FROM alpine
COPY +build-http-proxy/http_proxy.wasm .

# Copy module configuration and metadata files
COPY lib/config.schema.json .
COPY lib/manifest_module.json .
COPY lib/metadata.json .
COPY lib/settings.schema.json .

# Create the missing config.json file (empty JSON object)
RUN echo '{}' > config.json

# Create staging directory structure
RUN mkdir -p /staging/www

# Copy WASM module and JSON config files to root of staging
RUN cp http_proxy.wasm /staging/
RUN cp *.json /staging/ || true

# HTTP Proxy WASM Module Build
# =============================
# Compiles the HTTP proxy Rust code into a WebAssembly module using the wasm32-wasip2 target.
Expand All @@ -26,28 +50,11 @@ build-http-proxy:
# Output: http_proxy.wasm - Executable WebAssembly module
# Duration: ~3-5 minutes (Rust compilation to WASM)
local-build-http-proxy:
FROM alpine
COPY +build-http-proxy/http_proxy.wasm .

# Copy module configuration and metadata files
COPY lib/config.schema.json .
COPY lib/manifest_module.json .
COPY lib/metadata.json .
COPY lib/settings.schema.json .

# Create the missing config.json file (empty JSON object)
RUN echo '{}' > config.json
FROM +http-proxy-base

# Download web assets directly to root level
COPY github.com/input-output-hk/catalyst-voices/catalyst_voices+build-web/web .

# Create staging directory structure
RUN mkdir -p /staging/www

# Copy WASM module and JSON config files to root of staging
RUN cp http_proxy.wasm /staging/
RUN cp *.json /staging/ || true

# Copy web assets to www subdirectory
RUN cp -r assets /staging/www/ || true
RUN cp -r canvaskit /staging/www/ || true
Expand All @@ -57,4 +64,31 @@ local-build-http-proxy:
RUN find . -maxdepth 1 -type f -exec cp {} /staging/www/ \; 2>/dev/null || echo "⚠️ Some files may not have been copied"

# Export build artifacts from staging directory
SAVE ARTIFACT /staging AS LOCAL lib
SAVE ARTIFACT /staging AS LOCAL lib

# Development build - faster version without heavy web assets
# ============================================================
# This target skips the large web assets (assets, canvaskit, icons) that take
# a long time to download and compress. Use this for development iterations
# where you don't need all the web assets.
#
# What's included:
# - WASM module (http_proxy.wasm)
# - JSON configuration files
# - Essential files only
#
# What's skipped:
# - Large web assets (assets/, canvaskit/, icons/)
# - Full catalyst_voices web build
#
local-build-http-proxy-dev:
FROM +http-proxy-base

# For dev: Create minimal placeholder assets instead of copying large ones
RUN mkdir -p /staging/www/assets /staging/www/canvaskit /staging/www/icons
RUN echo '{"dev": "placeholder"}' > /staging/www/assets/placeholder.json
RUN echo '{"dev": "placeholder"}' > /staging/www/canvaskit/placeholder.json
RUN echo '{"dev": "placeholder"}' > /staging/www/icons/placeholder.json

# Export build artifacts from staging directory
SAVE ARTIFACT /staging AS LOCAL lib
42 changes: 21 additions & 21 deletions hermes/apps/athena/modules/http-proxy/lib/manifest.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "Catalyst Voices",
"short_name": "Catalyst Voices",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "Catalyst Voices",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
"name": "Catalyst Voices",
"short_name": "Catalyst Voices",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "Catalyst Voices",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
12 changes: 5 additions & 7 deletions hermes/bin/src/hdf5/file.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! A Hermes HDF5 file abstraction over the HDF5 dataset object.

use super::Path;
use crate::hdf5::compression::enable_compression;

/// Hermes HDF5 file object, wrapper of `hdf5::Dataset`
pub(crate) struct File {
Expand Down Expand Up @@ -45,13 +46,10 @@ impl File {
) -> anyhow::Result<Self> {
let builder = group.new_dataset_builder();
let shape = hdf5::SimpleExtents::resizable([0]);
// COMPRESSION DISABLED: For faster development builds
// To re-enable compression, uncomment the lines below and comment out the builder line:
// let hdf5_ds = enable_compression(builder)
// .empty::<u8>()
// .shape(shape)
// .create(file_name)?;
let hdf5_ds = builder.empty::<u8>().shape(shape).create(file_name)?;
let hdf5_ds = enable_compression(builder)
.empty::<u8>()
.shape(shape)
.create(file_name)?;
Ok(Self { hdf5_ds, pos: 0 })
}

Expand Down
Loading
Loading