Skip to content

Commit b001d0c

Browse files
File invalidation server and integrity checker UI (#1034)
* file content integrity check ui * improved replicas detail * home updates * include decline option * update ticket * include enable logs button * fixed 502 error
1 parent b6ba08a commit b001d0c

11 files changed

Lines changed: 454 additions & 49 deletions

File tree

DMOps/file_invalidation_server/fi_manager/templates/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>{% block title %}File Invalidation Server{% endblock %}</title>
7+
<title>{% block title %}DM File Auditor{% endblock %}</title>
88
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
99
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
1010
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> {% block head %}{% endblock %}
@@ -13,7 +13,7 @@
1313
<header class="bg-light p-3">
1414
<div class="container mt-4">
1515
<div class="d-flex justify-content-between align-items-center border-bottom pb-3 mb-4">
16-
<h1 class="mb-0">File Invalidation Server</h1>
16+
<h1 class="mb-0">File Auditor</h1>
1717
<nav>
1818
<a href="{% url 'home' %}" class="btn btn-outline-primary">
1919
<i class="bi bi-house"></i>

DMOps/file_invalidation_server/fi_manager/templates/fi_manager/approve.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,25 @@ <h5>Files in Request:</h5>
8585
<hr>
8686
<form method="post">
8787
{% csrf_token %}
88-
<button type="submit" class="btn btn-success">Approve Request</button>
88+
89+
<!-- Approve Button -->
90+
<button type="submit"
91+
name="action"
92+
value="approve"
93+
class="btn btn-success me-2"
94+
onclick="return confirm('Are you sure you want to APPROVE this invalidation?')">
95+
Approve Request
96+
</button>
97+
98+
<!-- Decline Button -->
99+
<button type="submit"
100+
name="action"
101+
value="decline"
102+
class="btn btn-danger"
103+
onclick="return confirm('Are you sure you want to DECLINE and DELETE this request?')">
104+
Decline Request
105+
</button>
106+
89107
<a href="{% url 'file-query-filters' %}" class="btn btn-secondary">Back to Query</a>
90108
</form>
91109
</div>

DMOps/file_invalidation_server/fi_manager/templates/fi_manager/home.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends 'base.html' %}
22

33
{% block content %}
4+
<h2 class="mb-3">File Invalidation</h1>
45
<div class="row">
56
<div class="col-md-4 mb-4">
67
<div class="card h-100">
@@ -30,4 +31,25 @@ <h5 class="card-title">Approve Request</h5>
3031
</div>
3132
</div>
3233
</div>
34+
<h2 class="mb-3">File Integrity checker</h1>
35+
<div class="row">
36+
<div class="col-md-6 mb-4">
37+
<div class="card h-100">
38+
<div class="card-body d-flex flex-column">
39+
<h5 class="card-title">Submit integrity check</h5>
40+
<p class="card-text">Submit a new file integrity check request.</p>
41+
<a href="{% url 'integrity-submit' %}" class="btn btn-primary mt-auto">Go to Submit</a>
42+
</div>
43+
</div>
44+
</div>
45+
<div class="col-md-6 mb-4">
46+
<div class="card h-100">
47+
<div class="card-body d-flex flex-column">
48+
<h5 class="card-title">Query requests</h5>
49+
<p class="card-text">View and filter integrity check requests. See details and status of submitted requests.</p>
50+
<a href="{% url 'integrity-query-requests' %}" class="btn btn-primary mt-auto">Go to Query</a>
51+
</div>
52+
</div>
53+
</div>
54+
</div>
3355
{% endblock %}

