Commit 3b2dca7
authored
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.1 parent 02e3486 commit 3b2dca7
File tree
6 files changed
+192
-131
lines changed- examples/[email protected]
- server/app
- routes
- services
- webapp
- src
- components/notebook
- models
6 files changed
+192
-131
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
13 | 46 | | |
14 | 47 | | |
15 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 11 | | |
20 | 12 | | |
21 | 13 | | |
| |||
27 | 19 | | |
28 | 20 | | |
29 | 21 | | |
30 | | - | |
31 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 146 | + | |
| 147 | + | |
161 | 148 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
178 | 160 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
8 | 24 | | |
9 | 25 | | |
10 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
262 | 266 | | |
263 | | - | |
264 | | - | |
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
| |||
288 | 290 | | |
289 | 291 | | |
290 | 292 | | |
291 | | - | |
| 293 | + | |
292 | 294 | | |
293 | 295 | | |
294 | 296 | | |
| |||
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
309 | | - | |
| 311 | + | |
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
313 | | - | |
314 | | - | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| |||
0 commit comments