Skip to content

Commit

Permalink
Merge pull request #18033 from martenson/storage-details
Browse files Browse the repository at this point in the history
[24.0] clarify the object store relocate functionality
  • Loading branch information
martenson authored Apr 23, 2024
2 parents 4582704 + b8c39a5 commit 625cd8a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 21 deletions.
14 changes: 6 additions & 8 deletions client/src/components/Dataset/DatasetStorage/DatasetStorage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,7 @@ watch(props, fetch, { immediate: true });

<template>
<div>
<h2 v-if="includeTitle" class="h-md">
Dataset Storage
<RelocateLink
v-if="storageInfo"
:dataset-id="datasetId"
:dataset-storage-details="storageInfo"
@relocated="fetch" />
</h2>
<h2 v-if="includeTitle" class="h-md">Dataset Storage</h2>
<div v-if="errorMessage" class="error">{{ errorMessage }}</div>
<LoadingSpan v-else-if="storageInfo == null"> </LoadingSpan>
<div v-else-if="discarded">
Expand All @@ -84,5 +77,10 @@ watch(props, fetch, { immediate: true });
<div v-else>
<DescribeObjectStore what="This dataset is stored in" :storage-info="storageInfo" />
</div>
<RelocateLink
v-if="storageInfo"
:dataset-id="datasetId"
:dataset-storage-details="storageInfo"
@relocated="fetch" />
</div>
</template>
13 changes: 9 additions & 4 deletions client/src/components/Dataset/DatasetStorage/RelocateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@ defineProps<RelocateProps>();
const emit = defineEmits<{
(e: "relocate", value: string): void;
(e: "closeModal"): void;
}>();
const fromWhat = "This dataset location in a";
const fromWhat = "This dataset location is";
const toWhat = "This dataset will be relocated to";
</script>

