Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated uv usage and documentation #308

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,19 @@ jobs:
- name: Pre Commit Checks
uses: pre-commit/[email protected]

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Setup Temp Directory
run: mkdir broker_dir

- name: Unit Tests
env:
BROKER_DIRECTORY: "${{ github.workspace }}/broker_dir"
UV_SYSTEM_PYTHON: 1
run: |
cp broker_settings.yaml.example ${BROKER_DIRECTORY}/broker_settings.yaml
pip install uv
uv pip install --system "broker[dev,docker] @ ."
uv pip install "broker[dev,docker] @ ."
ls -l "$BROKER_DIRECTORY"
broker --version
pytest -v tests/ --ignore tests/functional
6 changes: 5 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Setup and Build
env:
UV_SYSTEM_PYTHON: 1
run: |
pip install uv
uv pip install --system "broker[setup] @ ."
python -m build
python -m twine check dist/*
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,24 @@ Broker's docs can be found at the wiki for this repo: https://github.com/Satelli
# Quickstart
Install cmake with `dnf install cmake`

Install Broker either by cloning locally with `pip install .` or with `pip install broker` for the latest version from PyPI.
**Note:** We recommend using [uv](https://github.com/astral-sh/uv?tab=readme-ov-file#installation) to manage your Broker installation.

Copy the example settings file to `broker_settings.yaml` and edit it.
Install Broker either as a tool with uv `uv tool install broker`

(optional) If you are using the Container provider, install the extra dependency based on your container runtime of choice with either `pip install broker[podman]` or `pip install broker[docker]`.
or with pip `pip install broker`

(optional) If you are using the Beaker provider, install the extra dependency with `dnf install krb5-devel` and then `pip install broker[beaker]`.
**Note:** If you install with pip it is recommended that you do so in a virtual environment.

To run Broker outside of its base directory, specify the directory with the `BROKER_DIRECTORY` environment variable.
(optional) If you are using the Container provider, install the extra dependency based on your container runtime of choice with either `... install broker[podman]` or `... install broker[docker]`.

(optional) If you are using the Beaker provider, install the extra dependency with `dnf install krb5-devel` and then `... install broker[beaker]`.

Configure the `broker_settings.yaml` file to set configuration values for broker's interaction with its providers.
The first time you run Broker, like with `broker --version`, it will check if you already have a `broker_settings.yaml` in the location it expects.
If not, then it will help you get one setup and place it in the default broker directory `~/.broker/`

If you want Broker to operate out of a different location, export a `BROKER_DIRECTORY` environment variable with the desired path.

You can check `broker --version` at any time to verify where it is looking for its config file.

# Basic CLI Usage
**Checking out a VM or container**
Expand Down Expand Up @@ -123,3 +130,12 @@ broker checkout --background --nick rhel7
broker checkin -b --all
broker execute -b --workflow my-awesome-workflow --artifacts
```

# Development Setup
Install cmake with `dnf install cmake`

Clone the Broker repository and install locally with `uv pip install "broker[dev] @ ."`

Copy the example settings file to `broker_settings.yaml` and edit it.

To run Broker outside of its base directory, specify the directory with the `BROKER_DIRECTORY` environment variable.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name = "broker"
description = "The infrastructure middleman."
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE", name = "GNU General Public License v3"}
keywords = ["broker", "AnsibleTower", "docker", "podman", "beaker"]
authors = [
{name = "Jacob J Callahan", email = "[email protected]"}
Expand Down