Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a job schedule using vertex scheduler - DO NOT MERGE, FOR REVIEW ONLY. #207

Open
wants to merge 164 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
fce4ec7
created the new folder for vertex scheduler.
Shreyasls Nov 8, 2024
d6958ed
changed the syntax of createVertexSchedule component.
Shreyasls Nov 8, 2024
63b038e
UI config api changes
risha-vijayvargiya-22 Nov 12, 2024
cebcf92
Created UI design initial design and added logic for machine type and…
vysakhviswama Nov 13, 2024
ac02e5c
added region and network api
risha-vijayvargiya-22 Nov 19, 2024
77ef14f
UI completed for creating vertex schedule.
vysakhviswama Nov 20, 2024
f6ce7fe
minor changes
risha-vijayvargiya-22 Nov 20, 2024
1f180c9
Schedule listing UI
vysakhviswama Nov 20, 2024
7c23a15
resolved the schedule section issue.
Shreyasls Nov 20, 2024
402c056
added csb and shared network api
risha-vijayvargiya-22 Nov 21, 2024
f016cbe
added create payload model
risha-vijayvargiya-22 Nov 21, 2024
cb06b8c
resolved comments
risha-vijayvargiya-22 Nov 21, 2024
3d2178e
created payload and called create schedule api
risha-vijayvargiya-22 Nov 25, 2024
1c1802b
Added the max runs field in vertex form.
shreyas-ls Nov 25, 2024
9189eaa
added missing fields in payload
risha-vijayvargiya-22 Nov 26, 2024
bc050d9
added service account api
risha-vijayvargiya-22 Nov 26, 2024
556cefd
resolved errors
risha-vijayvargiya-22 Nov 26, 2024
fc9b3e8
file structure changes
risha-vijayvargiya-22 Nov 26, 2024
fdb4b7f
api integration is done
shreyas-ls Nov 26, 2024
b2f37dc
used client library for compute apis
risha-vijayvargiya-22 Nov 26, 2024
e0f73c5
minor changes
risha-vijayvargiya-22 Nov 26, 2024
f7a119c
added list, resume, pause, delete schedule api code
risha-vijayvargiya-22 Nov 28, 2024
35c1282
added trigger api
risha-vijayvargiya-22 Nov 28, 2024
317d852
resolved errors
risha-vijayvargiya-22 Nov 28, 2024
a000b26
added update schedule api
risha-vijayvargiya-22 Dec 2, 2024
9d6b080
added start time and end time in payload
risha-vijayvargiya-22 Dec 2, 2024
e0f41cd
modified type of parameters in payload
risha-vijayvargiya-22 Dec 2, 2024
1226e9c
added query parameter in the update api
risha-vijayvargiya-22 Dec 3, 2024
95eba4d
changed max concurrent run value in payload
risha-vijayvargiya-22 Dec 3, 2024
e319223
changed max concurrent run value in update payload
risha-vijayvargiya-22 Dec 3, 2024
809ceda
added api for log entries
risha-vijayvargiya-22 Dec 4, 2024
6d37b45
Implemented Vertex Schedule listing with new region select, api and p…
vysakhviswama Dec 4, 2024
04a83d6
added the calendar icon and error warning for the end date
shreyas-ls Dec 4, 2024
a486ecf
updated schedule in listing api to human readable form
risha-vijayvargiya-22 Dec 5, 2024
6fbc733
added dependency
risha-vijayvargiya-22 Dec 5, 2024
0fea47b
added dependency
risha-vijayvargiya-22 Dec 5, 2024
21725c3
passed the name to the listing data
risha-vijayvargiya-22 Dec 5, 2024
413a6f3
resolved the errors
risha-vijayvargiya-22 Dec 5, 2024
1736dbc
fixed the bugs
shreyas-ls Dec 5, 2024
793ef89
modified code
risha-vijayvargiya-22 Dec 5, 2024
4b65de7
changed the design of the run on schedule
shreyas-ls Dec 5, 2024
f1f2622
removed the commented lines.
shreyas-ls Dec 5, 2024
f9aadac
tested the error cases of start and end date
shreyas-ls Dec 5, 2024
c31bf43
fixed the bug
shreyas-ls Dec 6, 2024
411982c
added list notebook execution jobs api
risha-vijayvargiya-22 Dec 6, 2024
ab28559
resolved errors
risha-vijayvargiya-22 Dec 6, 2024
4794a3e
used proto to convert response in dictionary
risha-vijayvargiya-22 Dec 6, 2024
d6bf534
added api for create new bucket
risha-vijayvargiya-22 Dec 9, 2024
1723bba
Storage account API integration is integrated.
shreyas-ls Dec 9, 2024
3d09750
Rearranged the fields and added the mandatory fields.
shreyas-ls Dec 9, 2024
557de30
added missing dependency
risha-vijayvargiya-22 Dec 9, 2024
6875f8f
added dependency
risha-vijayvargiya-22 Dec 9, 2024
6f4cb44
Implemented resume, pause.trigger and delete logic in vertex schedule
vysakhviswama Dec 9, 2024
e34ba9c
resolved bucket exists error
risha-vijayvargiya-22 Dec 10, 2024
617e04a
added xpn host api
risha-vijayvargiya-22 Dec 10, 2024
be02f46
added missing imports
risha-vijayvargiya-22 Dec 10, 2024
bdb0a6e
resolved error
risha-vijayvargiya-22 Dec 10, 2024
de313c4
added run once logic in list schedule api
risha-vijayvargiya-22 Dec 10, 2024
9c1f137
added get schedule api
risha-vijayvargiya-22 Dec 10, 2024
10703f3
Implemented edit notebook logic in vertex schedule listing
vysakhviswama Dec 11, 2024
a827450
resolved errors
risha-vijayvargiya-22 Dec 11, 2024
dc34a23
resolved errors while creating schedule
risha-vijayvargiya-22 Dec 11, 2024
f5a086b
resolved error
risha-vijayvargiya-22 Dec 11, 2024
2825808
Error handled in pause,resume, trigger and delete
vysakhviswama Dec 11, 2024
643f378
changed machine type
risha-vijayvargiya-22 Dec 12, 2024
336e65a
return empty object when no content in xpn host
risha-vijayvargiya-22 Dec 12, 2024
b0454d7
return lastScheduledRunResponse in the response
risha-vijayvargiya-22 Dec 12, 2024
4afc679
added disc spec in payload
risha-vijayvargiya-22 Dec 12, 2024
ae1ee8b
added region and network filter
risha-vijayvargiya-22 Dec 12, 2024
2583c85
Updated error handling, implemented refresh button and added icon for…
vysakhviswama Dec 12, 2024
e8f469a
made max run count optional
risha-vijayvargiya-22 Dec 12, 2024
2a30b3e
changed run once condition
risha-vijayvargiya-22 Dec 12, 2024
3126159
Updated status action icon with validation
vysakhviswama Dec 12, 2024
320cc23
converted list of string to dictionary
risha-vijayvargiya-22 Dec 13, 2024
a81eb08
added job id
risha-vijayvargiya-22 Dec 13, 2024
4fb493a
filter out the results on the basis of start date
risha-vijayvargiya-22 Dec 13, 2024
1894f26
changed the filter condition
risha-vijayvargiya-22 Dec 13, 2024
95860c8
removed client library code for logs
risha-vijayvargiya-22 Dec 13, 2024
a2440ae
resolved some errors
risha-vijayvargiya-22 Dec 13, 2024
201f73f
resolved errors
risha-vijayvargiya-22 Dec 13, 2024
8b754fa
resolved an error
risha-vijayvargiya-22 Dec 13, 2024
211835d
changed logic for splitting
risha-vijayvargiya-22 Dec 16, 2024
a6a14df
fixed the file path issue
risha-vijayvargiya-22 Dec 16, 2024
1f0e715
return create time in response
risha-vijayvargiya-22 Dec 17, 2024
a3746c0
passed credentials while connecting with client
risha-vijayvargiya-22 Dec 17, 2024
d4572e9
accepted disk type and size from ui
risha-vijayvargiya-22 Dec 18, 2024
fe4f28b
Cretae and listing screen for the vertex.
shreyas-ls Dec 18, 2024
834b679
added the function for disktype
shreyas-ls Dec 18, 2024
dcb14d5
used client library
risha-vijayvargiya-22 Dec 18, 2024
d2747d7
Developed the UI of the execution history and moved the icons into th…
shreyas-ls Dec 18, 2024
1de5271
Added the copyright message for every files.
shreyas-ls Dec 18, 2024
73eef2b
resolved errors
risha-vijayvargiya-22 Dec 18, 2024
e4d4018
removed the any types and added the comments for the functions
shreyas-ls Dec 18, 2024
d7f5827
Resolved the comments.
shreyas-ls Dec 18, 2024
e13bc2c
resolved mr comments
risha-vijayvargiya-22 Dec 19, 2024
73d7473
fixed the execution history bug.
shreyas-ls Dec 19, 2024
c512305
resolved error related to disk type
risha-vijayvargiya-22 Dec 19, 2024
613c983
moved the API calls to services folder
shreyas-ls Dec 19, 2024
49bbfe6
Merge pull request #4 from Shreyasls/vertex-execution-history
harsha-accenture Dec 19, 2024
94c3b46
Merge branch 'main' of https://github.com/Shreyasls/vertex_scheduler_…
risha-vijayvargiya-22 Dec 19, 2024
823357b
Merge pull request #1 from Shreyasls/ui-config-api
harsha-accenture Dec 19, 2024
ac70a6b
Merge branch 'main' of https://github.com/Shreyasls/vertex_scheduler_…
risha-vijayvargiya-22 Dec 19, 2024
905726e
resolved comments
risha-vijayvargiya-22 Dec 19, 2024
ab69668
fixed trigger now issue
risha-vijayvargiya-22 Dec 23, 2024
9e9ddde
passed credentials while creating a bucket
risha-vijayvargiya-22 Dec 23, 2024
5a3e32d
updated indentation
risha-vijayvargiya-22 Dec 24, 2024
899d68e
resolved one error
risha-vijayvargiya-22 Dec 24, 2024
085cf0c
Merge branch 'main' of https://github.com/Shreyasls/vertex_scheduler_…
risha-vijayvargiya-22 Dec 24, 2024
2d72b0a
updated indentation
risha-vijayvargiya-22 Dec 24, 2024
78612ae
added the create new bucket functionality and updated the color codes…
shreyas-ls Dec 24, 2024
09bfe52
error message for service account is changed.
shreyas-ls Dec 24, 2024
654bb91
added download api code
risha-vijayvargiya-22 Dec 24, 2024
78ecf38
added indentation
risha-vijayvargiya-22 Dec 24, 2024
08f074e
resolved error
risha-vijayvargiya-22 Dec 24, 2024
be1ebfa
updation in download logic
risha-vijayvargiya-22 Dec 26, 2024
54f3663
added notebook url in list response
risha-vijayvargiya-22 Dec 27, 2024
43606c8
resolved errors
risha-vijayvargiya-22 Jan 2, 2025
ac3f98b
resolved errors
risha-vijayvargiya-22 Jan 2, 2025
946a603
resolved update errors
risha-vijayvargiya-22 Jan 2, 2025
bf88689
Implemented listing schedule edit job logic
vysakhviswama Jan 2, 2025
6ec5a83
resolved download flow errors
risha-vijayvargiya-22 Jan 6, 2025
67538e0
implemented the download functionality in the execution history page.
shreyas-ls Jan 6, 2025
d3b2bec
resolved errors in update flow
risha-vijayvargiya-22 Jan 6, 2025
e1b8764
formatted the code
risha-vijayvargiya-22 Jan 6, 2025
0ed9fd5
Merge branch 'main' of https://github.com/Shreyasls/vertex_scheduler_…
risha-vijayvargiya-22 Jan 7, 2025
206054a
formatted code
risha-vijayvargiya-22 Jan 7, 2025
7e2b1a8
Network field missing added in update functionality in vertex
vysakhviswama Jan 9, 2025
8601ad7
resolved pr comments
risha-vijayvargiya-22 Jan 9, 2025
c893688
resolved pr comments
risha-vijayvargiya-22 Jan 9, 2025
f25f35b
resolved pr comments
risha-vijayvargiya-22 Jan 10, 2025
02b0a39
Merge pull request #3 from Shreyasls/create-api
risha-vijayvargiya-22 Jan 10, 2025
a75b8b3
Merge branch 'main' of https://github.com/Shreyasls/vertex_scheduler_…
risha-vijayvargiya-22 Jan 10, 2025
45ba6e5
formatted code
risha-vijayvargiya-22 Jan 10, 2025
9455431
Merge pull request #7 from Shreyasls/list-schedule
risha-vijayvargiya-22 Jan 10, 2025
fb13751
Merge branch 'main' of https://github.com/Shreyasls/vertex_scheduler_…
risha-vijayvargiya-22 Jan 10, 2025
469d8f9
formatted code
risha-vijayvargiya-22 Jan 10, 2025
7bde241
Implemented edit functionality for edit jobs
vysakhviswama Jan 10, 2025
4e0d0c6
resolved the comments
shreyas-ls Jan 10, 2025
bfaa82d
Code updated with review comments
vysakhviswama Jan 13, 2025
0156ced
Status icon change while creating a schedule code is updated
vysakhviswama Jan 13, 2025
9d3e020
Params {} removed from function comments
vysakhviswama Jan 15, 2025
de2c76a
Merge pull request #5 from Shreyasls/execution-history
risha-vijayvargiya-22 Jan 16, 2025
21bb1df
Removed accordian and added logic to display only ERROR and WARNING l…
vysakhviswama Jan 16, 2025
97fd52b
Status icon tooltip text changed according to its status
vysakhviswama Jan 16, 2025
5166d77
Review comments updated for create vertex schedule
vysakhviswama Jan 16, 2025
a04722e
replaced the toast.success to toast.error in storage.tsx file.
shreyas-ls Jan 16, 2025
0440cef
Merge pull request #6 from Shreyasls/create-new-bucket
shreyas-ls Jan 17, 2025
1d3f40b
Conflict resolved with the main branch
vysakhviswama Jan 17, 2025
934db59
Updated the code with review comments
vysakhviswama Jan 17, 2025
f91b861
Merge pull request #8 from Shreyasls/update-vertex-job
shreyas-ls Jan 17, 2025
47ab782
fixed issues related to update flow
risha-vijayvargiya-22 Jan 20, 2025
28c3616
Start data and end date made empty on create schedule.Network issue i…
vysakhviswama Jan 20, 2025
d207b1c
Added css for status text alignment
vysakhviswama Jan 20, 2025
a8a37e7
Schedule name added to download modal in execution history
vysakhviswama Jan 21, 2025
896cbbf
Edit functionality logic added in list vertex schedule.
vysakhviswama Jan 21, 2025
600403f
Tool tip added for newly created schedule in list vertex schedule
vysakhviswama Jan 21, 2025
a2e6d41
Merge branch 'GoogleCloudDataproc:main' into main
shreyas-ls Jan 21, 2025
9da3ae4
Merge branch 'GoogleCloudDataproc:main' into dev
shreyas-ls Jan 21, 2025
2873267
Removed unused code
vysakhviswama Jan 21, 2025
4723961
Merge branch 'dev' of https://github.com/Shreyasls/vertex_scheduler_m…
vysakhviswama Jan 21, 2025
c016064
Merge pull request #9 from Shreyasls/dev
shreyas-ls Jan 21, 2025
dd360f9
1. Vertex job UI
vysakhviswama Jan 21, 2025
3c269c4
removed the backend code files.
shreyas-ls Jan 21, 2025
b0a5b63
added the package
shreyas-ls Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
UI config api changes
risha-vijayvargiya-22 committed Nov 12, 2024
commit 63b038ee8d158878a06e365b96fa8f4ca6fae2e1
42 changes: 42 additions & 0 deletions dataproc_jupyter_plugin/controllers/vertex/vertex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json

