Skip to content

smitebot: Add smitebot build command#104

Open
Ashish-Kumar-Dash wants to merge 1 commit into
morehouse:masterfrom
Ashish-Kumar-Dash:smitebot-build-command
Open

smitebot: Add smitebot build command#104
Ashish-Kumar-Dash wants to merge 1 commit into
morehouse:masterfrom
Ashish-Kumar-Dash:smitebot-build-command

Conversation

@Ashish-Kumar-Dash
Copy link
Copy Markdown
Contributor

Adds smitebot build to build Smite workload Docker images without starting a fuzzing campaign.

The command selects the correct workload Dockerfile from --target, passes SCENARIO as the build arg, and tags images using the existing smite-<target>-<scenario> convention. It also supports coverage images, custom tags, and --no-cache for debugging rebuilds.

Validation:

  • cargo fmt --all --check
  • cargo clippy -p smitebot --all-targets --offline -- -D warnings
  • cargo test -p smitebot --offline
  • cargo run -p smitebot --offline -- build --help

@Ashish-Kumar-Dash Ashish-Kumar-Dash changed the title Add **smitebot build** command Add smitebot build command May 28, 2026
@Ashish-Kumar-Dash
Copy link
Copy Markdown
Contributor Author

ping @NishantBansal2003

@Ashish-Kumar-Dash Ashish-Kumar-Dash changed the title Add smitebot build command smitebot: Add smitebot build command May 28, 2026
Copy link
Copy Markdown
Contributor

@NishantBansal2003 NishantBansal2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Some commands I tested are:

  • smitebot build --target lnd --scenario ir

  • smitebot build --target ldk --scenario noise --coverage --smite-dir ./smite

  • Using cache: smitebot build --target ldk --scenario noise --coverage

  • Without cache: smitebot build --target ldk --scenario noise --coverage --no-cache

  • smitebot build --target cln --scenario encrypted_bytes --image cln-smitebot

Things I wanted to discuss are:

  • In doctor.rs we use println! because the output is intended to be final and, in the JSON case, machine-parsable. However, smitebot build is not in the same situation, so I think we should use logging instead of println! and eprintln!. Using logs would also give us timestamps, which can be useful later for debugging. WDYT?
  • For target, we already define the set of valid values, and those are also shown in smitebot help build. For scenario, however, we only accept a raw string. Would it make sense to define a fixed set of valid scenario values as well? The drawback is that every time a new scenario is added, smitebot would also need to be updated

Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
@Ashish-Kumar-Dash
Copy link
Copy Markdown
Contributor Author

  • In doctor.rs we use println! because the output is intended to be final and, in the JSON case, machine-parsable. However, smitebot build is not in the same situation, so I think we should use logging instead of println! and eprintln!. Using logs would also give us timestamps, which can be useful later for debugging. WDYT?

Yes, I agree on logging for smitebot build. Using logs for smitebot’s own status/error messages seems cleaner. Docker output can still stream directly, and timestamps would help when debugging longer builds.

  • For target, we already define the set of valid values, and those are also shown in smitebot help build. For scenario, however, we only accept a raw string. Would it make sense to define a fixed set of valid scenario values as well? The drawback is that every time a new scenario is added, smitebot would also need to be updated

tbh I’d prefer keeping it as a raw string for now. Targets are a fixed workload set, but scenarios are more likely to evolve in future, including IR/custom scenarios. Since the Dockerfiles already consume SCENARIO dynamically, hardcoding allowed scenarios in smitebot, like you pointed out as well, would add extra maintenance every time a scenario is added.

Comment thread smitebot/README.md
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/src/commands/build.rs Outdated
Comment thread smitebot/README.md Outdated
@Ashish-Kumar-Dash Ashish-Kumar-Dash force-pushed the smitebot-build-command branch from 1c8c096 to 1875639 Compare June 2, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants