Skip to content

Commit 950bbac

Browse files
committed
Enh(viewer/aws): Add some aws links to viewer
1 parent efff825 commit 950bbac

5 files changed

Lines changed: 110 additions & 16 deletions

File tree

aws/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# AWS
22

3-
## Overview
3+
## Usage
44

5-
* `setup/`: Everything needed to set up AWS to run codeclash jobs
5+
```bash
6+
# Hello world example
7+
aws/run_job.py --show-logs -- echo "hello world"
8+
9+
# Run main.py with a config file
10+
# Remember to use the docker_and_sync.sh wrapper script!
11+
# ❌ aws/run_job.py --show-logs -- python main.py configs/test/battlesnake_pvp_test.yaml
12+
aws/run_job.py --show-logs -- aws/docker_and_sync.sh python main.py configs/test/battlesnake_pvp_test.yaml
13+
```
14+
15+
> [!WARNING]
16+
> Everything needs to be committed & pushed to the repo! You can use a different branch than main for this.
17+
18+
## Setup
19+
20+
* `setup/`: Everything needed to set up AWS to run codeclash jobs. Advanced user stuff.

aws/get_job_log.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ def main():
6363
parser = argparse.ArgumentParser(
6464
description="Retrieve logs for AWS Batch jobs",
6565
formatter_class=argparse.RawDescriptionHelpFormatter,
66-
epilog="""
67-
Examples:
68-
%(prog)s abc123-def456-ghi789
69-
""",
7066
)
7167

7268
parser.add_argument("job_id", help="Job ID to retrieve logs for")

codeclash/viewer/static/css/style.css

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,27 +1113,49 @@ summary:focus {
11131113
color: var(--text-secondary) !important;
11141114
}
11151115

1116-
/* Copy path buttons */
1117-
.folder-path-section {
1116+
/* Storage Section */
1117+
.storage-section {
11181118
margin-bottom: 2rem;
11191119
padding: 1rem;
11201120
background: var(--bg-secondary);
11211121
border-radius: 8px;
11221122
border: 1px solid var(--border-color);
11231123
}
11241124

1125-
.folder-path-container h3 {
1126-
margin: 0 0 0.5rem 0;
1127-
color: var(--text-primary);
1125+
.storage-container h3 {
1126+
margin: 0 0 1rem 0;
1127+
color: #ffffff;
11281128
font-size: 1.1rem;
1129+
font-weight: 600;
11291130
}
11301131

1131-
/* Dark mode high contrast fix for folder path header */
1132-
.folder-path-container h3 {
1133-
color: #ffffff;
1134-
font-weight: 600;
1132+
.storage-item {
1133+
display: flex;
1134+
align-items: flex-start;
1135+
gap: 1rem;
1136+
margin-bottom: 0.75rem;
1137+
}
1138+
1139+
.storage-item:last-child {
1140+
margin-bottom: 0;
1141+
}
1142+
1143+
.storage-label {
1144+
flex-shrink: 0;
1145+
min-width: 120px;
1146+
color: var(--text-secondary);
1147+
font-weight: 500;
1148+
}
1149+
1150+
.storage-content {
1151+
flex: 1;
1152+
display: flex;
1153+
align-items: center;
1154+
gap: 0.5rem;
1155+
flex-wrap: wrap;
11351156
}
11361157

1158+
/* Keep existing path-display styles for backward compatibility */
11371159
.path-display {
11381160
display: flex;
11391161
align-items: center;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!-- Storage Section -->
2+
<section class="storage-section">
3+
<div class="storage-container">
4+
<h3><i class="bi bi-hdd"></i> Storage</h3>
5+
6+
<!-- Current Folder Path -->
7+
<div class="storage-item">
8+
<div class="storage-label">
9+
<i class="bi bi-folder"></i> Current Folder:
10+
</div>
11+
<div class="storage-content">
12+
<code class="folder-path">{{ selected_folder_path }}</code>
13+
<button class="btn btn-outline-primary btn-sm copy-path-btn" data-path="{{ selected_folder_path }}" title="Copy folder path">
14+
<i class="bi bi-clipboard"></i> Copy path
15+
</button>
16+
{% if not is_static %}
17+
<button class="btn btn-outline-warning btn-sm move-rename-btn" onclick="showMoveDialog('{{ selected_folder_path }}')" title="Move/rename this experiment">
18+
<i class="bi bi-folder-symlink"></i> Move/Rename
19+
</button>
20+
<button class="btn btn-outline-danger btn-sm delete-experiment-btn" data-folder-path="{{ selected_folder_path }}" title="Delete this experiment">
21+
<i class="bi bi-trash"></i> Delete
22+
</button>
23+
{% else %}
24+
<button class="btn btn-outline-secondary btn-sm" disabled title="Not available in static mode">
25+
<i class="bi bi-folder-symlink"></i> Move/Rename
26+
</button>
27+
<button class="btn btn-outline-secondary btn-sm" disabled title="Not available in static mode">
28+
<i class="bi bi-trash"></i> Delete
29+
</button>
30+
{% endif %}
31+
</div>
32+
</div>
33+
34+
<!-- External Links -->
35+
<div class="storage-item">
36+
<div class="storage-label">
37+
<i class="bi bi-link-45deg"></i> External Links:
38+
</div>
39+
<div class="storage-content">
40+
<!-- S3 Bucket Link -->
41+
{% set s3_path = selected_folder.replace('\\', '/') if selected_folder else '' %}
42+
<a href="https://039984708918-4ppzlrng.us-east-1.console.aws.amazon.com/s3/buckets/codeclash?region=us-east-1&bucketType=general&prefix=logs%2F{{ s3_path | urlencode }}%2F&showversions=false"
43+
target="_blank"
44+
class="btn btn-outline-info btn-sm"
45+
title="View in S3 Bucket">
46+
<i class="bi bi-bucket"></i> S3
47+
</a>
48+
49+
<!-- AWS Job Link (only if AWS metadata exists) -->
50+
{% if metadata.results.aws and metadata.results.aws.AWS_BATCH_JOB_ID %}
51+
<a href="https://039984708918-4ppzlrng.us-east-1.console.aws.amazon.com/batch/home?region=us-east-1#jobs/ec2/detail/{{ metadata.results.aws.AWS_BATCH_JOB_ID }}"
52+
target="_blank"
53+
class="btn btn-outline-success btn-sm"
54+
title="View AWS Batch Job">
55+
<i class="bi bi-gear-wide-connected"></i> AWS Job
56+
</a>
57+
{% endif %}
58+
</div>
59+
</div>
60+
</div>
61+
</section>

codeclash/viewer/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% include 'includes/header.html' %}
1818

1919
<main class="container-fluid main-content">
20-
{% include 'includes/folder_path.html' %}
20+
{% include 'includes/storage.html' %}
2121
{% include 'includes/readme.html' %}
2222
{% include 'includes/setup.html' %}
2323
{% include 'includes/overview.html' %}

0 commit comments

Comments
 (0)