Skip to content

✨ Native Rust voting load preparation, workers and reports (v10) - #3152

Open
edulix wants to merge 70 commits into
feat/meta-12767/v10/portalfrom
feat/meta-12767/release/10.0
Open

✨ Native Rust voting load preparation, workers and reports (v10)#3152
edulix wants to merge 70 commits into
feat/meta-12767/v10/portalfrom
feat/meta-12767/release/10.0

Conversation

@edulix

@edulix edulix commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Parent issue: https://github.com/sequentech/meta/issues/12767

Implement step-cli load orchestration, shared-hash census generation, native ballot encryption, worker scheduling and SQLite/SVG/HTML reporting in Rust. k6 and Chromium authenticate distinct voters and submit real votes; no browser recording is needed for k6 preparation. Containers compile a small Rust worker from the same ownership code as the CLI.

  • Support configurable local workers, Docker and indexed Kubernetes jobs with immutable inputs, atomic claims and no automatic cast retries.
  • Keep preparation and aggregation memory bounded by shard/cache limits; report exact global p50/p99, casts per second, goals and optional PostgreSQL receipt audits.
  • Provide synthetic-election administration commands, fixtures, engine adapters and optional developer diagnostics.

Validation: native unit and command-failure tests; 100-voter k6 and 100-voter Chromium local runs, with all 200 receipts matched against PostgreSQL; local and Docker worker smoke tests. The guide includes the measured results and report screenshot. Kubernetes manifests are tested; a live cluster run is not yet verified.

The CLI runtime is Rust. JavaScript implements the k6/Chromium engine adapters. Standalone telephone setup scripts and optional developer capture/SQL diagnostics remain Python; they are not invoked by step-cli load.

Stack

  1. 📚 Voting load guides and synchronized code examples (v10) #3159 — documentation and code tabs
  2. ✨ Private S3 ballot publications and scoped cast validation (v10) #3160 — publications and cast backend
  3. ✨ Load voting content from S3 with minimal voter status (v10) #3161 — voting portal and browser adapters
  4. ✨ Native Rust voting load preparation, workers and reports (v10) #3152 — native load tooling

Documentation

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 99ded550-8d60-425e-a1c4-72b4de0b7f9b

📥 Commits

Reviewing files that changed from the base of the PR and between f1f651d and 4816562.