import aiohttp
import tornado
from jupyter_server.base.handlers import APIHandler

from dataproc_jupyter_plugin import credentials
from dataproc_jupyter_plugin.services.vertex import vertex


class UIConfigController(APIHandler):
@tornado.web.authenticated
async def get(self):
"""Returns available ui config"""
try:
async with aiohttp.ClientSession() as client_session:
client = vertex.Client(
await credentials.get_cached(), self.log, client_session
)
configs = await client.list_uiconfig()
response = []
for config in configs:
env = config.dict()
response.append(env)
self.finish(json.dumps(response))
except Exception as e:
self.log.exception(f"Error fetching ui config: {str(e)}")
self.finish({"error": str(e)})
2 changes: 2 additions & 0 deletions dataproc_jupyter_plugin/handlers.py
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
dataproc,
executor,
)
from dataproc_jupyter_plugin.controllers.vertex import vertex

_region_not_set_error = """GCP region not set in gcloud.

@@ -209,6 +210,7 @@ def full_path(name):
"bigQueryPreview": bigquery.PreviewController,
"bigQueryProjectsList": bigquery.ProjectsController,
"bigQuerySearch": bigquery.SearchController,
"api/vertex/uiConfig": vertex.UIConfigController
}
handlers = [(full_path(name), handler) for name, handler in handlersMap.items()]
web_app.add_handlers(host_pattern, handlers)
77 changes: 77 additions & 0 deletions dataproc_jupyter_plugin/services/vertex/vertex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: modify code
from typing import List

from dataproc_jupyter_plugin import urls
from dataproc_jupyter_plugin.commons.constants import (
VERTEX_SERVICE_NAME,
CONTENT_TYPE,
)


class Client:
def __init__(self, credentials, log, client_session):
self.log = log
if not (
("access_token" in credentials)
and ("project_id" in credentials)
and ("region_id" in credentials)
):
self.log.exception("Missing required credentials")
raise ValueError("Missing required credentials")
self._access_token = credentials["access_token"]
self.project_id = credentials["project_id"]
self.region_id = credentials["region_id"]
self.client_session = client_session

def create_headers(self):
return {
"Content-Type": CONTENT_TYPE,
"Authorization": f"Bearer {self._access_token}",
}

async def list_uiconfig(self) -> List[]:
try:
uiconfig = []
# vertex_url = await urls.gcp_service_url(VERTEX_SERVICE_NAME)
# api_endpoint = f"{self.region_id}-{vertex_url}/ui/projects/{self.project_id}/locations/{self.region_id}/uiConfig"
api_endpoint = "https://us-central1-aiplatform.googleapis.com/ui/projects/bngy-prod-colab/locations/us-central1/uiConfig"

headers = self.create_headers()
async with self.client_session.get(
api_endpoint, headers=headers
) as response:
if response.status == 200:
resp = await response.json()
if not resp:
return uiconfig
else:
for machineconfig in resp.get("notebookRuntimeConfig").get("machineConfigs"):
ramBytes_in_gb = int(machineconfig.get('ramBytes')) / 1000000000
formatted_config = {
"machineType": f"{machineconfig.get('machineType')} ({machineconfig.get('cpuCount')} CPUs, {ramBytes_in_gb} GB RAM)",
"acceleratorConfigs": machineconfig.get("acceleratorConfigs")
}
uiconfig.append(formatted_config)
return uiconfig
else:
self.log.exception("Error listing ui config")
raise Exception(
f"Error getting vertex ui config: {response.reason} {await response.text()}"
)
except Exception as e:
self.log.exception(f"Error fetching ui config: {str(e)}")
return {"Error fetching ui config": str(e)}