Skip to main content

Workflow Spark Recommendation

Spark Recommendation analyzes a completed Spark application and presents configuration and resource-sizing advice for its managed Workflow task. Its current and target contract is advisory only: it does not modify a Workflow, restart Spark, or apply settings to a running application.

Assessment scope​

FieldValue
ActorsWorkflow viewer, workflow editor, platform operator, data-platform reviewer, FinOps reviewer
Parent capabilityWorkflow
Assessed environmentRealm gj76anadpsc; workspace w-t5e2kcxjd
Source baselineOqullus 8c9f240410b2; BFF 9b2fd45a4da1; workflow-backend d3d6a3ad7313; spark-recommendation 9576355935d4; platform-stacks a71390d12463
Last verified3 September 2026
Review statusSource assessment drafted; live deployment and component review not yet captured

This assessment covers input selection, recommendation generation, Cogrion applicability, storage, retention, read APIs, authorization, cost, deployment, failure handling, and effectiveness measurement. It excludes automatic changes to Workflow definitions and automatic execution of recommendations.

Current capability boundary​

CapabilityCurrent state
Generate adviceA scheduled Spark job selects the latest completed application per DAG/task and calls the AI gateway once per selected task
Show adviceWorkflow list/detail surfaces show the latest task recommendation; the Workspace surface has no data wiring
Apply adviceNo supported apply path; the modal only copies generated Python
Validate adviceOutput format is parsed, but Spark keys, values, policy, and compatibility are not validated
Measure effectivenessNo baseline comparison, accepted/rejected state, subsequent-run comparison, or savings verification
Store adviceDelta table partitioned by recommendation date and queried through Trino
Retain adviceRETENTION_RUNS exists, but deletion is commented out and no VACUUM runs
DeploymentAPI and scheduled job are defined and enabled by default in current KCL; deployment/runtime evidence for the assessed realm remains to be captured

Environment and surface status​

PathSource/KCL conditionAssessment status
Alibaba Delta SparkKCL supplies Alibaba History URL, Keycloak JWT for Trino, OSS access, Alibaba image tag, daily job, and APIDefined; live state in gj76anadpsc/w-t5e2kcxjd not yet captured
AWS Delta SparkKCL supplies History URL, Basic-auth Trino, S3 access, daily job, and APIDefined; not live-tested in this assessment
Workflow list/detailRequests latest advice by DAG name through BFFImplemented; exact-run identity, validation, and role evidence remain open
WorkspaceButton exists, but recommendation data is initialized to nullIncomplete; must not be treated as a working surface
Automatic applyNo implementation and excluded from the approved scopeNot applicable; advisory only

What advice can mean in Cogrion​

RecommendationCogrion application pointCurrent presentation
Driver/executor cores and memorySaved Spark Workflow task, before submissionIncorrectly rendered as runtime spark.conf.set(...) Python
Driver/executor disk and memory overheadSaved Spark Workflow task, before submissionNot mapped back to the corresponding task fields
Fixed or dynamic executor countsSaved Spark Workflow task and generated SparkApplicationNot mapped or validated against min/max rules
Driver/executor node typeOne of the environment-approved task node typesGeneric C/M/R/I family text is not mapped to allowed Cogrion values
SQL runtime settings such as shuffle partitions or AQESaved task spark_conf, or a supported pre-query runtime setting when Spark permits itWorkflow-backend supports spark_conf; current Oqullus Spark-task payload does not expose it

Advice must identify whether a setting is a submission-time Workflow field, a Spark configuration override, or informational only. The UI must say that a change applies to a future run.

Storage and cost conclusion​

Delta Lake can store the records correctly, but the current shape is not cost-effective as an interactive product-state store:

  • a few rows per daily run create small date partitions and files;
  • latest-by-DAG reads do not filter the date partition;
  • the scheduled Spark job repeatedly scans history and launches Spark even when no new application exists;
  • the same unchanged application can be sent to the LLM again; and
  • two API replicas plus Trino serve simple latest-record lookups.

Object-storage bytes are unlikely to dominate cost. Spark startup, History Server calls, Trino scans, continuously running API replicas, and LLM tokens are the material boundaries.

Recommended target: keep current recommendation state and user disposition in an operational database keyed by an exact task execution and configuration fingerprint. Export immutable recommendation/effectiveness records to Delta only when lakehouse analytics or audit retention justifies it. The lower-change stabilization option is to keep Delta, remove high-cardinality date partitioning, skip unchanged applications, implement retention plus VACUUM, and bound all reads.

Findings​

IDFindingComponentsImpact
PROD-SR-001Map advisory output to future Workflow task configurationOqullus, workflow-backend, recommendationHigh
REL-SR-001Bind every recommendation to one exact execution and valid metricsRecommendation, monitoring, Spark History ServerHigh
PROD-SR-002Validate recommendations and measure their effectivenessRecommendation, workflow-backend, OqullusHigh
DATA-SR-001Implement logical and physical retentionRecommendation, Delta Lake, platform-stacksHigh
ARCH-SR-001Separate interactive recommendation state from analytical historyRecommendation, Delta Lake, Trino, BFF, platform-stacksMedium
SEC-SR-001Parameterize reads and authorize the managed WorkflowRecommendation API, BFF, workflow-backendHigh

Interim guidance​

  • Treat every recommendation as a hypothesis for the next Workflow run.
  • Do not paste the generated Python to change driver/executor resources.
  • Verify the suggested value against current task fields, approved node types, Spark image/version, and platform policy before changing a Workflow.
  • Do not claim savings or performance improvement until a comparable subsequent run confirms it.
  • Do not rely on RETENTION_RUNS=7 to delete data in the current implementation.