⛔ Files ignored due to path filters (2)
  • packages/Cargo.lock is excluded by !**/*.lock
  • packages/voting-load/worker.Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (92)
  • .devcontainer/.env.development
  • .devcontainer/docker-compose-e2e.yml
  • .devcontainer/keycloak/import/tenant-90505c8a-23a9-4cdf-a26b-4e19f6a097d5.json
  • .devcontainer/minio/nginx/default.conf
  • .gitignore
  • devenv.nix
  • packages/step-cli/Cargo.toml
  • packages/step-cli/build.rs
  • packages/step-cli/scripts/cleanup_telephone_load_test.py
  • packages/step-cli/scripts/dtmf-template.example.txt
  • packages/step-cli/scripts/load_test_common.py
  • packages/step-cli/scripts/run_telephone_load_test.py
  • packages/step-cli/scripts/setup_telephone_load_test.py
  • packages/step-cli/scripts/telephone-load-test-inputs/election-event.json
  • packages/step-cli/scripts/telephone-load-test-inputs/election-event.json.license
  • packages/step-cli/scripts/telephone-load-test-inputs/layers.yaml.example
  • packages/step-cli/src/commands/configure.rs
  • packages/step-cli/src/commands/create_tenant.rs
  • packages/step-cli/src/commands/create_trustee.rs
  • packages/step-cli/src/commands/delete_election_event.rs
  • packages/step-cli/src/commands/delete_tenant.rs
  • packages/step-cli/src/commands/download_document.rs
  • packages/step-cli/src/commands/export_tenant_config.rs
  • packages/step-cli/src/commands/generate_voters.rs
  • packages/step-cli/src/commands/get_key_ceremony_status.rs
  • packages/step-cli/src/commands/get_trustees.rs
  • packages/step-cli/src/commands/import_election_event.rs
  • packages/step-cli/src/commands/import_tenant_config.rs
  • packages/step-cli/src/commands/import_voters.rs
  • packages/step-cli/src/commands/mod.rs
  • packages/step-cli/src/commands/refresh_token.rs
  • packages/step-cli/src/commands/start_key_ceremony.rs
  • packages/step-cli/src/commands/upload_document.rs
  • packages/step-cli/src/graphql/create_trustee.graphql
  • packages/step-cli/src/graphql/delete_election_event.graphql
  • packages/step-cli/src/graphql/delete_tenant.graphql
  • packages/step-cli/src/graphql/export_tenant_config.graphql
  • packages/step-cli/src/graphql/get_keys_ceremony.graphql
  • packages/step-cli/src/graphql/get_trustees.graphql
  • packages/step-cli/src/graphql/import_election_event.graphql
  • packages/step-cli/src/graphql/import_tenant_config.graphql
  • packages/step-cli/src/graphql/import_users.graphql
  • packages/step-cli/src/graphql/insert_tenant.graphql
  • packages/step-cli/src/graphql/schema.json
  • packages/step-cli/src/load/census.rs
  • packages/step-cli/src/load/config.rs
  • packages/step-cli/src/load/coordinator.rs
  • packages/step-cli/src/load/encryption.rs
  • packages/step-cli/src/load/executor.rs
  • packages/step-cli/src/load/files.rs
  • packages/step-cli/src/load/image.rs
  • packages/step-cli/src/load/input.rs
  • packages/step-cli/src/load/mod.rs
  • packages/step-cli/src/load/presentation.rs
  • packages/step-cli/src/load/provision.rs
  • packages/step-cli/src/load/reference.rs
  • packages/step-cli/src/load/report.rs
  • packages/step-cli/src/load/tests.rs
  • packages/step-cli/src/load/worker.rs
  • packages/step-cli/src/main.rs
  • packages/step-cli/src/tests/e2e.rs
  • packages/step-cli/src/utils/read_config.rs
  • packages/step-cli/src/utils/tally/download_document.rs
  • packages/step-cli/src/utils/trustees/get.rs
  • packages/step-cli/src/utils/trustees/get_ceremony_status.rs
  • packages/step-cli/src/utils/trustees/mod.rs
  • packages/step-cli/tests/command_failures.rs
  • packages/voting-load/Dockerfile
  • packages/voting-load/README.md
  • packages/voting-load/bootstrap.k6.js
  • packages/voting-load/capture.py
  • packages/voting-load/capture_report.py
  • packages/voting-load/fixtures/election.json
  • packages/voting-load/fixtures/election.json.license
  • packages/voting-load/measurements.py
  • packages/voting-load/proxy.py
  • packages/voting-load/replay.k6.js
  • packages/voting-load/replay_profile.py
  • packages/voting-load/report.html
  • packages/voting-load/report.html.license
  • packages/voting-load/resources.py
  • packages/voting-load/scale.k6.js
  • packages/voting-load/serve_portal.py
  • packages/voting-load/target.example.json
  • packages/voting-load/target.example.json.license
  • packages/voting-load/test_capture.py
  • packages/voting-load/test_replay_profile.py
  • packages/voting-load/test_traffic.py
  • packages/voting-load/traffic.py
  • packages/voting-load/worker.Cargo.lock.license
  • packages/voting-load/worker.Cargo.toml
  • packages/voting-load/worker.rs

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://docs.sequentech.io/docusaurus/pr-preview/pr-3152/

Built to branch doc-previews at 2026-09-08 08:42 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

⚙️ CodeRabbit configuration inspected

Length of output: 5503


@edulix The blocker is the enforced 100 changed-file limit. PR #3152 has 226 changed files. CodeRabbit skips the review before code analysis starts.

review --use-credits did not override this limit. In this PR, it produced the same 100-file-limit response. The resolved repository configuration has no setting that raises this limit. It also has no configuration error.

The usage-priced-review checkbox is account-side state. The configuration diagnostic does not expose its eligibility, billing state, or reset reason. Its reset is therefore not diagnosable from this repository. Please contact CodeRabbit Support with PR #3152 and the two command responses if the UI should allow a usage-priced review.

Disjoint path-filtered batches are not supported as a reliable way to review all files in one unchanged PR:

  • reviews.path_filters is a repository configuration setting, not a per-command batch selector.
  • The current value is empty: path_filters: [].
  • A path filter excludes files from a review scope. It does not create a sequence of review batches.
  • Incremental review does not re-review already reviewed commits. Changing filters between commands cannot guarantee complete, non-overlapping coverage of the same commit range.

Therefore, with the current limit, CodeRabbit cannot complete a source review of all 226 changed files in this single PR. The supported resolution is an account or platform limit change. Splitting the change would also reduce the file count, but that conflicts with your single-PR requirement.

🐇⚠️

You are interacting with an AI system.

@edulix edulix changed the title ✨ Scalable S3 voting flow and voting load tests (v10) ✨ Native Rust voting load preparation, workers and reports (v10) Sep 8, 2026
@edulix
edulix changed the base branch from release/10.0 to feat/meta-12767/v10/portal September 8, 2026 08:40
@edulix

edulix commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@edulix

edulix commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review --use-credits

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI lite review requested due to automatic review settings September 8, 2026 08:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are verified security/operational issues (network exposure in a “local” proxy and private directory permissions) plus a toolchain mismatch risk in the worker Dockerfile default Rust version.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a native (Rust-driven) voting load-testing workflow centered around a new step-cli load command suite, plus a standalone “worker” binary/container that reuses the CLI’s load modules for distributed execution and reporting. It also expands step-cli’s tenant/trustee/document utilities and updates dev tooling to support the new load-testing and diagnostic flows.

Changes:

  • Add Rust step-cli load orchestration (setup/prepare/run/report), including native ballot encryption, shard ownership, and HTML/SVG reporting assets.
  • Add a standalone Rust worker build + Docker images (k6 and Chromium variants) that execute finite voter shards with immutable inputs.
  • Add optional Python diagnostics (HAR/traffic/SQL log capture) and supporting devcontainer/runtime updates.
File summaries
File Description
packages/voting-load/worker.rs Standalone worker entrypoint wiring into shared load modules
packages/voting-load/worker.Cargo.toml Minimal Cargo manifest for standalone worker build
packages/voting-load/worker.Cargo.lock.license REUSE license metadata for worker lockfile
packages/voting-load/traffic.py Endpoint inventory + S3 flow validation helpers
packages/voting-load/test_traffic.py Unit tests for traffic inventory/S3 validation
packages/voting-load/test_replay_profile.py Unit tests for Chromium-to-k6 profile compilation
packages/voting-load/test_capture.py Integration-style tests for capture/reporting/PG log collection
packages/voting-load/target.example.json.license REUSE license metadata for example config
packages/voting-load/target.example.json Example capture/load target configuration
packages/voting-load/serve_portal.py Local SPA-capable static server for built portal
packages/voting-load/scale.k6.js k6 execution script for sharded, finite voter journeys
packages/voting-load/resources.py HAR resource extraction with secret/session scrubbing
packages/voting-load/report.html.license REUSE license metadata for report template
packages/voting-load/report.html HTML report template populated by Rust report generator
packages/voting-load/replay.k6.js Authenticated protocol replay engine (k6)
packages/voting-load/replay_profile.py Compile verified Chromium journey into session-independent recipe
packages/voting-load/README.md Overview of engines, worker build, and diagnostic tooling
packages/voting-load/proxy.py Local diagnostic proxy for action timing/status capture
packages/voting-load/measurements.py Percentiles + SQL/phase summary helpers
packages/voting-load/fixtures/election.json.license REUSE license metadata for fixture export
packages/voting-load/Dockerfile.dockerignore Narrow Docker build context for worker images
packages/voting-load/Dockerfile Multi-stage images for k6 and Chromium workers
packages/voting-load/capture.py One-shot private capture + SQL log collection workflow
packages/voting-load/bootstrap.k6.js One-shot publication bootstrap (no casting)
packages/step-cli/src/utils/trustees/mod.rs Export new trustees utility module
packages/step-cli/src/utils/trustees/get.rs Add trustee (name, public_key) retrieval utility
packages/step-cli/src/utils/trustees/get_ceremony_status.rs Fetch key ceremony execution status via GraphQL
packages/step-cli/src/utils/tally/download_document.rs Add election-event-independent document fetch + plain URL download
packages/step-cli/src/utils/read_config.rs Add config persistence + refresh-token-and-save helper
packages/step-cli/src/tests/e2e.rs Update key ceremony start call signature
packages/step-cli/src/main.rs Add top-level load command and new step subcommands
packages/step-cli/src/load/worker.rs Shared engine execution for CLI + standalone worker
packages/step-cli/src/load/reference.rs Generate Markdown reference from clap + rustdoc
packages/step-cli/src/load/provision.rs Provision/setup orchestration for synthetic load events
packages/step-cli/src/load/input.rs Shared typed input + “wire” JSON boundary for engines
packages/step-cli/src/load/image.rs Build/push worker images from a source-only tar context
packages/step-cli/src/load/files.rs Private, atomic, bounded file I/O helpers
packages/step-cli/src/load/executor.rs Local/Docker/Kubernetes indexed execution and report copying
packages/step-cli/src/load/encryption.rs Native ballot encryption into JSONL shards
packages/step-cli/src/load/coordinator.rs End-to-end lifecycle (check/prepare/screenshot/etc.)
packages/step-cli/src/load/census.rs Streaming voter census generation with shared PBKDF2 hash
packages/step-cli/src/graphql/schema.json GraphQL schema update (e.g., delete_tenant)
packages/step-cli/src/graphql/insert_tenant.graphql Mutation for tenant creation
packages/step-cli/src/graphql/import_users.graphql Mutation for voter import task
packages/step-cli/src/graphql/import_tenant_config.graphql Mutation for tenant-config import task
packages/step-cli/src/graphql/import_election_event.graphql Add task_execution fields to import mutation
packages/step-cli/src/graphql/get_trustees.graphql Include trustee public_key in query
packages/step-cli/src/graphql/get_keys_ceremony.graphql Query ceremony execution_status
packages/step-cli/src/graphql/export_tenant_config.graphql Mutation for tenant-config export task
packages/step-cli/src/graphql/delete_tenant.graphql Mutation for tenant deletion task
packages/step-cli/src/graphql/delete_election_event.graphql Mutation for election-event deletion task
packages/step-cli/src/graphql/create_trustee.graphql Mutation for registering a trustee public key
packages/step-cli/src/commands/upload_document.rs CLI command to upload a document
packages/step-cli/src/commands/start_key_ceremony.rs Add automatic ceremony flag plumbing
packages/step-cli/src/commands/refresh_token.rs Switch to shared refresh_and_save_token helper
packages/step-cli/src/commands/mod.rs Register new step-cli commands
packages/step-cli/src/commands/import_voters.rs CLI command to import voters via async task polling
packages/step-cli/src/commands/import_tenant_config.rs CLI command to import tenant config via async task polling
packages/step-cli/src/commands/import_election_event.rs Wait for async import task completion
packages/step-cli/src/commands/get_trustees.rs CLI command to list trustees (name/public_key)
packages/step-cli/src/commands/get_key_ceremony_status.rs CLI command to print ceremony status
packages/step-cli/src/commands/generate_voters.rs Fix authorized-election-ids to use election IDs; improve alias selection
packages/step-cli/src/commands/export_tenant_config.rs CLI command to export tenant config via async task polling
packages/step-cli/src/commands/download_document.rs CLI command to download a document by ID
packages/step-cli/src/commands/delete_tenant.rs CLI command to delete tenant with task polling + token refresh
packages/step-cli/src/commands/delete_election_event.rs CLI command to delete election event with task polling + token refresh
packages/step-cli/src/commands/create_trustee.rs CLI command to register trustee public key
packages/step-cli/src/commands/create_tenant.rs CLI command to create tenant via async task polling
packages/step-cli/scripts/telephone-load-test-inputs/layers.yaml.example Expanded example config for telephone load scripts
packages/step-cli/scripts/telephone-load-test-inputs/election-event.json.license REUSE license metadata for election-event fixture
packages/step-cli/scripts/load_test_common.py Shared helpers (config loading, HTTP helpers, step-cli runner)
packages/step-cli/scripts/dtmf-template.example.txt Example DTMF template with detailed capture notes
packages/step-cli/scripts/cleanup_telephone_load_test.py Safer, scoped cleanup script for events/tenants
packages/step-cli/Cargo.toml Add deps for load tooling (sqlite, yaml, zip, tls, etc.)
packages/step-cli/build.rs Bundle load assets into the CLI build output
packages/Cargo.lock Lockfile updates for new Rust dependencies
devenv.nix Add k6/chromium/fonts/docker tools and Python deps for diagnostics
.gitignore Ignore load-test outputs and private run artifacts
.devcontainer/minio/nginx/default.conf Preserve host:port for S3 presigned signature verification
.devcontainer/keycloak/import/tenant-90505c8a-23a9-4cdf-a26b-4e19f6a097d5.json Add tenant-delete role to seeded realm
.devcontainer/docker-compose-e2e.yml Overlay for local diagnostic statement/plan logging
.devcontainer/.env.development Add trustee/admin creds and API_KEY_CLIENT_SECRET defaults
Review details
  • Files reviewed: 88/93 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/voting-load/Dockerfile Outdated
# SPDX-FileCopyrightText: 2026 Sequent Tech Inc <legal@sequentech.io>
# SPDX-License-Identifier: AGPL-3.0-only

ARG RUST_IMAGE=rust:1.90-bookworm
Comment on lines +18 to +21
pub fn generate(input: &Input, output: &Path) -> Result<()> {
input.validate()?;
std::fs::DirBuilder::new().create(output)?;
let start = Instant::now();
Comment thread packages/voting-load/proxy.py Outdated
with lock, args.log.open("a") as stream:
stream.write(json.dumps(record) + "\n")

ThreadingHTTPServer(("0.0.0.0", args.port), Handler).serve_forever()
Copilot AI review requested due to automatic review settings September 8, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Several verified issues (toolchain mismatch in worker Docker build, an incorrect dockerignore allowlist, insecure config file permissions, and missing HTTP-status handling in voter import) should be addressed before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

packages/voting-load/Dockerfile:6

  • The worker build image pins Rust to 1.90, but the repository toolchain is Rust 1.96.0 (rust-toolchain.toml). This can cause the Docker worker build to fail due to MSRV mismatches; align the Dockerfile’s Rust image with the repo toolchain.
  • Files reviewed: 88/93 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment on lines +38 to +47
pub fn write_config(config_data: &ConfigData) -> Result<PathBuf, Box<dyn Error>> {
let config_dir = get_config_dir()?;
if !config_dir.exists() {
fs::create_dir_all(&config_dir)?;
}
let config_file = config_dir.join(CREATE_CONFIG_FILE_NAME);
let json_data = serde_json::to_string_pretty(config_data)?;
fs::write(&config_file, json_data)?;
Ok(config_file)
}
Comment on lines +10 to +14
!packages/voting-portal/playwright.scale.config.ts
!packages/voting-portal/test/
!packages/voting-portal/test/load/
!packages/voting-portal/test/load/flow.ts
!packages/voting-portal/test/load/runner.spec.ts
Comment on lines +79 to +87
let response = client
.post(&config.endpoint_url)
.bearer_auth(config.auth_token)
.json(&request_body)
.send()?;

let response_body: Response<import_users::ResponseData> =
response.json().map_err(|e| format!("{:?}", e))?;

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.

3 participants