Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
334 handle spark session creation when already exists (#335)
* Enhance demo notebook and SparkModel.js for improved Spark session management - Added a new code cell in the demo notebook to initialize a Spark session with detailed configuration settings, including application ID and Spark UI link. - Updated SparkModel.js to check for existing Spark application IDs before storing new session information, improving error handling and preventing duplicate entries. - Enhanced logging for better visibility into Spark session creation and management processes. * Update Dockerfile to install npm dependencies with legacy peer dependencies flag - Modified the npm install command to include the --legacy-peer-deps flag, ensuring compatibility with older peer dependencies during the build process of the React application. * Update Dockerfile to use Node 18 and enhance build process - Upgraded Node.js version from 14 to 18 for improved performance and compatibility. - Cleared npm cache before installing dependencies to ensure a clean environment. - Added installation of @jridgewell/gen-mapping to support additional functionality. - Increased memory allocation for the build process by setting NODE_OPTIONS to 4096 MB. * Update Dockerfile to use Node 14 and streamline build process - Downgraded Node.js version from 18 to 14 for compatibility. - Simplified npm installation by removing cache cleaning and legacy peer dependencies flag. - Removed increased memory allocation for the build process, optimizing the Dockerfile for a more straightforward build. * Update Dockerfile to use Node 18 and optimize build process - Upgraded Node.js version from 14 to 18 for improved performance. - Implemented a clean install of npm dependencies with legacy peer dependencies support. - Added specific package installations for @jridgewell/gen-mapping and @babel/generator. - Increased memory allocation for the build process by setting NODE_OPTIONS to 4096 MB. * Refactor Dockerfile for improved npm dependency management and build process - Updated npm installation commands to set legacy peer dependencies and install packages in a specific order. - Cleaned npm cache and rebuilt before running the build command to ensure a fresh environment. - Increased clarity and efficiency in the Dockerfile setup for the web application. * Enhance Spark session management and update demo notebook - Updated demo notebook to reflect successful Spark session execution, including updated execution metadata and application ID. - Refactored Spark session creation in backend to streamline the process, removing unnecessary parameters and improving error handling. - Modified SparkModel.js to ensure proper session initialization and validation of Spark application IDs. - Improved logging for better visibility during Spark session creation and management processes. * Refactor demo notebook and SparkModel.js for improved Spark session handling - Removed outdated code cells from the demo notebook to enhance clarity and usability. - Updated SparkModel.js to improve validation of Spark application IDs, ensuring they start with 'app-' and are correctly extracted from the HTML. - Simplified the logic for storing Spark session information in the Notebook component, enhancing overall session management. * Refactor Notebook.js and SparkModel.js for improved Spark app ID handling - Updated Notebook.js to extract and store Spark app ID more efficiently, ensuring it is only stored if valid. - Enhanced logging to provide clearer visibility of the extracted Spark app ID. - Added a console log in SparkModel.js to confirm successful extraction of the Spark app ID, improving debugging capabilities. * Refactor Notebook.js to streamline Spark app ID logging - Removed redundant console log for Spark app ID and retained a single log statement for clarity. - Enhanced error handling in the Notebook component to ensure better debugging during cell execution. * Implement Spark app status endpoint and enhance logging in SparkModel.js - Added a new endpoint to retrieve the status of a Spark application by its ID in spark_app.py, improving the API's functionality. - Enhanced logging in SparkModel.js to provide better visibility during the storage process of Spark application information, including status checks and error handling. - Improved validation for Spark application IDs to ensure only valid IDs are processed, contributing to more robust error management. * Refactor Spark app status retrieval and enhance error handling - Moved the Spark app status retrieval logic from the route handler in spark_app.py to a static method in SparkApp class for better separation of concerns. - Improved error handling and logging in the new get_spark_app_status method, ensuring clearer responses for application not found and internal errors. - Simplified the route handler to directly return the response from the SparkApp method, enhancing code readability and maintainability. * Enhance notebook path handling in getSparkApps method - Safely handle notebook paths by simplifying them when they match the pattern work/user@domain/notebook.ipynb. - Improved clarity by logging the simplified notebook path for better debugging and visibility. * Refactor Spark app route and simplify notebook path handling - Removed unused JWT and user identification decorators from the Spark app route in spark_app.py for cleaner code. - Simplified the notebook path handling in getSparkApps method of NotebookModel.js by removing unnecessary path simplification logic, allowing direct usage of the provided notebook path. - Enhanced code readability and maintainability by streamlining the logic in both files. * Add create_spark_app endpoint and enhance error handling in SparkApp service * Enhance create_spark_app endpoint with user authentication and error handling - Added JWT authentication and user identification decorators to the create_spark_app route in spark_app.py to ensure only authenticated users can create Spark applications. - Implemented user context validation in the SparkApp service, returning a 401 response if the user is not found. - Added a database rollback mechanism on error during Spark app creation to maintain data integrity. * Enhance Spark session management and update demo notebook - Updated demo notebook to include successful Spark session execution details, including execution metadata and application ID. - Removed the create_spark_session endpoint from spark_app.py to streamline session management. - Refactored SparkApp service by removing the create_spark_session method, as session creation is now handled directly in the notebook. - Improved SparkModel.js to ensure proper validation and storage of Spark application IDs, including enhanced logging for better visibility during the process.
- Loading branch information