From bd27151d272d098413db466d4bc34ece79608b51 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Mon, 8 Apr 2024 23:57:48 -0700 Subject: [PATCH 01/15] debugging --- .../components/worksheets/BundleDetail/BundleDetailSideBar.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index c17700d67..01a6f27b5 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -37,6 +37,8 @@ class BundleDetailSideBar extends React.Component { const { bundleInfo, classes, hidePageLink, onUpdate, onMetadataChange } = this.props; const { expandPermissons, showMoreDetail } = this.state; const bundle = formatBundle(bundleInfo); + console.log(bundle) + console.log(bundleInfo) const bundleType = bundle.bundle_type.value; const uuid = bundle.uuid.value; const state = bundle.state.value; From 581d9dda1df5a7c9c670d07b6c8bc75c219bb51e Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Mon, 15 Apr 2024 21:43:54 -0700 Subject: [PATCH 02/15] debugging 2 --- codalab/common.py | 2 +- frontend/src/components/Store/Store.js | 5 +++-- frontend/src/constants.js | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/codalab/common.py b/codalab/common.py index 1958adff1..79fabdc7a 100644 --- a/codalab/common.py +++ b/codalab/common.py @@ -29,7 +29,7 @@ # Increment this on master when ready to cut a release. # http://semver.org/ -CODALAB_VERSION = '1.7.3' +CODALAB_VERSION = '1.7.4' BINARY_PLACEHOLDER = '' URLOPEN_TIMEOUT_SECONDS = int(os.environ.get('CODALAB_URLOPEN_TIMEOUT_SECONDS', 5 * 60)) diff --git a/frontend/src/components/Store/Store.js b/frontend/src/components/Store/Store.js index c840bb73e..f141994f1 100644 --- a/frontend/src/components/Store/Store.js +++ b/frontend/src/components/Store/Store.js @@ -5,7 +5,7 @@ import ContentWrapper from '../ContentWrapper'; import { renderFormat } from '../../util/worksheet_utils'; import './Store.scss'; import ErrorMessage from '../worksheets/ErrorMessage'; -import { fetchStores } from '../../util/apiWrapper'; +import { fetchBundleStores } from '../../util/apiWrapper'; class Store extends React.Component { state = { @@ -16,7 +16,8 @@ class Store extends React.Component { */ refreshStore = () => { const { uuid } = this.props; - fetchStores(uuid) + console.log('hello!!!') + fetchBundleStores(uuid) .then((response) => { const { data: { attributes: storeInfo }, diff --git a/frontend/src/constants.js b/frontend/src/constants.js index c344b66ee..efeae87f7 100644 --- a/frontend/src/constants.js +++ b/frontend/src/constants.js @@ -1,5 +1,5 @@ // Should match codalab/common.py#CODALAB_VERSION -export const CODALAB_VERSION = '1.7.3'; +export const CODALAB_VERSION = '1.7.4'; // Name Regex to match the backend in spec_utils.py export const NAME_REGEX = /^[a-zA-Z_][a-zA-Z0-9_.-]*$/i; diff --git a/setup.py b/setup.py index a821b3141..0d7fc39a9 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ # should match codalab/common.py#CODALAB_VERSION -CODALAB_VERSION = "1.7.3" +CODALAB_VERSION = "1.7.4" class Install(install): From 544697576e7339df2c8742b1dec8aa5f50a4cabb Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Mon, 15 Apr 2024 22:11:16 -0700 Subject: [PATCH 03/15] debugging 3 --- .../worksheets/BundleDetail/BundleDetail.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx index 204cc2148..68f1a3669 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx @@ -50,6 +50,8 @@ const BundleDetail = ({ } }, [uuid]); + console.log('bundleINfoFromRow') + console.log(bundleInfoFromRow) // If info is not available yet, fetch // If bundle is in a state that is possible to transition to a different state, fetch data // we have ignored ready|failed|killed states here @@ -100,12 +102,20 @@ const BundleDetail = ({ include: 'owner,group_permissions,host_worksheets', }).toString(); + console.log('fetcherMetadata') + console.log(fetcherMetadata) + console.log('urlMetadata') + console.log(urlMetadata) const { mutate: mutateMetadata } = useSWR(urlMetadata, fetcherMetadata, { revalidateOnMount: true, refreshInterval: refreshInterval, onSuccess: (response) => { + console.log('response') + console.log(response) // Normalize JSON API doc into simpler object const bundleInfo = new JsonApiDataStore().sync(response); + console.log('bundleINfo') + console.log(bundleInfo) bundleInfo.editableMetadataFields = response.data.meta.editable_metadata_keys; bundleInfo.metadataDescriptions = response.data.meta.metadata_descriptions; bundleInfo.metadataTypes = response.data.meta.metadata_type; From 9d8e277b0334b191c20a8ac0d4cda18545ee5840 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 16 Apr 2024 00:22:39 -0700 Subject: [PATCH 04/15] fix --- codalab/rest/bundles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codalab/rest/bundles.py b/codalab/rest/bundles.py index 117e5557f..0d2b5f8d9 100644 --- a/codalab/rest/bundles.py +++ b/codalab/rest/bundles.py @@ -498,7 +498,7 @@ def _add_bundle_location(bundle_uuid: str): new_location['bundle_uuid'], default_bundle_store['uuid'] ) local.model.update_bundle( - bundle, {'storage_type': default_bundle_store['storage_type'], 'is_dir': is_dir}, + bundle, {'storage_type': default_bundle_store['storage_type'], 'is_dir': is_dir, 'metadata': {'store': default_store_name}}, ) bundle_url = local.bundle_store.get_bundle_location( bundle_uuid, default_bundle_store['uuid'] From 71fbe1f60eb1d9928e0097af7f0b541de99a50b1 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Mon, 22 Apr 2024 23:13:29 -0700 Subject: [PATCH 05/15] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 01a6f27b5..38f8986f9 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -8,6 +8,7 @@ import { BundleFieldTable, BundleFieldRow, BundleStateRow } from './BundleFieldT import BundleDependencies from './BundleDependencies'; import BundleHostWorksheets from './BundleHostWorksheets'; import BundlePermissions from './BundlePermissions'; +import { fetchBundleStores } from '../../../util/apiWrapper'; /** * This component renders bundle metadata in a sidebar. @@ -50,7 +51,8 @@ class BundleDetailSideBar extends React.Component { const showOwner = !bundle.is_anonymous.value; const showDependencies = !!bundle.dependencies?.value?.length; const showHostWorksheets = !!bundle.host_worksheets?.value.length; - + let bundleStore; + fetchBundleStores(uuid).then((response) => {bundleStore = response; console.log('!!!!!!!!'); console.log(response);}); return (
{showPageLink && ( @@ -111,7 +113,7 @@ class BundleDetailSideBar extends React.Component { {(showRunFields || showDatasetFields) && ( onUpdate({ store })} /> )} From 95ccf4edcaaab815c869b5225f1517349ea1d142 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Mon, 22 Apr 2024 23:27:40 -0700 Subject: [PATCH 06/15] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 38f8986f9..036824d50 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -52,7 +52,13 @@ class BundleDetailSideBar extends React.Component { const showDependencies = !!bundle.dependencies?.value?.length; const showHostWorksheets = !!bundle.host_worksheets?.value.length; let bundleStore; - fetchBundleStores(uuid).then((response) => {bundleStore = response; console.log('!!!!!!!!'); console.log(response);}); + fetchBundleStores(uuid) + .then((response) => { + const { + data: { attributes: { name: bundleStore } }, + } = response; + console.log(bundleStore); + console.log('!!!!!!!!'); console.log(response);}); return (
{showPageLink && ( From 4a4dc9cecff8d537eaf5a563787638d43b51d8f8 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Mon, 22 Apr 2024 23:53:10 -0700 Subject: [PATCH 07/15] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 036824d50..334e7c088 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -38,8 +38,6 @@ class BundleDetailSideBar extends React.Component { const { bundleInfo, classes, hidePageLink, onUpdate, onMetadataChange } = this.props; const { expandPermissons, showMoreDetail } = this.state; const bundle = formatBundle(bundleInfo); - console.log(bundle) - console.log(bundleInfo) const bundleType = bundle.bundle_type.value; const uuid = bundle.uuid.value; const state = bundle.state.value; @@ -54,9 +52,12 @@ class BundleDetailSideBar extends React.Component { let bundleStore; fetchBundleStores(uuid) .then((response) => { - const { - data: { attributes: { name: bundleStore } }, - } = response; + console.log('~~~~~~~~'); + console.log(response); + console.log(response.data); + console.log(response.data.attributes); + console.log(response.data.attributes.name); + bundleStore = response.data.attributes.name; console.log(bundleStore); console.log('!!!!!!!!'); console.log(response);}); return ( From c6319efc44f076557a6a4743b54c9fa83406e6f2 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 00:12:27 -0700 Subject: [PATCH 08/15] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 334e7c088..709f6ce98 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -54,10 +54,10 @@ class BundleDetailSideBar extends React.Component { .then((response) => { console.log('~~~~~~~~'); console.log(response); - console.log(response.data); - console.log(response.data.attributes); - console.log(response.data.attributes.name); - bundleStore = response.data.attributes.name; + console.log(response.data[0]); + console.log(response.data[0].attributes); + console.log(response.data[0].attributes.name); + bundleStore = response.data[0].attributes.name; console.log(bundleStore); console.log('!!!!!!!!'); console.log(response);}); return ( From 53bcc3b92b75f8d4a5b9ac611f460b21db455471 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 00:39:05 -0700 Subject: [PATCH 09/15] fix --- .../BundleDetail/BundleDetailSideBar.jsx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 709f6ce98..a16a98b97 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -49,17 +49,13 @@ class BundleDetailSideBar extends React.Component { const showOwner = !bundle.is_anonymous.value; const showDependencies = !!bundle.dependencies?.value?.length; const showHostWorksheets = !!bundle.host_worksheets?.value.length; - let bundleStore; - fetchBundleStores(uuid) - .then((response) => { - console.log('~~~~~~~~'); - console.log(response); - console.log(response.data[0]); - console.log(response.data[0].attributes); - console.log(response.data[0].attributes.name); - bundleStore = response.data[0].attributes.name; - console.log(bundleStore); - console.log('!!!!!!!!'); console.log(response);}); + + let bundleStoreResponse = await fetchBundleStores(uuid); + const bundleStore = bundleStoreResponse.data[0].attributes.name; + console.log('!!!!!!!!'); + console.log(bundleStoreResponse); + console.log(bundleStore); + return (
{showPageLink && ( From 13da5a65105870819c6839307ad51f403c7e7800 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 01:08:44 -0700 Subject: [PATCH 10/15] fix --- .../components/worksheets/BundleDetail/BundleDetail.jsx | 7 ++++++- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 8 +------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx index 68f1a3669..a2f8829f2 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'; import { JsonApiDataStore } from 'jsonapi-datastore'; import { findDOMNode } from 'react-dom'; import useSWR from 'swr'; -import { apiWrapper, fetchFileSummary } from '../../../util/apiWrapper'; +import { apiWrapper, fetchBundleStores, fetchFileSummary } from '../../../util/apiWrapper'; import ConfigPanel from '../ConfigPanel'; import ErrorMessage from '../ErrorMessage'; @@ -206,6 +206,11 @@ const BundleDetail = ({ }, }); + fetchBundleStores(uuid) + .then((response) => { + const bundleStore = response.data[0].attributes.name; + bundleInfo.bundleStore = bundleStore;}); + const scrollToNewlyOpenedDetail = (node) => { // Only scroll to the bundle detail when it is opened if (node && open) { diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index a16a98b97..519bb9a9f 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -50,12 +50,6 @@ class BundleDetailSideBar extends React.Component { const showDependencies = !!bundle.dependencies?.value?.length; const showHostWorksheets = !!bundle.host_worksheets?.value.length; - let bundleStoreResponse = await fetchBundleStores(uuid); - const bundleStore = bundleStoreResponse.data[0].attributes.name; - console.log('!!!!!!!!'); - console.log(bundleStoreResponse); - console.log(bundleStore); - return (
{showPageLink && ( @@ -116,7 +110,7 @@ class BundleDetailSideBar extends React.Component { {(showRunFields || showDatasetFields) && ( onUpdate({ store })} /> )} From 1fbaf4c410489d8f825b59b5e0cca9a552e38925 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 09:45:08 -0700 Subject: [PATCH 11/15] fix --- .../components/worksheets/BundleDetail/BundleDetail.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx index a2f8829f2..31dd05c75 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx @@ -208,8 +208,14 @@ const BundleDetail = ({ fetchBundleStores(uuid) .then((response) => { + console.log('~~~~~~~~~~~~~'); const bundleStore = response.data[0].attributes.name; - bundleInfo.bundleStore = bundleStore;}); + console.log(bundleStore); + console.log(bundleInfo); + bundleInfo.bundleStore = bundleStore; + console.log(bundleInfo); + setBundleInfo(bundleInfo); + }); const scrollToNewlyOpenedDetail = (node) => { // Only scroll to the bundle detail when it is opened From 422b73c70cf0bdf412db63441f12459cf1200528 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 09:59:15 -0700 Subject: [PATCH 12/15] fix --- .../worksheets/BundleDetail/BundleDetail.jsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx index 31dd05c75..c5e474fca 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx @@ -121,6 +121,17 @@ const BundleDetail = ({ bundleInfo.metadataTypes = response.data.meta.metadata_type; setBundleInfo(bundleInfo); setMetadataErrors([]); + + fetchBundleStores(uuid) + .then((response) => { + console.log('~~~~~~~~~~~~~'); + const bundleStore = response.data[0].attributes.name; + console.log(bundleStore); + console.log(bundleInfo); + bundleInfo.bundleStore = bundleStore; + console.log(bundleInfo); + setBundleInfo(bundleInfo); + }); }, }); @@ -206,17 +217,6 @@ const BundleDetail = ({ }, }); - fetchBundleStores(uuid) - .then((response) => { - console.log('~~~~~~~~~~~~~'); - const bundleStore = response.data[0].attributes.name; - console.log(bundleStore); - console.log(bundleInfo); - bundleInfo.bundleStore = bundleStore; - console.log(bundleInfo); - setBundleInfo(bundleInfo); - }); - const scrollToNewlyOpenedDetail = (node) => { // Only scroll to the bundle detail when it is opened if (node && open) { From 02089c13461eab047a62a46c717227bbbd9a02e6 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 10:28:20 -0700 Subject: [PATCH 13/15] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 519bb9a9f..0ab6fc9f5 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -37,7 +37,12 @@ class BundleDetailSideBar extends React.Component { render() { const { bundleInfo, classes, hidePageLink, onUpdate, onMetadataChange } = this.props; const { expandPermissons, showMoreDetail } = this.state; + console.log('~~~~~~~~~hello'); + console.log(bundleInfo); const bundle = formatBundle(bundleInfo); + console.log(bundle); + const bundleStore = bundle.bundleStore.value; + console.log(bundleStore); const bundleType = bundle.bundle_type.value; const uuid = bundle.uuid.value; const state = bundle.state.value; @@ -110,7 +115,7 @@ class BundleDetailSideBar extends React.Component { {(showRunFields || showDatasetFields) && ( onUpdate({ store })} /> )} From f5e20fbdb1c6330ce136b64ba505db40dfd436c6 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 10:54:55 -0700 Subject: [PATCH 14/15] fix --- .../components/worksheets/BundleDetail/BundleDetailSideBar.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 0ab6fc9f5..8e3077d6a 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -41,8 +41,9 @@ class BundleDetailSideBar extends React.Component { console.log(bundleInfo); const bundle = formatBundle(bundleInfo); console.log(bundle); - const bundleStore = bundle.bundleStore.value; + const bundleStore = bundle.bundleStore?.value; console.log(bundleStore); + console.log(bundleInfo.bundleStore); const bundleType = bundle.bundle_type.value; const uuid = bundle.uuid.value; const state = bundle.state.value; From 3b985637750f7714212c6509cb14483e78e37819 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 11:21:39 -0700 Subject: [PATCH 15/15] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 8e3077d6a..7abb0da49 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -116,8 +116,8 @@ class BundleDetailSideBar extends React.Component { {(showRunFields || showDatasetFields) && ( onUpdate({ store })} + field={bundle.bundleStore} + onChange={(bundleStore) => onUpdate({ bundleStore })} /> )}