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

debugging #4592

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion codalab/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<binary>'
URLOPEN_TIMEOUT_SECONDS = int(os.environ.get('CODALAB_URLOPEN_TIMEOUT_SECONDS', 5 * 60))

Expand Down
2 changes: 1 addition & 1 deletion codalab/rest/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 },
Expand Down
23 changes: 22 additions & 1 deletion frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -100,17 +102,36 @@ 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;
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);
});
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -36,7 +37,13 @@ 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);
console.log(bundleInfo.bundleStore);
const bundleType = bundle.bundle_type.value;
const uuid = bundle.uuid.value;
const state = bundle.state.value;
Expand Down Expand Up @@ -109,8 +116,8 @@ class BundleDetailSideBar extends React.Component {
{(showRunFields || showDatasetFields) && (
<BundleFieldRow
label='Store'
field={bundle.store}
onChange={(store) => onUpdate({ store })}
field={bundle.bundleStore}
onChange={(bundleStore) => onUpdate({ bundleStore })}
/>
)}
</BundleFieldTable>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


# should match codalab/common.py#CODALAB_VERSION
CODALAB_VERSION = "1.7.3"
CODALAB_VERSION = "1.7.4"


class Install(install):
Expand Down
Loading