This repository hosts Shuffle app implementations. Each app lives in a top-level folder named after the integration (e.g., aws-ec2/), and each release is versioned under a subfolder like 1.0.0/. A typical app version contains:
src/app.py: the Shuffle SDK entry point.api.yaml: OpenAPI definition used by Shuffle.requirements.txt: Python dependencies for the app.Dockerfile: container build instructions for the app.README.md: app-specific usage and action documentation.- Optional assets such as screenshots (
*.png).
In api.yaml, prefer an authentication block for shared credentials (URL, tokens, keys). Actions should only include auth parameters when they truly differ per call.
Apps are built and run container-first via the Shuffle SDK image. From an app version directory:
docker build -t shuffle-<app>:<version> .: build the app image.docker run --rm shuffle-<app>:<version>: run the app container locally.
For quick iteration on code, you can also run the Python entrypoint in a virtualenv:
pip install -r requirements.txtpython src/app.py --log-level DEBUG
Use 4-space indentation and standard Python style. Keep functions snake_case, classes CamelCase, and constants UPPER_SNAKE_CASE. Match existing patterns in src/app.py and keep action names aligned with api.yaml.
Use an existing app as a template (e.g., http/1.4.0/ or aws-ec2/1.0.0/) and follow the same folder layout. A minimal, working app version should include:
api.yaml: action definitions, parameters, and examples.src/app.py: class extending the Shuffle SDK (shuffle_sdk.AppBase).requirements.txt: third-party dependencies.Dockerfile: built onfrikky/shuffle:app_sdk.
When adding actions, ensure the api.yaml action name matches the method name in src/app.py and parameter names align exactly. Keep input parsing defensive (strings vs JSON), and return JSON-serializable results. For HTTP integrations, centralize auth and base URL handling and add a TLS verify option. If a service requires special payloads (e.g., ADF for Jira), accept JSON strings and pass through unchanged. Keep api.yaml examples realistic because they show up in the Shuffle UI.
Most apps declare credentials in api.yaml under authentication: so Shuffle injects them automatically. In code, read those values as normal action arguments (Shuffle passes them into each action). Prefer a single auth helper in src/app.py (e.g., _auth() for tokens, _build_api_base() for base URLs) and reuse it across actions. If an integration supports multiple auth modes (token vs password), accept both and choose the provided one.
Prefer small, focused actions (create, update, list, search) and document auth requirements and examples in the app README.md.
- SDK image choices: Shuffle provides Alpine (slim), Kali (security tooling), and Blackarch (kitchen‑sink). This repo’s Dockerfiles typically use
frikky/shuffle:app_sdk(Alpine‑based) unless a toolset requires otherwise. - Directory layout:
api.yaml,Dockerfile,requirements.txt,README.md, andsrc/app.pyare expected in each app version. Complex apps can add additional modules undersrc/and import them fromapp.py. - Actions & wiring: Every action in
api.yamlmust map to a method insrc/app.pywith the same name and argument list. Authentication parameters are passed into each action automatically when declared underauthentication:. - Utility helpers: In
AppBase, you can useself.get_file,self.set_files,self.update_file, and cache helpersself.get_cache,self.set_cache,self.delete_cachefor file and key/value workflows. - Prototyping: Build and test your Python logic locally first, then wire it into
src/app.py. Keep return values JSON‑serializable so Shuffle can consume them. - Upload & hotload: After a prototype works, upload it to Shuffle (cloud) or hotload locally (on‑prem) by rebuilding the app image. Local Docker rebuilds are faster for iteration.
- Cloud upload test: Use the Upload App API to add the app to your org, then run a workflow to validate actions.
- Local hotload (on‑prem): Place the app folder in
shuffle-apps/, setSHUFFLE_APP_HOTLOAD_FOLDER=./shuffle-apps, then use the hot reload button in the UI. Allow ~20 seconds for the reload to complete. - Update workflow deps: If you update an existing app version, remove and re‑add the app in any workflows that reference it.
- Fast local iteration: After the first upload, rebuild locally:
docker images | grep <appname>thendocker build . -t <imagename>. - CI/CD pattern: Create a test workflow, upload a test app version, run the workflow via API, and validate
workflowexecution.workflow.validation.validbefore promoting.
- OpenAPI apps: Upload to your instance, then use the
/appspage to publish so it appears onshuffler.io. - Python apps: Fork
https://github.com/frikky/shuffle-apps, add your app, and open a pull request to upstream.
There is no repository-wide test suite. If you add tests for a specific app, keep them alongside the app version (e.g., aws-ec2/1.0.0/tests/) and document how to run them in that app’s README.md.
Commit messages are short and descriptive, sometimes using a prefix like fix:. Follow that style and keep commits scoped to a single app/version when possible.
For pull requests, include:
- A clear description of the change and impacted app/version path.
- Updated
README.mdorapi.yamlwhen behavior changes. - Screenshots/assets if user-facing output or UI-related docs are affected.
Many apps require API keys or credentials. Do not commit secrets; use environment variables or Shuffle configuration fields instead, and document required inputs in the app’s README.md.