Skip to content

Commit f639c46

Browse files
authored
feat(hermes): fast dev build mode (#652)
* feat: add fast dev build mode skipping web assets Add build-run-dev command and supporting targets that skip heavy catalyst_voices web asset downloads, reducing dev build time from ~5-15min to ~2-5min. Production builds unchanged * feat: add fast dev build mode skipping web assets Add build-run-dev command and supporting targets that skip heavy catalyst_voices web asset downloads, reducing dev build time from ~5-15min to ~2-5min. Production builds unchanged * feat: add fast dev build mode skipping web assets Add build-run-dev command and supporting targets that skip heavy catalyst_voices web asset downloads, reducing dev build time from ~5-15min to ~2-5min. Production builds unchanged * feat: add fast dev build mode skipping web assets Add build-run-dev command and supporting targets that skip heavy catalyst_voices web asset downloads, reducing dev build time from ~5-15min to ~2-5min. Production builds unchanged * revert athena.happ to app.happ due to bug * ci * readme * refactor(athena): rename app package from app to athena - Update manifest_app.json name field from app to athena - Rename output package from app.happ to athena.happ throughout justfile - Refactor Earthfile to use common http-proxy-base target - Consolidate duplicate build steps between production and dev builds - Update all references and documentation comments This improves clarity by using a descriptive package name and reduces code duplication in the build system. * refactor justfile * add par builds * add par builds * ci
1 parent c6e9a10 commit f639c46

File tree

6 files changed

+376
-118
lines changed

6 files changed

+376
-118
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ sandboxed execution of modular applications.
3131

3232
3. **Build and run everything**:
3333

34+
For development (fast, recommended):
35+
36+
```bash
37+
just build-run-dev
38+
```
39+
40+
For production (full assets, slower):
41+
3442
```bash
3543
just build-run-all
3644
```
@@ -46,8 +54,16 @@ or `just --show <command>` to see detailed documentation for any specific comman
4654

4755
## Key Commands
4856

49-
* `just build-run-all` - Complete workflow (recommended for first-time users)
57+
### Build & Run
58+
59+
* `just build-run-dev` - **Development build** (~2-5 min, recommended for daily development)
60+
* `just build-run-all` - **Production build** (~5-15 min, includes all web assets)
61+
* `just dev-athena-fast` - Quick WASM rebuild for development iteration
62+
63+
### Utilities
64+
5065
* `just status` - Show current build status and configuration
66+
* `just clean-hfs` - Clean up previous application state
5167
* `just --help` - Just command help
5268

5369
For everything else - architecture, prerequisites, configuration,

hermes/apps/athena/manifest_app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
}
2727
],
2828
"www": "modules/http-proxy/lib/www"
29-
}
29+
}

hermes/apps/athena/modules/http-proxy/Earthfile

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@ build-http-proxy:
99

1010

1111

12+
# Common base for HTTP Proxy builds
13+
# ==================================
14+
# Sets up common files and directory structure used by both production and dev builds.
15+
# This eliminates duplication between local-build-http-proxy and local-build-http-proxy-dev.
16+
http-proxy-base:
17+
FROM alpine
18+
COPY +build-http-proxy/http_proxy.wasm .
19+
20+
# Copy module configuration and metadata files
21+
COPY lib/config.schema.json .
22+
COPY lib/manifest_module.json .
23+
COPY lib/metadata.json .
24+
COPY lib/settings.schema.json .
25+
26+
# Create the missing config.json file (empty JSON object)
27+
RUN echo '{}' > config.json
28+
29+
# Create staging directory structure
30+
RUN mkdir -p /staging/www
31+
32+
# Copy WASM module and JSON config files to root of staging
33+
RUN cp http_proxy.wasm /staging/
34+
RUN cp *.json /staging/ || true
35+
1236
# HTTP Proxy WASM Module Build
1337
# =============================
1438
# Compiles the HTTP proxy Rust code into a WebAssembly module using the wasm32-wasip2 target.
@@ -26,28 +50,11 @@ build-http-proxy:
2650
# Output: http_proxy.wasm - Executable WebAssembly module
2751
# Duration: ~3-5 minutes (Rust compilation to WASM)
2852
local-build-http-proxy:
29-
FROM alpine
30-
COPY +build-http-proxy/http_proxy.wasm .
31-
32-
# Copy module configuration and metadata files
33-
COPY lib/config.schema.json .
34-
COPY lib/manifest_module.json .
35-
COPY lib/metadata.json .
36-
COPY lib/settings.schema.json .
37-
38-
# Create the missing config.json file (empty JSON object)
39-
RUN echo '{}' > config.json
53+
FROM +http-proxy-base
4054

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

