GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nshkrdotcom/blitz: Small parallel command runner for Elixir and Mix workspaces that executes isolated shell commands with bounded concurrency, readable prefixed output, and structured aggregated failures for monorepo tooling and internal developer workflows.

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
guides
guides
 
 
lib
lib
 
 
test
test
 
 
.credo.exs
.credo.exs
 
 
.formatter.exs
.formatter.exs
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
mix.exs
mix.exs
 
 
mix.lock
mix.lock
 
 

Repository files navigation

Blitz

Blitz logo

Hex version HexDocs

Resource-aware local command execution for Elixir tooling and Mix workspaces. Blitz 0.5.0 has one scheduler for independent commands, per-project pipelines, and impact-aware CI. It is not a distributed job system, build cache, or release qualification engine.

Install

{:blitz, "~> 0.5.0", runtime: false}

Use runtime: false for tooling. Restrict environments only when every caller is confined to those environments. Tooling-only consumers with narrow Dialyzer PLTs may need :blitz in plt_add_apps.

Run commands

commands =
  for project <- ["apps/core", "apps/web"] do
    Blitz.command(id: project, command: "mix", args: ["test"], cd: project)
  end

Blitz.run!([%{commands: commands}])

Every run is a stage plan. One stage is an independent command batch; multiple stages pipeline by command id. An id must be unique within its stage. The next command of that id starts only after the earlier command succeeds. Independent ids can overlap, even across stages.

projects = ["apps/core", "apps/web"]

stages =
  for task <- ["compile", "test"] do
    %{commands: Enum.map(projects, fn project ->
      Blitz.command(id: project, command: "mix", args: [task], cd: project)
    end)}
  end

Blitz.run!(stages)

Blitz.run/2 returns {:ok, grouped_results} or {:error, %Blitz.Error{}, grouped_results}. Results follow input order within stages; only commands that ran or failed admission appear. A failed id blocks its later commands; unrelated ids continue by default. Set fail_fast?: true to stop admitting work after the first failure. Already running commands finish. run!/2 raises the aggregated error.

Commands take explicit argv, working directory, environment overrides, and an optional output_path. Logs stream with command labels, retain bounded tails, and report progress every ten seconds. For quiet automation use announce?: false, emit_output?: false.

Automatic resource scheduling

No worker counts are required. The scheduler detects CPU availability and memory headroom, accounts for all stages together, and fills compatible work as reservations are released. Default demands are derived from the executable. For atypical workloads, declare estimates, not host-specific concurrency:

Blitz.command(
  id: "qualification",
  command: "mix",
  args: ["test", "--only", "integration"],
  resources: [cpu: 3, memory_mib: 1536, priority: 10]
)

Linux detects inherited CPU affinity, visible cgroup v1/v2 CPU quotas, and live memory headroom (accounting for reclaimable inactive_file cache). Darwin uses scheduler capacity and available-page estimates. CPU and memory reservations are advisory admission budgets across all platforms: children inherit the caller's OS constraints and the kernel schedules runnable threads across available CPUs without pinning. An explicit budget such as budget: [cpu: 2, memory_mib: 2048] lowers admission capacity when necessary. See Resource scheduling for the precise contract and limitations, including timeouts and process groups.

Mix workspace

In the root project's mix.exs project configuration:

blitz_workspace: [
  root: __DIR__,
  projects: [".", "apps/*"],
  tasks: [
    deps_get: [args: ["deps.get"], preflight?: false],
    compile: [args: ["compile", "--warnings-as-errors"]],
    test: [args: ["test"], mix_env: "test"],
    dialyzer: [args: ["dialyzer"], resources: [cpu: 3, memory_mib: 2048]],
    docs: [args: ["docs", "--warnings-as-errors"]]
  ]
]

Run mix blitz.workspace test. Project specs can include sibling checkouts. Workspace planning isolates deps and build paths, sets MIX_ENV explicitly, and clears HEX_API_KEY by default (isolation.hex_home is opt-in). Task env accepts a function of the project/task context or an MFA for explicit additional environment values. Task names are atoms in configuration. The scheduler never chooses dependency sources.

mix blitz.workspace.impact test --dry-run explains which task states already have passing coverage. Blitz.MixWorkspace.Impact.run_many!/3 plans multiple families from one workspace snapshot and uses the same scheduler. See the Impact CI, Test state, and Downstream integration guides.

Breaking changes from 0.4.x

  • Blitz.run/2 and run!/2 now accept stages and return grouped results.
  • run_stages/2 and run_stages!/2 are removed.
  • Remove workspace parallelism, all max_concurrency settings, multipliers, overrides, and Blitz-specific -j flags. Use workload resources only when defaults are unsuitable. No compatibility adapters are provided.
  • Use fail_fast?: true when a caller requires stopping new independent work after the first failure. Workspace and impact entry points use this policy.

Development

mix format
mix compile --warnings-as-errors
mix test --warnings-as-errors
mix credo --strict
mix dialyzer
mix docs --warnings-as-errors

MIT licensed. See CHANGELOG.md.

About

Small parallel command runner for Elixir and Mix workspaces that executes isolated shell commands with bounded concurrency, readable prefixed output, and structured aggregated failures for monorepo tooling and internal developer workflows.

Topics

automationbuild-toolsclicommand-orchestrationcommand-runnerconcurrencydeveloper-toolsdevtoolselixirerlanginternal-toolingmixmonoreponshkr-devtoolsparallelprocess-orchestrationshelltask-runnertoolingworkflow

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.