Skip to content
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
1 change: 0 additions & 1 deletion .github/workflows/crucible-merged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches: [ master ]
paths:
- .github/workflows/crucible-merged.yaml
- workshop.pl
- workshop.py
- schema.json
- registries-schema.json
Expand Down
58 changes: 1 addition & 57 deletions .github/workflows/workshop-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,62 +37,6 @@ jobs:
- name: Display changes
run: echo '${{ toJSON(steps.filter.outputs) }}' | jq .

workshop-pl:
needs: changes
if: ${{ github.event.pull_request.head.repo.fork != true && (github.event_name == 'workflow_dispatch' || needs.changes.outputs.only-docs != 'true') }}
runs-on: [ self-hosted, aws-cloud-1 ]

steps:
- uses: actions/checkout@v4

- name: Install git
run: |
sudo dnf install -y git

- name: Install container dependencies
run: |
sudo dnf install -y skopeo podman buildah

- name: Install Perl dependencies
run: |
sudo dnf install -y perl-JSON perl-JSON-XS perl-JSON-Validator perl-Data-UUID perl-Digest-SHA perl-Archive-Extract-xz-IO-Uncompress-UnXz.noarch

- name: Install Toolbox
run: |
if [ -d ~/toolbox ]; then
sudo rm -Rf ~/toolbox
fi
pushd ~/
git clone https://github.com/perftool-incubator/toolbox.git

- name: Run workshop - dump-config
run: |
export TOOLBOX_HOME=~/toolbox
echo
sudo --preserve-env=TOOLBOX_HOME ./workshop.pl --log-level verbose --label workshop-ci-dump-config --userenv ./userenvs/fedora-ci.json --dump-config true

- name: Run workshop - dump-config - force-build-policy missing
run: |
export TOOLBOX_HOME=~/toolbox
echo
sudo --preserve-env=TOOLBOX_HOME ./workshop.pl --log-level verbose --label workshop-ci-dump-config --userenv ./userenvs/fedora-ci.json --dump-config true --force-build-policy missing

- name: Run workshop - dump-files
run: |
export TOOLBOX_HOME=~/toolbox
echo
sudo --preserve-env=TOOLBOX_HOME ./workshop.pl --log-level verbose --label workshop-ci-dump-files --userenv ./userenvs/fedora-ci.json --dump-files true

- name: Run workshop
run: |
export TOOLBOX_HOME=~/toolbox
echo
sudo --preserve-env=TOOLBOX_HOME ./workshop.pl --log-level verbose --label workshop-ci --userenv ./userenvs/fedora-ci.json

- name: Cleanup toolbox
run: |
sudo rm -Rf ~/toolbox

workshop-py:
needs: changes
if: ${{ github.event.pull_request.head.repo.fork != true && (github.event_name == 'workflow_dispatch' || needs.changes.outputs.only-docs != 'true') }}
Expand Down Expand Up @@ -158,7 +102,7 @@ jobs:
- run: echo "faux-workshop-ci complete"

workshop-ci:
needs: [ workshop-pl, workshop-py, faux-workshop-ci ]
needs: [ workshop-py, faux-workshop-ci ]
if: always()
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 5 additions & 15 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@

Workshop builds container images using buildah. It combines a userenv (base image spec) with requirement definitions (software to install) to produce reproducible container images. Part of the [perftool-incubator](https://github.com/perftool-incubator) project.

## Implementations
## Implementation

There are two coexisting implementations:

- **`workshop.pl`** -- Original Perl implementation (~2200 lines)
- **`workshop.py`** -- Python 3 reimplementation (~1800 lines)

Both should be kept functionally equivalent. Changes to build logic should be applied to both implementations unless otherwise specified.
- **`workshop.py`** -- Python 3 implementation (~1800 lines)

## Key Files

Expand All @@ -23,10 +18,6 @@ Both should be kept functionally equivalent. Changes to build logic should be ap

## Dependencies

### Perl
- Requires modules: JSON, JSON::Validator, Getopt::Long, Digest::SHA, Data::UUID, etc.
- Uses `toolbox::json` and `toolbox::logging` from TOOLBOX_HOME/perl/

### Python
- Uses `invoke` (for `invoke.run()` shell commands) and `jsonschema` (via toolbox)
- Uses `toolbox.json` (load_json_file, validate_schema) from TOOLBOX_HOME/python/
Expand All @@ -38,17 +29,16 @@ Both should be kept functionally equivalent. Changes to build logic should be ap

## Code Style

- 4-space indentation, no tabs (both Perl and Python)
- Both files include modeline headers for editor configuration
- 4-space indentation, no tabs
- Modeline headers for editor configuration
- Python uses a custom `VERBOSE` logging level (15) between DEBUG (10) and INFO (20)
- SHA-256 checksums use canonical/sorted JSON encoding

## CI Workflows

- `workshop-ci.yaml` -- Tests both Perl and Python implementations on PR
- `workshop-ci.yaml` -- Tests workshop.py on PR
- `crucible-ci.yaml` -- Crucible integration CI on PR
- `crucible-merged.yaml` -- Post-merge crucible CI (pull_request_target: closed)
- Workflow trigger paths must include both `workshop.pl` and `workshop.py`

## Git Conventions

Expand Down
18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ Workshop is a tool for building container images based on specified userenv and
- [skopeo](https://github.com/containers/skopeo) -- remote registry inspection
- curl

### Perl Modules (for workshop.pl)

- JSON
- JSON::Validator
- Getopt::Long
- Digest::SHA
- Data::UUID
- Scalar::Util
- File::Basename

### Python Packages (for workshop.py)
### Python Packages

- invoke
- jsonschema (provided via toolbox)
Expand All @@ -36,14 +26,11 @@ Workshop requires the [toolbox](https://github.com/perftool-incubator/toolbox) p
export TOOLBOX_HOME=/path/to/toolbox
```

Workshop expects `$TOOLBOX_HOME/perl/` to exist and contain the `toolbox::json` and `toolbox::logging` modules (for `workshop.pl`), and `$TOOLBOX_HOME/python/` for the `toolbox.json` module (for `workshop.py`).
Workshop expects `$TOOLBOX_HOME/python/` to exist and contain the `toolbox.json` module.

## Usage

There are two functionally equivalent implementations: `workshop.pl` (Perl) and `workshop.py` (Python). Currently `workshop.pl` is the stable, production version. `workshop.py` is a reimplementation that is intended to eventually replace it. Both are tested in CI and accept the same arguments:

```
workshop.pl --userenv <file> [--requirements <file> ...] [options]
workshop.py --userenv <file> [--requirements <file> ...] [options]
```

Expand Down Expand Up @@ -134,7 +121,6 @@ The `--param key=value` flag performs string substitution across userenv, requir
This is useful for injecting paths or other values that vary between environments. For example:

```
workshop.pl --userenv my-userenv.json --requirements my-reqs.json --param BASEDIR=/opt/myapp
workshop.py --userenv my-userenv.json --requirements my-reqs.json --param BASEDIR=/opt/myapp
```

Expand Down
Loading
Loading