Skip to content

Commit

Permalink
feat: display job environment requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Mar 21, 2024
1 parent 9a6c307 commit a802564
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions frontend/src/pages/jobs/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@
Failed to push package to repo
<br/>
</div>
<div v-if="job.require_min_core !== undefined && job.require_min_core !== null">
Requires worker to have at least {{ job.require_min_core }} logical cores to build this job
<br/>
</div>
<div v-if="job.require_min_total_mem !== undefined && job.require_min_total_mem !== null">
Requires worker to have at least {{ prettyBytes(job.require_min_total_mem, { binary: true }) }} total memory to build this job
<br/>
</div>
<div v-if="job.require_min_total_mem_per_core !== undefined && job.require_min_total_mem_per_core !== null">
Requires worker to have at least {{ prettyBytes(job.require_min_total_mem_per_core, { binary: true }) }} total memory per logical core to build this job
<br/>
</div>
<div v-if="job.require_min_disk !== undefined && job.require_min_disk !== null">
Requires worker to have at least {{ prettyBytes(job.require_min_disk) }} free disk space to build this job
<br/>
</div>
<v-btn
icon="true"
rounded
Expand Down Expand Up @@ -88,6 +104,7 @@
<script lang="ts">
import axios from 'axios';
import { hostname } from '@/common';
import prettyBytes from 'pretty-bytes';
interface JobInfoResponse {
job_id: number;
Expand All @@ -107,6 +124,11 @@
elapsed_secs: number;
assigned_worker_id: number;
built_by_worker_id: number;
require_min_core: number;
require_min_total_mem: number;
require_min_total_mem_per_core: number;
require_min_disk: number;
git_branch: string;
git_sha: string;
github_pr: number;
Expand Down
8 changes: 8 additions & 0 deletions server/src/routes/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ pub struct JobInfoResponse {
elapsed_secs: Option<i64>,
assigned_worker_id: Option<i32>,
built_by_worker_id: Option<i32>,
require_min_core: Option<i32>,
require_min_total_mem: Option<i64>,
require_min_total_mem_per_core: Option<f32>,
require_min_disk: Option<i64>,

// from pipeline
git_branch: String,
Expand Down Expand Up @@ -177,6 +181,10 @@ pub async fn job_info(
elapsed_secs: job.elapsed_secs,
assigned_worker_id: job.assigned_worker_id,
built_by_worker_id: job.built_by_worker_id,
require_min_core: job.require_min_core,
require_min_total_mem: job.require_min_total_mem,
require_min_total_mem_per_core: job.require_min_total_mem_per_core,
require_min_disk: job.require_min_disk,

// from pipeline
git_branch: pipeline.git_branch,
Expand Down

0 comments on commit a802564

Please sign in to comment.