Skip to content

Commit 99d3506

Browse files
authored
Merge pull request #667 from fractal-analytics-platform/remove-cache-dir
Removed cache_dir field
2 parents 2a896fc + 09a0f38 commit 99d3506

File tree

15 files changed

+45
-133
lines changed

15 files changed

+45
-133
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
*Note: Numbers like (\#123) point to closed Pull Requests on the fractal-web repository.*
22

3+
# Unreleased
4+
5+
* Removed usage of `cache_dir` field (\#667);
6+
37
# 1.11.1
48

59
* Added tasks search filters (\#658);

__tests__/v2/UserEditor.test.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ describe('UserEditor', () => {
5252
slurm_accounts: [],
5353
project_dir: null,
5454
slurm_user: null,
55-
cache_dir: null,
5655
ssh_host: null,
5756
ssh_username: null,
5857
ssh_private_key_path: null,
@@ -80,15 +79,13 @@ describe('UserEditor', () => {
8079
resolve({
8180
...initialSettings,
8281
slurm_user: 'user',
83-
cache_dir: '/path/to/cache/dir',
8482
project_dir: '/path/to/project/dir',
8583
})
8684
)
8785
});
8886

8987
await user.type(screen.getByRole('textbox', { name: 'Project dir' }), '/path/to/project/dir');
9088
await user.type(screen.getByRole('textbox', { name: 'SLURM user' }), 'user');
91-
await user.type(screen.getByRole('textbox', { name: 'Cache dir' }), '/path/to/cache/dir');
9289
await user.click(screen.getByRole('button', { name: 'Save' }));
9390
await screen.findByText('User successfully updated');
9491

@@ -99,7 +96,6 @@ describe('UserEditor', () => {
9996
slurm_accounts: [],
10097
project_dir: '/path/to/project/dir',
10198
slurm_user: 'user',
102-
cache_dir: '/path/to/cache/dir',
10399
ssh_host: null,
104100
ssh_username: null,
105101
ssh_private_key_path: null,
@@ -130,7 +126,7 @@ describe('UserEditor', () => {
130126
resolve({
131127
detail: [
132128
{
133-
loc: ['body', 'cache_dir'],
129+
loc: ['body', 'project_dir'],
134130
msg: 'mocked_error',
135131
type: 'value_error'
136132
}
@@ -139,7 +135,7 @@ describe('UserEditor', () => {
139135
)
140136
});
141137

142-
await user.type(screen.getByRole('textbox', { name: 'Cache dir' }), 'xxx');
138+
await user.type(screen.getByRole('textbox', { name: 'Project dir' }), 'xxx');
143139
await user.click(screen.getByRole('button', { name: 'Save' }));
144140
await screen.findByText('mocked_error');
145141

@@ -148,9 +144,8 @@ describe('UserEditor', () => {
148144
expect.objectContaining({
149145
body: JSON.stringify({
150146
slurm_accounts: [],
151-
project_dir: null,
147+
project_dir: 'xxx',
152148
slurm_user: null,
153-
cache_dir: 'xxx',
154149
ssh_host: null,
155150
ssh_username: null,
156151
ssh_private_key_path: null,
@@ -204,7 +199,6 @@ describe('UserEditor', () => {
204199
slurm_accounts: [],
205200
project_dir: null,
206201
slurm_user: null,
207-
cache_dir: null,
208202
ssh_host: 'localhost',
209203
ssh_username: 'username',
210204
ssh_private_key_path: 'xxx',
@@ -274,7 +268,6 @@ describe('UserEditor', () => {
274268
slurm_accounts: [],
275269
project_dir: null,
276270
slurm_user: null,
277-
cache_dir: null,
278271
ssh_host: 'localhost',
279272
ssh_username: 'username',
280273
ssh_private_key_path: '/path/to/private/key',

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default defineConfig({
107107

108108
webServer: [
109109
{
110-
command: './tests/start-test-server.sh 2.9.0',
110+
command: './tests/start-test-server.sh 2.9.2',
111111
port: 8000,
112112
waitForPort: true,
113113
stdout: 'pipe',

src/lib/components/v2/admin/UserSettingsEditor.svelte

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
});
3030
3131
const settingsFormErrorHandler = new FormErrorHandler('genericSettingsError', [
32-
'cache_dir',
3332
'slurm_accounts',
3433
'project_dir',
3534
'slurm_user',
@@ -113,24 +112,6 @@
113112
<span class="invalid-feedback">{$settingsValidationErrors['slurm_user']}</span>
114113
</div>
115114
</div>
116-
<div class="row mb-3 has-validation">
117-
<label for="cacheDir" class="col-sm-3 col-form-label text-end">
118-
<strong>Cache dir</strong>
119-
</label>
120-
<div class="col-sm-9">
121-
<input
122-
type="text"
123-
class="form-control"
124-
id="cacheDir"
125-
bind:value={settings.cache_dir}
126-
class:is-invalid={settingsFormSubmitted && $settingsValidationErrors['cache_dir']}
127-
/>
128-
<div class="form-text">
129-
Absolute path to a user-owned folder that will be used as a cache for job-related files
130-
</div>
131-
<span class="invalid-feedback">{$settingsValidationErrors['cache_dir']}</span>
132-
</div>
133-
</div>
134115
{:else if runnerBackend === 'slurm_ssh'}
135116
<div class="row mb-3 has-validation">
136117
<label for="sshHost" class="col-sm-3 col-form-label text-end">

src/lib/components/v2/tasks/FilteredTasksTable.svelte

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@
371371
<th>Modality</th>
372372
<th>Input Types</th>
373373
<th>Metadata</th>
374-
<th>Version</th>
374+
<th colspan="2">Version</th>
375375
<slot name="extra-columns-header" />
376376
</tr>
377377
</thead>
@@ -402,27 +402,23 @@
402402
{getMetadataCell(task.taskVersions[task.selectedVersion])}
403403
</td>
404404
<td class="version-col">
405-
<div class="d-flex align-items-center">
406-
<div class="">
407-
{#if Object.keys(task.taskVersions).length > 1}
408-
<select
409-
class="form-select"
410-
aria-label="Version for task {task.taskVersions[task.selectedVersion]
411-
.task_name}"
412-
bind:value={task.selectedVersion}
413-
>
414-
{#each sortVersions(Object.keys(task.taskVersions)) as version}
415-
<option value={version}>{version || 'None'}</option>
416-
{/each}
417-
</select>
418-
{:else}
419-
{task.taskVersions[task.selectedVersion].version}
420-
{/if}
421-
</div>
422-
<div>
423-
<slot name="docs-info" task={task.taskVersions[task.selectedVersion]} />
424-
</div>
425-
</div>
405+
{#if Object.keys(task.taskVersions).length > 1}
406+
<select
407+
class="form-select"
408+
aria-label="Version for task {task.taskVersions[task.selectedVersion]
409+
.task_name}"
410+
bind:value={task.selectedVersion}
411+
>
412+
{#each sortVersions(Object.keys(task.taskVersions)) as version}
413+
<option value={version}>{version || 'None'}</option>
414+
{/each}
415+
</select>
416+
{:else}
417+
{task.taskVersions[task.selectedVersion].version}
418+
{/if}
419+
</td>
420+
<td class="docs-info-col">
421+
<slot name="docs-info" task={task.taskVersions[task.selectedVersion]} />
426422
</td>
427423
<slot name="extra-columns" task={task.taskVersions[task.selectedVersion]} />
428424
</tr>
@@ -457,7 +453,7 @@
457453
}
458454
459455
.version-col {
460-
max-width: 100px;
456+
max-width: 90px;
461457
}
462458
463459
.input-type-text {

src/lib/types.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export type UserSettings = {
125125
project_dir: string | null
126126
// Slurm
127127
slurm_user: string | null
128-
cache_dir: string | null
129128
// Slurm SSH
130129
ssh_host: string | null
131130
ssh_username: string | null

src/routes/settings/+page.svelte

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
let slurmAccounts = [];
2121
let slurmAccountsError = '';
2222
23-
let cacheDir = '';
24-
let cacheDirError = '';
25-
2623
let settingsUpdatedMessage = '';
2724
2825
function addSlurmAccount() {
@@ -42,15 +39,11 @@
4239
}
4340
settingsUpdatedMessage = '';
4441
slurmAccountsError = '';
45-
cacheDirError = '';
4642
const headers = new Headers();
4743
headers.set('Content-Type', 'application/json');
4844
const payload = {
4945
slurm_accounts: slurmAccounts
5046
};
51-
if ($page.data.runnerBackend === 'slurm') {
52-
payload.cache_dir = cacheDir;
53-
}
5447
const response = await fetch(`/api/auth/current-user/settings`, {
5548
method: 'PATCH',
5649
credentials: 'include',
@@ -69,10 +62,6 @@
6962
slurmAccountsError = errorMap['slurm_accounts'];
7063
errorShown = true;
7164
}
72-
if ('cache_dir' in errorMap) {
73-
cacheDirError = errorMap['cache_dir'];
74-
errorShown = true;
75-
}
7665
}
7766
if (!errorShown) {
7867
errorAlert = displayStandardErrorAlert(
@@ -88,7 +77,6 @@
8877
*/
8978
function initFields(settings) {
9079
slurmAccounts = settings.slurm_accounts;
91-
cacheDir = settings.cache_dir || '';
9280
}
9381
9482
onMount(() => {
@@ -112,23 +100,6 @@
112100
{settings.slurm_user || '-'}
113101
</div>
114102
</div>
115-
<div class="row mb-3">
116-
<label class="col-lg-2 col-sm-4 fw-bold" for="cache-dir">Cache dir</label>
117-
<div class="col-lg-6 col-sm-8">
118-
<div class="input-group" class:has-validation={cacheDirError}>
119-
<input
120-
type="text"
121-
class="form-control"
122-
id="cache-dir"
123-
bind:value={cacheDir}
124-
class:is-invalid={cacheDirError}
125-
/>
126-
{#if cacheDirError}
127-
<div class="invalid-feedback">{cacheDirError}</div>
128-
{/if}
129-
</div>
130-
</div>
131-
</div>
132103
{/if}
133104
{#if $page.data.runnerBackend === 'slurm_ssh'}
134105
<div class="row mb-4">

src/routes/v2/admin/groups/[groupId]/edit/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@
190190
slurm_accounts: [],
191191
project_dir: '',
192192
slurm_user: '',
193-
cache_dir: '',
194193
ssh_host: '',
195194
ssh_username: '',
196195
ssh_private_key_path: '',

src/routes/v2/admin/users/[userId]/+page.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@
8787
<th>SLURM user</th>
8888
<td>{settings.slurm_user || '-'}</td>
8989
</tr>
90-
<tr>
91-
<th>Cache dir</th>
92-
<td>{settings.cache_dir || '-'}</td>
93-
</tr>
9490
{/if}
9591
{#if runnerBackend === 'slurm_ssh'}
9692
<tr>

0 commit comments

Comments
 (0)