Skip to content

feat: one-command install, aap-bridge lifecycle, and configurable ports - #176

Open
antonysallas wants to merge 1 commit into
redhat-cop:mainfrom
antonysallas:feat/one-command-install
Open

antonysallas wants to merge 1 commit into
redhat-cop:mainfrom
antonysallas:feat/one-command-install

Conversation

@antonysallas

Copy link
Copy Markdown
Collaborator

Why this change

Until now, installing AAP Bridge meant cloning the repository and running make setup.

That workflow is useful for development, but it also:

  • creates a .venv inside the repository
  • installs development dependencies
  • installs pre-commit hooks
  • requires keeping the source checkout

None of that is needed for someone who only wants to run a migration.

This PR adds:

  • one command to install AAP Bridge
  • one aap-bridge command to use and manage it afterwards
  • one uninstall flow to remove it safely

Both command-line and container-based installations are supported.

How to test this PR

Because scripts/install.sh is not on main yet, the normal published URL will return 404.

Option 1 — test using curl

Run the installer from this branch and tell it to use the same branch as its source:

curl -LsSf https://raw.githubusercontent.com/antonysallas/aap-bridge/feat/one-command-install/scripts/install.sh \
  | AAP_BRIDGE_REPO=https://github.com/antonysallas/aap-bridge.git \
    AAP_BRIDGE_REF=feat/one-command-install sh

The two environment variables are important during PR testing. Without them, the installer would use main, which does not contain these changes yet.

Option 2 — test from a local checkout

From a checkout of this branch:

AAP_BRIDGE_SOURCE=$PWD sh scripts/install.sh

This uses the local source directly and skips cloning the repository.

Test a specific installation mode

To skip the interactive installation-mode question:

AAP_BRIDGE_WORKSPACE=/tmp/aap-test sh scripts/install.sh --cli

or:

AAP_BRIDGE_WORKSPACE=/tmp/aap-test sh scripts/install.sh --containers

Using /tmp/aap-test keeps test data separate from your normal $HOME/aap-migration workspace.

Uninstall

After testing:

aap-bridge uninstall

The uninstaller lets you either:

  • remove AAP Bridge while keeping the workspace and migration data
  • remove AAP Bridge and all of its data

Container installation note

The container installation builds three AAP Bridge images.

It also needs access to registry.redhat.io. If you are not already logged in, the installer detects this and offers to run the Podman login for you.

What changed

One installer

scripts/install.sh now asks how AAP Bridge should run:

  1. Command line
     Installs the aap-bridge command on this machine

  2. Containers
     Installs and runs the CLI, API engine, Web UI, and PostgreSQL
     with Podman

  q. Quit

You can skip this question with:

--cli
--containers

or with AAP_BRIDGE_MODE.

One command after installation

Both installation modes put aap-bridge on PATH.

Common commands are:

aap-bridge                # start the interactive migration CLI
aap-bridge doctor         # check the installation and connections
aap-bridge status         # show running services
aap-bridge stop           # stop services without deleting state
aap-bridge start          # start services again
aap-bridge logs           # follow service logs
aap-bridge uninstall      # uninstall AAP Bridge

For container installations, these commands use the workspace launcher internally.

The user chooses the deployment method once during installation and does not need to remember different commands afterwards.

One workspace

By default, AAP Bridge uses:

$HOME/aap-migration

aap-bridge init creates:

  • .env with permissions 0600
  • config/config.yaml
  • migration artifact directories

If setup is run again against an existing workspace, the installer detects it and offers to:

  1. use the existing configuration
  2. reconfigure without deleting migration data
  3. choose another workspace

Other fixes included in this PR

Migration paths now use the workspace

Migration artifacts such as:

exports/
xformed/
schemas/
reports/
logs/

now resolve from the workspace instead of the shell's current working directory.

Previously, schema generate, prep, and migrate also ignored the configured paths.* values and wrote to fixed relative directories.

Reports now use real migration data

aap-bridge report previously built its statistics from hardcoded zero values.

It now reads statistics from the migration state database and writes reports to the workspace reports/ directory by default.

Container workflow fixes

The container workflow previously could not complete successfully because:

  • the CLI container could not write to the bind-mounted workspace with rootless Podman
  • init inside the container incorrectly asked for an external PostgreSQL connection string

Both issues are fixed in this PR.

Configurable ports

The three published container ports can now be configured through the workspace .env:

Setting Default Service
AAP_BRIDGE_DB_PORT 15432 PostgreSQL
AAP_BRIDGE_API_PORT 8000 API engine
AAP_BRIDGE_UI_PORT 8080 Web UI

Before starting services, the installer checks whether these ports are available.

