From 99587e03d4d35576d8c69b33519c1762f1131b7f Mon Sep 17 00:00:00 2001 From: SubhadityaMukherjee Date: Wed, 30 Apr 2025 11:59:49 +0200 Subject: [PATCH] starting to work with minio for runs --- openml_OS/models/api/v1/Api_run.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openml_OS/models/api/v1/Api_run.php b/openml_OS/models/api/v1/Api_run.php index d25a94e9..2c2ef3b6 100644 --- a/openml_OS/models/api/v1/Api_run.php +++ b/openml_OS/models/api/v1/Api_run.php @@ -483,6 +483,14 @@ private function run_list($segs, $user_id) { * ), *) */ + + private function get_run_object_prefix(int $run_id): string { + // example bucket for id: 142379 'runs/0000/0000/0014/2379' + $s = str_pad((string)$run_id, 16, "0", STR_PAD_LEFT); + $groups = str_split($s, 4); + return implode('/', $groups) . "/"; + } + private function run($run_id) { if( $run_id == false ) { $this->returnError( 235, $this->version ); @@ -511,6 +519,11 @@ private function run($run_id) { $run->task_evaluation = ""; } + + $url = MINIO_URL . 'runs/' . $this->get_run_object_prefix($run->rid); + $run->minio_url = $url; + $run->parquet_url = $url; + $this->xmlContents( 'run-get', $this->version, array( 'source' => $run ) ); }