The CI pipeline (`./check.sh`) was failing because of test errors, which was caused by the instrumentation framework complaining that no subscribers/listeners were registered. Instead of setting up all tests to run with a dummy subscriber, move the implementation of the instrumentation behind a feature flag so that it runs only for tests. There's a catch though: the `#[cfg(test)]` directive works only when directly testing the crate. If a crate `A` depends on another crate `B`, `B` will be compiled as usual (aka not in test mode) which will not trigger the `test` flag. So we need to introduce our own `testing` feature flag for `harmony` core and import it with that flag (only during dev/test). More info: https://github.com/rust-lang/rust/issues/59168 Co-authored-by: Ian Letourneau <letourneau.ian@gmail.com> Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/102 |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
harmony_composer
harmony_composer is a command-line utility for compiling and bootstrapping deployments for the Harmony orchestration framework.
It's designed to simplify the build process by either compiling a Harmony project found in a local harmony directory or by bootstrapping a new deployment through auto-detection of the current project type.
⚡ Quick Install & Run (Linux x86-64)
You can download and run the latest snapshot build with a single command. This will place the binary in ~/.local/bin, which should be in your PATH on most modern Linux distributions.
mkdir -p ~/.local/bin && \
curl -L https://git.nationtech.io/NationTech/harmony/releases/download/snapshot-latest/harmony_composer \
-o ~/.local/bin/harmony_composer && \
chmod +x ~/.local/bin/harmony_composer && \
alias hc=~/.local/bin/harmony_composer && \
echo "\n\nharmony_composer installed successfully\!\n\nUse \`hc\` to run it.\n\nNote : this hc alias only works for the current shell session. Add 'alias hc=~/.local/bin/harmony_composer' to your '~/.bashrc' or '~/.zshrc' file to make it permanently available to your user."
Then you can start using it with either :
harmony_composerif~/.local/binis in you$PATHhcalias set up in your current shell session.- If you want to make the
hccommand always available, addalias hc=~/.local/bin/harmony_composerto your shell profile. Usually~/.bashrcfor bash,~/.zshrcfor zsh.
- If you want to make the
⚠️ Warning: Unstable Builds The snapshot-latest tag points to the latest build from the master branch. It is unstable, unsupported, and intended only for early testing of new features. Please do not use it in production environments.
⚙️ How It Works
harmony_composer requires either cargo or docker to be available on your system to compile the Harmony project.
- If cargo is found: It will be used to compile the project locally.
- If cargo is not found: It will automatically download and run the harmony_composer Docker image. This image is a self-contained build environment with the required Cargo binary and build targets for both Linux and Windows.
- If both cargo and docker are unavailable,
harmony_composerwill fail. Please install one of them.
📖 Basic Usage
Here are some common commands:
# Compile the repo's Harmony module
harmony_composer compile
# Run check script on the project
harmony_composer check
# Run the repo's entire harmony deployment sequence
harmony_composer deploy
# Run the full check, compile, and deploy pipeline
harmony_composer all
For a full list of commands and their options, run:
harmony_composer --help
🏗️ Supported Architectures
The build system currently supports compiling for:
x86_64-unknown-linux-gnu
x86_64-pc-windows-gnu
More target architectures are planned. If your platform is not yet supported, please open a feature request in the main repository.
🔗 Main Project
This tool is a small part of the main Harmony project. For complete documentation, contribution guidelines, and license information, please refer to the main repository.