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

fix: unified project field during dataloading progress #4465

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions coordinator/gscoordinator/flex/core/insight/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
logger = logging.getLogger("graphscope")

class FetchDataloadingJobStatus(object):
def __init__(self, graph, status: JobStatus):
def __init__(self, graph, status: JobStatus, project=PROJECT):
self._graph = graph
self._status = status
self._project = project
self._fetching_thread = StoppableThread(target=self._fetch_impl, args=())
self._fetching_thread.daemon = True
self._fetching_thread.start()
Expand All @@ -52,7 +53,7 @@ def _fetch_impl(self):
s = self._status.to_dict()
conn = http.client.HTTPConnection(STUDIO_WRAPPER_ENDPOINT)
params = urllib.parse.urlencode(
{"jobId": s["id"], "project": PROJECT, "baseId": BASEID}
{"jobId": s["id"], "project": self._project, "baseId": BASEID}
)
while not self._fetching_thread.stopped():
try:
Expand Down Expand Up @@ -294,13 +295,15 @@ def run(self):
location = data_source["inputs"][0]
load_from_odps = load_from_odps and location.startswith("odps://")

project = PROJECT
if not load_from_odps:
status = self.import_data_from_local_file()
else:
# load from odps
configini = convert_to_configini(
self._graph, self._ds_manager, self._config
)
project = configini["project"]
# conn
conn = http.client.HTTPConnection(STUDIO_WRAPPER_ENDPOINT)
conn.request(
Expand Down Expand Up @@ -337,4 +340,4 @@ def run(self):
if isinstance(conn, http.client.HTTPConnection):
conn.close()
# register job status
self._job_status[self.jobid] = FetchDataloadingJobStatus(self._graph, status)
self._job_status[self.jobid] = FetchDataloadingJobStatus(self._graph, status, project)
Loading