<template>
<div>
<p>Relocate the dataset's current object store of:</p>
<p>Currently the dataset is located in:</p>
<b-button-group vertical size="lg" class="select-button-group">
<ObjectStoreSelectButton
:key="fromObjectStore.object_store_id"
id-prefix="swap-target"
class="swap-target-object-store-select-button"
variant="info"
:object-store="fromObjectStore" />
:object-store="fromObjectStore"
@click="emit('closeModal')" />
</b-button-group>
<p>Select a new object store below to relocate the dataset</p>
<p class="relocate-to">Select new storage location for the dataset:</p>
<b-button-group vertical size="lg" class="select-button-group">
<ObjectStoreSelectButton
v-for="objectStore in targetObjectStores"
Expand Down Expand Up @@ -60,4 +62,7 @@ const toWhat = "This dataset will be relocated to";
margin: auto;
width: 400px;
}
.relocate-to {
margin-top: 2em;
}
</style>
12 changes: 9 additions & 3 deletions client/src/components/Dataset/DatasetStorage/RelocateLink.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { BButton } from "bootstrap-vue";
import { storeToRefs } from "pinia";
import { computed, ref } from "vue";
Expand Down Expand Up @@ -70,6 +71,10 @@ const emit = defineEmits<{
(e: "relocated"): void;
}>();
function closeModal() {
showModal.value = false;
}
async function relocate(objectStoreId: string) {
try {
await updateObjectStore(props.datasetId, objectStoreId);
Expand All @@ -84,12 +89,13 @@ async function relocate(objectStoreId: string) {

<template>
<span class="storage-relocate-link">
<SelectModal v-if="currentObjectStore" v-model="showModal" title="Relocate Dataset Storage">
<SelectModal v-if="currentObjectStore" v-model="showModal" title="Relocate Dataset">
<RelocateDialog
:from-object-store="currentObjectStore"
:target-object-stores="validTargets"
@relocate="relocate" />
@relocate="relocate"
@closeModal="closeModal" />
</SelectModal>
<b-link v-if="relocatable" href="#" @click="showModal = true">(relocate)</b-link>
<BButton v-if="relocatable" @click="showModal = true">Relocate Dataset</BButton>
</span>
</template>
12 changes: 9 additions & 3 deletions lib/galaxy/config/sample/object_store_conf.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ backends:
# Sample Distributed Object Store with disk backends configuration
#

# In the distributed object store, existing dataests will be located by the `object_store_id` column in the `dataset`
# In the distributed object store, existing datasets will be located by the `object_store_id` column in the `dataset`
# table of the Galaxy database, which corresponds to the `id` option on the backend. New datasets are created based on
# the `weight` option: a backend with weight "2" has twice the chance of being (randomly) selected for new datasets as a
# backend with weight "1". A weight of "0" will still allow datasets in that backend to be read, but no new datasets
Expand Down Expand Up @@ -299,20 +299,25 @@ extra_dirs:
# The admin is responsible for routinely cleaning that storage using Galaxy's admin scripts - this object store
# configuration just allows the user selection and communicates expectations to the user. Training related to Galaxy
# cleanup scripts can be found in the Galaxy Training Network:
#
#
# Slides: https://gxy.io/GTN:S00103
# Tutorial: https://gxy.io/GTN:T00324
#
# In this example, the scratch storage is marked as user-private by setting the `private` option to "true" on the
# backend definition. This means it cannot be used in public datasets, shared between users, etc.. This is more example
# backend definition. This means it cannot be used in public datasets, shared between users, etc.. This is for example
# purposes - you may very well not want scratch storage to be defined as private as it prevents a lot of regular
# functionality and Galaxy handles regularly cleaned datasets fairly gracefully when the appropriate admin scripts are
# used.
#
# It is safe to just relabel the object store that a dataset belongs to if the underlying paths mapped to by the object
# stores are the same and the dataset has not been copied. To enable users to relocate datasets this way set the
# backends' `device` property to the same value.

type: distributed
backends:
- id: default
type: disk
device: device1
weight: 1
allow_selection: true
name: Default Galaxy Storage
Expand All @@ -329,6 +334,7 @@ backends:
found on our [Archive Tier Storage](https://www.msi.umn.edu/content/archive-tier-storage) page.
- id: scratch
type: disk
device: device2
weight: 0
allow_selection: true
private: true
Expand Down
11 changes: 8 additions & 3 deletions lib/galaxy/config/sample/object_store_conf.xml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<!--
Sample Distributed Object Store with disk backends
In the distributed object store, existing dataests will be located by the
In the distributed object store, existing datasets will be located by the
`object_store_id` column in the `dataset` table of the Galaxy database,
which corresponds to the `id` attribute on the backend tag. New datasets are
created based on the "weight" attribute: a backend with weight "2" has a
Expand Down Expand Up @@ -272,11 +272,16 @@
of regular functionality and Galaxy handles regularly cleaned
datasets fairly gracefully when the appropriate admin scripts
are used.
It is safe to just relabel the object store that a dataset belongs
to if the underlying paths mapped to by the object stores are the
same and the dataset has not been copied. To enable users to relocate
datasets this way set the backends' `device` property to the same value.
-->
<!--
<object_store type="distributed">
<backends>
<backend id="default" allow_selection="true" type="disk" weight="1" name="Default Galaxy Storage">
<backend id="default" allow_selection="true" type="disk" device="device1" weight="1" name="Default Galaxy Storage">
<description>This is Galaxy's default object store - this disk is regularly backed up and all user's have a default quota of 200 GB.
</description>
<files_dir path="database/objects/deafult"/>
Expand All @@ -286,7 +291,7 @@
<backed_up>Backed up to Galaxy's institutional long term tape drive nightly. More information about our tape drive can be found on our [Archive Tier Storage](https://www.msi.umn.edu/content/archive-tier-storage) page.</backed_up>
</badges>
</backend>
<backend id="scratch" allow_selection="true" type="disk" weight="0" name="Scratch Storage" private="true">
<backend id="scratch" allow_selection="true" type="disk" device="device2" weight="0" name="Scratch Storage" private="true">
<quota source="second_tier" />
<description>This object store is connected to institutional scratch storage. This disk is not backed up and private to your user and datasets belonging to this storage will be automatically deleted after one month.
</description>
Expand Down

0 comments on commit 625cd8a

Please sign in to comment.