DMOps/file_invalidation_server/fi_manager/templates/fi_manager/upload.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ <h3 class="card-title">Upload File Invalidation Request</h3>
3333
</div>
3434
<div class="mb-3">
3535
<label for="mode" class="form-label">Mode <span class="text-danger">*</span></label>
36+
<div class="form-text">Global invalidates all replicas in rucio and declares the file invalid in DBS.
37+
Local invalidation declares files as bad at a specific RSE.
38+
DBS only declares the files invalid in DBS.
39+
Rucio only declares all replicas as bad in rucio.</div>
3640
<select name="mode" class="form-select" id="mode" required>
3741
<option value="global">Global</option>
3842
<option value="local">Local</option>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{% extends 'base.html' %}
2+
3+
{% block content %}
4+
<h3><a href="{% url 'integrity-query-requests' %}">File Integrity Query Request</a></h3>
5+
6+
<form method="get" class="mb-4">
7+
<div class="row g-3">
8+
<div class="col-md-3">
9+
<label for="request_id" >Request ID</label>
10+
<input type="hidden" name="request_id" value="{{ request.GET.request_id }}">
11+
<p>{{ request.GET.request_id }}</p>
12+
</div>
13+
<div class="col-md-3">
14+
<label for="file_status" class="form-label">Status:</label>
15+
<select name="file_status" id="file_status">
16+
<option value="FULLY_CORRUPTED">Fully corrupted</option>
17+
<option value="PARTIALLY_CORRUPTED">Partially corrupted</option>
18+
<option value="FULLY_OK">Fully ok</option>
19+
<option value="OK">OK</option>
20+
<option value="PENDING">Pending</option>
21+
<option value="ERROR">Error</option>
22+
<option value="UNKNOWN">Unknown</option>
23+
</select>
24+
</div>
25+
<div class="col-md-3 d-flex align-items-end">
26+
<button type="submit" class="btn btn-primary">Filter</button>
27+
</div>
28+
</div>
29+
</form>
30+
31+
<div class="row g-3 mt-2">
32+
<div class="col-md-3">
33+
<label for="link">More info</label>
34+
<a href="{{ data.0.links.request }}"><p>Request</p></a>
35+
<a href="{{ data.0.links.replicas }}"><p>Replicas</p></a>
36+
</div>
37+
</div>
38+
39+
<table class="table table-striped table-hover">
40+
<thead class="table-dark">
41+
<tr>
42+
<th>Scope</th>
43+
<th>LFN</th>
44+
<th>File status</th>
45+
<th>Summary</th>
46+
<th>Replicas</th>
47+
</tr>
48+
</thead>
49+
<tbody>
50+
{% for file in data %}
51+
<tr>
52+
<td>{{ file.scope }}</td>
53+
<td>{{ file.lfn }}</td>
54+
<td>
55+
<span class="badge
56+
{% if file.file_status == 'FULLY_OK' %}bg-success
57+
{% elif file.file_status == 'OK' %}bg-success
58+
{% elif file.file_status == 'PENDING' %}bg-warning
59+
{% elif file.file_status == 'ERROR' %}bg-danger
60+
{% elif file.file_status == 'FAILED' %}bg-danger
61+
{% else %}bg-secondary{% endif %}">
62+
{{ file.file_status }}
63+
</span>
64+
</td>
65+
<td>{{ file.summary }}</td>
66+
<td>{{ file.replicas }}</td>
67+
</tr>
68+
{% endfor %}
69+
</tbody>
70+
</table>
71+
{% endblock %}

DMOps/file_invalidation_server/fi_manager/templates/integrity/replicas.html