If a port is already in use, it offers the next available port instead of starting a service that cannot be reached.

This supersedes #172, which added support for configuring AAP_BRIDGE_API_PORT. Those commits are included here and extended to PostgreSQL and Web UI ports.

Testing completed

The following have been tested:

  • CLI installation end to end
  • container installation end to end
  • live AAP 2.3 → 2.6 migration setup
  • uninstall while keeping the workspace
  • remove-everything flow
  • uninstall with a deliberately failing step
  • running uninstall again when nothing remains
  • port conflicts on 8080 and 15432
  • curl | sh cancellation paths, including clean exit without curl errors
  • full unit test suite
  • Ruff
  • kacl-verify
  • changelog period check

Changelog

Entries were added under Unreleased in:

  • CHANGELOG.md
  • docs/reference/changelog.md

…ports

Installing meant cloning the repository and running `make setup` - a developer
workflow that builds a .venv inside the checkout, installs requirements-dev.txt,
and runs `pre-commit install`. Someone who only wants to run a migration needs
none of it and should not have to keep a source tree on disk.

This adds one command to set AAP Bridge up, one to operate it afterwards, and
one to remove it.

Install
-------

`scripts/install.sh` asks how you want to run AAP Bridge - the `aap-bridge`
command on this machine, or the CLI, API engine, Web UI, and PostgreSQL in
containers - then checks prerequisites, installs what is missing, and ends with
a configured workspace. `--cli` / `--containers`, or AAP_BRIDGE_MODE, skips the
question. Neither journey leaves a source checkout behind.

The container path resolves registry.redhat.io access before it builds anything
rather than warning and then failing five minutes later, verifies every image it
needs, rebuilds only what is out of date (images carry the source revision they
were built from), captures build output to <workspace>/logs/install.log, and
starts and verifies the stack. A failed build is resumable.

An existing workspace is a normal thing to find - a reinstall, an upgrade, a
second run after a failure. The installer inspects it before installing anything
and offers to use it as-is, reconfigure the settings without touching migration
data, or choose another directory.

Operate
-------

Both installations put the same `aap-bridge` command on PATH:

    aap-bridge                the CLI, interactively
    aap-bridge doctor         system, workspace, database, services, AAP
    aap-bridge status         what is running
    aap-bridge stop / start   pause and resume, keeping state
    aap-bridge logs
    aap-bridge uninstall

For a container installation these run a launcher in the workspace; how AAP
Bridge is deployed is chosen once, at install time, rather than remembered at
every invocation.

`aap-bridge init` writes a self-contained workspace: .env at mode 0600,
config/config.yaml, and the artifact directories. `aap-bridge doctor` checks the
system, workspace, database, services, and both AAP connections in one place;
`--fix` repairs safe local problems and never touches remote systems.

Uninstall
---------

`scripts/uninstall.sh`, also reachable as `aap-bridge uninstall`, removes the
containers, images, and command while keeping the migration workspace by
default. Removing the data as well is a separate choice that must be typed out
in full, because it destroys the only copy of the API tokens and the migration
state. Only images this installer built are removed - never the UBI, Node.js, or
PostgreSQL images they are built from, which other applications may use.

Ports
-----

AAP_BRIDGE_DB_PORT (15432), AAP_BRIDGE_API_PORT (8000), and AAP_BRIDGE_UI_PORT
(8080) are settings recorded in the workspace .env. The installer checks all
three before starting anything and offers a free port when one is taken; a
service whose port is in use starts and then never answers, which is not
something a user can diagnose from the outside.

Fixes carried by the same change
--------------------------------

- Migration artifacts - exports/, xformed/, schemas/, reports/, and the log -
  resolve against the workspace root rather than the working directory, so one
  migration's files stay together whichever directory a command is run from.
  `schema generate`, `prep`, and `migrate` also ignored paths.* entirely and
  wrote to fixed relative directories.
- `aap-bridge report` built its statistics from a block of hardcoded zeros. It
  now reads the state database - totals, a per-resource-type breakdown, and the
  errors behind any failures - and writes into the workspace's reports/ by
  default.
- The container workflow could not complete: the CLI container could not write
  to a bind-mounted workspace under rootless Podman, and `init` inside a
  container fell through to asking for an external PostgreSQL connection string
  while the stack it was configuring already contained one.
- Ctrl-C or EOF at any prompt printed a full traceback rather than "Cancelled".

Supersedes the AAP_BRIDGE_API_PORT change, whose commits are included here and
extended to cover the other two published ports.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antonysallas
antonysallas force-pushed the feat/one-command-install branch from bd3dc96 to 2215822 Compare August 22, 2026 14:44

This branch has not been deployed

No deployments
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