samuhasavak5 opened a new pull request, #534:
URL: https://github.com/apache/livy/pull/534

   ## What changes were proposed in this pull request?
   
   This PR adds a new Livy server configuration property, 
livy.server.app-name-prefix, to allow cluster administrators to customize the 
default YARN application name for interactive Spark sessions.
   
   Problem: When a client creates an interactive session via POST /sessions 
without specifying a name, Livy sets spark.app.name to the hardcoded value 
livy-session-<id>. In HA or multi-cluster environments, this makes it difficult 
to distinguish Livy-managed applications in the YARN Resource Manager UI.
   
   Solution:
   
   Add LivyConf.SERVER_APP_NAME_PREFIX (livy.server.app-name-prefix, default: 
livy-session)
   Use the configured prefix when building the default spark.app.name in 
InteractiveSession.create()
   Document the new property in conf/livy.conf.template
   Add unit tests for default and custom prefix behavior
   Scope: Interactive sessions only. Batch sessions already support per-request 
naming via the REST API name field and are unchanged.
   
   Backward compatibility: When the property is unset, behavior remains 
livy-session-<id>.
   
   Example:
   
   # livy.conf
   livy.server.app-name-prefix = my-cluster
   Creating a session without a name yields YARN application name: my-cluster-3
   
   JIRA: [LIVY-1061](https://issues.apache.org/jira/browse/LIVY-1061)
   
   ## How was this patch tested?
   
   - Unit tests: Added tests in InteractiveSessionSpec for:
     -Default prefix (livy-session) when config is not set
     -Custom prefix (e.g. my-cluster) when livy.server.app-name-prefix is 
configured
   - Build: mvn package -Pspark3 -Pscala-2.12 — livy-server and dependent 
modules built successfully
   - Manual verification (recommended): Set livy.server.app-name-prefix in 
livy.conf, create an interactive session without name, and confirm the YARN RM 
UI shows <prefix>-<session-id>
   
   No UI changes in this PR.
   
   Please review https://livy.apache.org/community/ before opening a pull 
request.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor (Auto)
   
   Suggested PR title: [LIVY-1061] Add livy.server.app-name-prefix for 
interactive session YARN app names
   
   Please refer to the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to