Whitespace-only changes.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{% extends 'base.html' %}
2+
3+
{% block content %}
4+
<h3><a href="{% url 'integrity-query-requests' %}">File Integrity Query Request</a></h3>
5+
6+
<div class="row g-3 mt-2">
7+
<div class="col-md-3">
8+
<label for="request_id" >Request ID</label>
9+
<input type="hidden" name="request_id" value="{{ request.GET.request_id }}">
10+
<p>{{ data.request_id }}</p>
11+
</div>
12+
<div class="col-md-3">
13+
<label for="count">Requested by </label>
14+
<p>{{ data.requested_by }}</p>
15+
</div>
16+
<div class="col-md-3">
17+
<label for="status">Status</label>
18+
<p>{{ data.status }}</p>
19+
</div>
20+
<div class="col-md-3">
21+
<label for="rse_expression">RSE expression</label>
22+
<p>{{ data.rse_expression }}</p>
23+
</div>
24+
<div class="col-md-3">
25+
<label for="full_scan">Full scan</label>
26+
<p>{{ data.full_scan }}</p>
27+
</div>
28+
<div class="col-md-3">
29+
<label for="job_id">Job ID</label>
30+
<p>{{ data.job_id }}</p>
31+
</div>
32+
<div class="col-md-3">
33+
<label for="created_at">Created at</label>
34+
<p>{{ data.created_at }}</p>
35+
</div>
36+
<div class="col-md-3">
37+
<label for="updated_at">Updated at</label>
38+
<p>{{ data.updated_at }}</p>
39+
</div>
40+
<div class="col-md-3">
41+
<label for="link">More info</label>
42+
<a href="{{ data.links.files }}"><p>Files</p></a>
43+
<a href="{{ data.links.replicas }}"><p>Replicas</p></a>
44+
</div>
45+
<div class="col-md-3">
46+
<label for="link">Logs</label>
47+
{% if request.GET.include_logs == 'True' %}
48+
<p style="cursor: pointer; user-select: none; text-decoration: underline;" data-bs-toggle="modal" data-bs-target="#modal-logs">Open logs</p>
49+
<div class="modal fade" id="modal-logs" tabindex="-1" aria-hidden="true">
50+
<div class="modal-dialog modal-lg">
51+
<div class="modal-content">
52+
<div class="modal-header">
53+
<h5 class="modal-title">Logs:</h5>
54+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
55+
</div>
56+
<div class="modal-body">
57+
<div style="background-color: #f8f9fa; padding: 15px; border-radius: 5px; max-height: 400px; overflow-y: auto;"><code>{{ data.logs }}</code></div>
58+
</div>
59+
<div class="modal-footer">
60+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
61+
</div>
62+
</div>
63+
</div>
64+
{% else %}
65+
<a href="{{ request.path }}?request_id={{ request.GET.request_id }}&include_logs=True"><p>Load logs</p></a>
66+
{% endif %}
67+
</div>
68+
</div>
69+
70+
<table class="table table-striped table-hover">
71+
<thead class="table-dark">
72+
<tr>
73+
<th>Scope</th>
74+
<th>LFN</th>
75+
<th>File status</th>
76+
<th>Replica count</th>
77+
<th>OK</th>
78+
<th>Corrupted</th>
79+
<th>Error</th>
80+
<th>Pending</th>
81+
<th>Replicas</th>
82+
</tr>
83+
</thead>
84+
<tbody>
85+
{% for file in data.files %}
86+
<tr>
87+
<td>{{ file.scope }}</td>
88+
<td>{{ file.lfn }}</td>
89+
<td>
90+
<span class="badge
91+
{% if file.file_status == 'FULLY_OK' %}bg-success
92+
{% elif file.file_status == 'OK' %}bg-success
93+
{% elif file.file_status == 'PENDING' %}bg-warning
94+
{% elif file.file_status == 'ERROR' %}bg-danger
95+
{% elif file.file_status == 'FAILED' %}bg-danger
96+
{% else %}bg-secondary{% endif %}">
97+
{{ file.file_status }}
98+
</span>
99+
</td>
100+
<td>{{ file.summary.replica_count }}</td>
101+
<td>{{ file.summary.OK }}</td>
102+
<td>{{ file.summary.CORRUPTED }}</td>
103+
<td>{{ file.summary.ERROR }}</td>
104+
<td>{{ file.summary.pending }}</td>
105+
<td>
106+
<span style="cursor: pointer; user-select: none; display: inline-block;" data-bs-toggle="modal" data-bs-target="#modal-replicas-{{ forloop.counter }}">
107+
Overview
108+
</span>
109+
<div class="modal fade" id="modal-replicas-{{ forloop.counter }}" tabindex="-1" aria-hidden="true">
110+
<div class="modal-dialog modal-lg">
111+
<div class="modal-content">
112+
<div class="modal-header">
113+
<h5 class="modal-title">Replicas: {{ file.lfn }}</h5>
114+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
115+
</div>
116+
<div class="modal-body">
117+
<div style="background-color: #f8f9fa; padding: 15px; border-radius: 5px; max-height: 400px; overflow-y: auto;">
118+
<table class="table table-striped table-hover">
119+
<thead class="table-dark">
120+
<tr>
121+
<th>RSE</th>
122+
<th>Status</th>
123+
<th>PFN</th>
124+
</tr>
125+
</thead>
126+
<tbody>
127+
{% for replica in file.replicas %}
128+
<tr>
129+
<td>{{ replica.rse }}</td>
130+
<td>{{ replica.status }}</td>
131+
<td>{{ replica.pfn }}</td>
132+
</tr>
133+
{% endfor %}
134+
</tbody>
135+
</table>
136+
</div>
137+
</div>
138+
<div class="modal-footer">
139+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
140+
</div>
141+
</div>
142+
</div>
143+
</div>
144+
</td>
145+
</tr>
146+
{% endfor %}
147+
</tbody>
148+
</table>
149+
{% endblock %}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{% extends 'base.html' %}
2+
3+
{% block content %}
4+
<h3><a href="{% url 'integrity-query-requests' %}">File Integrity Query Request</a></h3>
5+
6+
<form method="get" class="mb-4">
7+
<div class="row g-3">
8+
<div class="col-md-3">
9+
<label for="status" class="form-label">Status</label>
10+
<input type="text" name="status" value="{{ request.GET.status }}" class="form-control" id="status">
11+
</div>
12+
<div class="col-md-3">
13+
<label for="request_user" class="form-label">Requested by:</label>
14+
<input type="text" name="request_user" value="{{ request.GET.request_user }}" class="form-control" id="request_user">
15+
</div>
16+
<div class="col-md-3 d-flex align-items-end">
17+
<button type="submit" class="btn btn-primary">Filter</button>
18+
</div>
19+
</div>
20+
</form>
21+
22+
23+
<table class="table table-striped table-hover">
24+
<thead class="table-dark">
25+
<tr>
26+
<th>Request ID</th>
27+
<th>Requested by</th>
28+
<th>Status</th>
29+
<th>RSE Expression</th>
30+
<th>Full scan</th>
31+
<th>Job ID</th>
32+
<th>Created at</th>
33+
<th>Updated at</th>
34+
<th>Files</th>
35+
<th>Replicas</th>
36+
</tr>
37+
</thead>
38+
<tbody>
39+
{% for request in data %}
40+
<tr>
41+
<td><a href="{% url 'integrity-query-requests' %}?request_id={{ request.request_id }}">{{ request.request_id }}</a></td>
42+
<td>{{ request.requested_by }}</td>
43+
<td>
44+
<span class="badge
45+
{% if request.status == 'FULLY_OK' %}bg-success
46+
{% elif request.status == 'OK' %}bg-success
47+
{% elif request.status == 'PENDING' %}bg-warning
48+
{% elif request.status == 'ERROR' %}bg-danger
49+
{% elif request.status == 'FAILED' %}bg-danger
50+
{% else %}bg-secondary{% endif %}">
51+
{{ request.status }}
52+
</span>
53+
</td>
54+
<td>{{ request.rse_expression }}</td>
55+
<td>{{ request.full_scan }}</td>
56+
<td>{{ request.job_id }}</td>
57+
<td>{{ request.created_at }}</td>
58+
<td>{{ request.updated_at }}</td>
59+
<td><a href="{% url 'integrity-query-files' %}?request_id={{ request.request_id }}">Files</a></td>
60+
<td><a href="{% url 'integrity-query-replicas' %}?request_id={{ request.request_id }}">Replicas</a></td>
61+
</tr>
62+
{% endfor %}
63+
</tbody>
64+
</table>
65+
{% endblock %}

0 commit comments

Comments
 (0)