Repository navigation
Conversation
em3s
marked this pull request as draft
May 7, 2026 14:43
1 task done
em3s
force-pushed
the
feat/pipeline-workflow-dsl
branch
15 times, most recently
from
May 9, 2026 13:50
c8161b8 to
7bbfd35
Compare
ADR #310 v1: workflow YAML is now a real GitHub Actions workflow that runs on github.com (or `act` / Gitea / Forgejo) via a composite action, and adapts to the internal model for `EmbeddedRunner` execution. User-facing YAML shape (valid GHA workflow): name: spark-pi on: workflow_dispatch: schedule: [{ cron: '0 0 * * *' }] env: { SAMPLES: 1000000 } jobs: pi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: kakao/actionbase/actions/[email protected] with: class: SparkPiJob config: { samples: ${{ env.SAMPLES }} } submit: preset: small driver-memory: 1g conf: { spark.sql.shuffle.partitions: 8 } `WorkflowLoader` parses GHA shape (`GhaWorkflow` / `GhaJob` / `GhaStep`) and adapts to the internal `Workflow` / `JobSpec` model: per-job, finds the step whose `uses:` contains `actionbase/actions/pipeline-runner`, extracts `with.class` / `with.config` / `with.submit`. The composite action (TBD: `kakao/actionbase/actions/[email protected]` in this monorepo) does the same parsing and invokes spark-submit. Same artifact-and-class encoding as before — class is the trailing input, no separate `class:` field at JobSpec level — but now mapped *through* the GHA action's input. `schedule:` extracted from `on.schedule[].cron`. `needs:` / `if:` / workflow `env:` are GHA-native and read directly. Multi-step jobs (`actions/checkout@v4` + runner) are tolerated; only the runner step is consumed. Internal layers unchanged: - DSL — `dsl/{Step, Plan, Job}`: type-state Plan composed via `~>`, `Transform.apply` takes `Seq[(String, DataFrame)]` (multi-input default), `Open + Open` for joins, `.as("label")` for naming edges. - AST — `Src`, `Tx`, `Snk`, `Fork` (fanOut), `Group` (multi-sink). Executor memoizes per-Ast materialization. - Steps — `steps/{source/{FileSource, SampleSource}, transform/{SqlTransform, CacheTransform}, sink/{FileSink, ShowSink}}`. - Runner — `runner/{EmbeddedRunner, Expression, ClassResolver, UsesRef, StepsBuilder, SubmitPreset, EnvCascade}`. EnvCascade mirrors `ConfigLoader` / `ConfigPrinter` for `env:` resolution (yaml < args, canonical `lower_snake_case`). Step arity: Source 0 in, 1 out Transform N in, 1 out Sink 1 in, 0 out Worked examples: - workflows/spark-pi.yaml — SparkPiJob (hand-written Job class). - workflows/spark-pi-steps.yaml — StepsRunnerJob (chain assembled at runtime from a YAML steps list). Build: `:pipeline:runWorkflow` JavaExec task with `workingDir = rootDir`. Extra `KEY=VALUE` args after the path override workflow `env:` entries: ./gradlew :pipeline:runWorkflow \ --args="pipeline/workflows/spark-pi.yaml SAMPLES=100000" Spark stays `compileOnly` for the module. Refs #310 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
force-pushed
the
feat/pipeline-workflow-dsl
branch
from
May 9, 2026 14:02
7bbfd35 to
f3a1f2f
Compare
Contributor
Author
|
Closing. This PR was opened from the initial draft of ADR #310. That ADR has since been split into two: #310 — job-to-job workflow DSL (composition, dependencies, expressions, $extends) A new PR scoped to the job-to-job workflow will follow. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ADR #310 v1: declarative workflow YAML over arbitrary DAGs (multi-input join, split, multi-sink) and an in-process
EmbeddedRunner. Spec keys mirror GitHub Actions where it makes sense; the rest is actionbase vocabulary.Refs #310
YAML
StepsRunnerJoblets a workflow inline a Source → Transform* → Sink chain. Label withas:, refer withinputs:; labels become SQL view names:Step model
Arbitrary DAGs: linear chain, fan-in (join), split (shared upstream + multiple transforms), diamond, multi-sink (shared upstream or independent sub-trees). The Executor memoizes per-AST materialization across all sinks, so a shared upstream is built once.
CacheTransformpins it in-memory when Spark's lineage would otherwise re-execute. Multi-input on the Scala side:(a.as("u") + b.as("e")) ~> SqlTransform(...)— works on Source and Transform outputs alike.Notable bits
uses:— GHA short form (actionbase/[email protected]) is sugar over Maven coords (com.kakao.actionbase:pipeline:0.x). Owner aliasactionbase→com.kakao.actionbase.with:— flat forkind=spark.class:is reserved (=spark-submit --class); every other key is bound onto the Job's Cfg.submit:presets — files in<workflowDir>/preset/<name>.yamlauto-load; per-job override deep-merges.env:overrides —./gradlew :pipeline:runWorkflow --args="<yaml> SAMPLES=100". Resolution mirrorsConfigLoader/ConfigPrinter(yaml < args, per-key trace). Canonical key islower_snake_case:SOME_SAMPLES≡someSamples≡some_samples≡--some-samples. Word boundaries preserved sosample_sstays distinct fromsamples.How to Test
AI Assistance