44-
# Create staging directory structure
45-
RUN mkdir -p /staging/www
46-
47-
# Copy WASM module and JSON config files to root of staging
48-
RUN cp http_proxy.wasm /staging/
49-
RUN cp *.json /staging/ || true
50-
5158
# Copy web assets to www subdirectory
5259
RUN cp -r assets /staging/www/ || true
5360
RUN cp -r canvaskit /staging/www/ || true
@@ -57,4 +64,31 @@ local-build-http-proxy:
5764
RUN find . -maxdepth 1 -type f -exec cp {} /staging/www/ \; 2>/dev/null || echo "⚠️ Some files may not have been copied"
5865

5966
# Export build artifacts from staging directory
60-
SAVE ARTIFACT /staging AS LOCAL lib
67+
SAVE ARTIFACT /staging AS LOCAL lib
68+
69+
# Development build - faster version without heavy web assets
70+
# ============================================================
71+
# This target skips the large web assets (assets, canvaskit, icons) that take
72+
# a long time to download and compress. Use this for development iterations
73+
# where you don't need all the web assets.
74+
#
75+
# What's included:
76+
# - WASM module (http_proxy.wasm)
77+
# - JSON configuration files
78+
# - Essential files only
79+
#
80+
# What's skipped:
81+
# - Large web assets (assets/, canvaskit/, icons/)
82+
# - Full catalyst_voices web build
83+
#
84+
local-build-http-proxy-dev:
85+
FROM +http-proxy-base
86+
87+
# For dev: Create minimal placeholder assets instead of copying large ones
88+
RUN mkdir -p /staging/www/assets /staging/www/canvaskit /staging/www/icons
89+
RUN echo '{"dev": "placeholder"}' > /staging/www/assets/placeholder.json
90+
RUN echo '{"dev": "placeholder"}' > /staging/www/canvaskit/placeholder.json
91+
RUN echo '{"dev": "placeholder"}' > /staging/www/icons/placeholder.json
92+
93+
# Export build artifacts from staging directory
94+
SAVE ARTIFACT /staging AS LOCAL lib
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "Catalyst Voices",
3-
"short_name": "Catalyst Voices",
4-
"start_url": ".",
5-
"display": "standalone",
6-
"background_color": "#0175C2",
7-
"theme_color": "#0175C2",
8-
"description": "Catalyst Voices",
9-
"orientation": "portrait-primary",
10-
"prefer_related_applications": false,
11-
"icons": [
12-
{
13-
"src": "icons/Icon-192.png",
14-
"sizes": "192x192",
15-
"type": "image/png"
16-
},
17-
{
18-
"src": "icons/Icon-512.png",
19-
"sizes": "512x512",
20-
"type": "image/png"
21-
}
22-
]
2+
"name": "Catalyst Voices",
3+
"short_name": "Catalyst Voices",
4+
"start_url": ".",
5+
"display": "standalone",
6+
"background_color": "#0175C2",
7+
"theme_color": "#0175C2",
8+
"description": "Catalyst Voices",
9+
"orientation": "portrait-primary",
10+
"prefer_related_applications": false,
11+
"icons": [
12+
{
13+
"src": "icons/Icon-192.png",
14+
"sizes": "192x192",
15+
"type": "image/png"
16+
},
17+
{
18+
"src": "icons/Icon-512.png",
19+
"sizes": "512x512",
20+
"type": "image/png"
21+
}
22+
]
2323
}

hermes/bin/src/hdf5/file.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! A Hermes HDF5 file abstraction over the HDF5 dataset object.
22
33
use super::Path;
4+
use crate::hdf5::compression::enable_compression;
45

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

0 commit comments

Comments
 (0)