Skip to content

Commit

Permalink
Merge branch 'skypilot-org:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
asaiacai authored Nov 5, 2024
2 parents 5fd4371 + 47e5151 commit 973b9b2
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sky/clouds/service_catalog/images/aws_utils/image_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def copy_image_and_make_public(target_region):
copy_command = (
f"aws ec2 copy-image --source-region {args.region} "
f"--source-image-id {args.image_id} --region {target_region} "
f"--name 'skypilot-aws-{args.processor}-{args.os_type}-{time.time()}' --output json"
f"--name 'skypilot-aws-{args.processor}-{args.os_type}-{time.strftime('%y%m%d')}' --output json"
)
print(copy_command)
result = subprocess.run(copy_command,
Expand Down
5 changes: 5 additions & 0 deletions sky/clouds/service_catalog/images/provisioners/skypilot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
sudo systemctl stop unattended-upgrades || true
sudo systemctl disable unattended-upgrades || true
sudo sed -i 's/Unattended-Upgrade "1"/Unattended-Upgrade "0"/g' /etc/apt/apt.conf.d/20auto-upgrades || true
sudo systemctl stop apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
sudo systemctl disable apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
sudo systemctl mask apt-daily.service apt-daily-upgrade.service unattended-upgrades.service
sudo systemctl daemon-reload

# Configure dpkg
sudo dpkg --configure --force-overwrite -a

# Apt-get installs
sudo apt-get install jq -y
sudo apt install retry

# Create necessary directories
mkdir -p ~/sky_workdir
Expand Down
3 changes: 3 additions & 0 deletions sky/jobs/dashboard/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ def home():
# Remove filler rows ([''], ..., ['-']).
rows = [row for row in rows if ''.join(map(str, row)) != '']

# Get all unique status values.
status_values = sorted(list(set(row[-5] for row in rows)))
rendered_html = flask.render_template(
'index.html',
columns=columns,
rows=rows,
last_updated_timestamp=timestamp,
status_values=status_values,
)
return rendered_html

Expand Down
43 changes: 38 additions & 5 deletions sky/jobs/dashboard/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@
.clickable {
cursor: pointer; /* This makes the cursor a pointer when hovering over the element */
}

.filter-controls {
display: flex;
gap: 10px;
align-items: center; /* This ensures vertical alignment */
margin-top: 1rem;
position: relative;
z-index: 2;
}

/* Customize the select focus/hover states */
.form-select:focus {
border-color: #dee2e6;
box-shadow: 0 0 0 0.1rem rgba(0,0,0,0.1);
}

</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script
Expand All @@ -54,12 +70,21 @@
<body>
<div class="container">
<header>
<h1>Managed jobs</h1>
<h1>SkyPilot managed jobs</h1>
<p class="text-muted mt-4" id="last-updated"></p>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="refresh-toggle" checked>
<label class="form-check-label" for="refresh-toggle">Auto-refresh (every 30s)</label>
</div>
<div class="filter-controls">
<span class="fw-medium fs-6">Filter by status:</span>
<select class="form-select" id="status-filter" style="width: auto;">
<option value="">All statuses</option>
{% for status in status_values %}
<option value="{{ status }}">{{ status }}</option>
{% endfor %}
</select>
</div>
</header>

<table class="table table-hover table-hover-selected fixed-header-table" id="jobs-table">
Expand Down Expand Up @@ -204,17 +229,25 @@ <h1>Managed jobs</h1>
</script>
<script>
function filterStatus(status) {
var rows = document.querySelectorAll("#spot-jobs-table tbody tr");
rows.forEach(function (row) {
var statusCell = row.querySelector("td:nth-child(9)");
var rows = document.querySelectorAll("#jobs-table tbody tr");
rows.forEach(function(row) {
var statusCell = row.querySelector("td:nth-child(10)"); // Status is in the 10th column
var statusText = statusCell.textContent.trim().split(' ')[0]; // Get first word of status

if (status === '' || statusCell.textContent === status) {
if (status === '' || statusText === status) {
row.style.display = "";
} else {
row.style.display = "none";
}
});
}

// Add event listener for the status filter
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("status-filter").addEventListener("change", function() {
filterStatus(this.value);
});
});
</script>

</body>
Expand Down
9 changes: 9 additions & 0 deletions sky/templates/aws-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ available_node_types:
- path: /etc/apt/apt.conf.d/10cloudinit-disable
content: |
APT::Periodic::Enable "0";
- path: /etc/apt/apt.conf.d/52unattended-upgrades-local
content: |
Unattended-Upgrade::DevRelease "false";
Unattended-Upgrade::Allowed-Origins {};
bootcmd:
- systemctl stop apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
- systemctl disable apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
- systemctl mask apt-daily.service apt-daily-upgrade.service unattended-upgrades.service
- systemctl daemon-reload
TagSpecifications:
- ResourceType: instance
Tags:
Expand Down

0 comments on commit 973b9b2

Please sign in to comment.