Skip to content

Commit

Permalink
Merge branch 'master' into rsc-recover-from-missing-blob
Browse files Browse the repository at this point in the history
  • Loading branch information
V-FEXrt authored Aug 13, 2024
2 parents 5932bdd + 14c93d0 commit 722ccaa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ jobs:
test_cmd: rpm -i x86_64/*.rpm && cd tests && wake runTests
install_src_glob: build/x86_64/*.rpm

- target: vscode
dockerfile: wasm
extra_docker_build_args: ''
extra_docker_run_args: -u build
build_cmd: make -C wake-* vscode
test_cmd: ls # no-op
install_src_glob: build/wake-*/extensions/vscode/wake-*.vsix
# - target: vscode
# dockerfile: wasm
# extra_docker_build_args: ''
# extra_docker_run_args: -u build
# build_cmd: make -C wake-* vscode
# test_cmd: ls # no-op
# install_src_glob: build/wake-*/extensions/vscode/wake-*.vsix

# Two confounding bugs are breaking the latest emsdk build. We can't really work around them
# so for now, disable the latest target and track them closely.
Expand Down Expand Up @@ -282,11 +282,11 @@ jobs:
name: tarball
path: tarball

- name: Download VSCode
uses: actions/download-artifact@v3
with:
name: release_vscode
path: vscode
# - name: Download VSCode
# uses: actions/download-artifact@v3
# with:
# name: release_vscode
# path: vscode

# We don't actually release/upload wake_static. Wake is unsupported on old versions
# of alpine, and releasing a "wake_static" artifact is very misleading and prone to
Expand Down Expand Up @@ -345,7 +345,6 @@ jobs:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
files: |
tarball/wake_*.tar.xz
vscode/wake-*.vsix
rocky_8-wake-*-1.x86_64.rpm
rocky_9-wake-*-1.x86_64.rpm
debian-bullseye-wake_*-1_amd64.deb
Expand Down
3 changes: 2 additions & 1 deletion rust/rsc/.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"load_shed": {
"tick_rate": 30,
"target": 16.0
"target": 16.0,
"min_runtime": 0.1
}
}
2 changes: 2 additions & 0 deletions rust/rsc/src/bin/rsc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ pub struct RSCLoadShedConfig {
pub tick_rate: u64,
// Load value after which load should be statistically shed
pub target: f64,
// The minimum amount of time a job must take to complete in order to be cached
pub min_runtime: f64,
}

#[derive(Debug, Deserialize, Serialize)]
Expand Down
4 changes: 3 additions & 1 deletion rust/rsc/src/bin/rsc/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ fn create_router(
post({
let conn = conn.clone();
let target = config.load_shed.target.clone();
move |body| read_job::allow_job(body, conn, target, system_load)
let min_runtime = config.load_shed.min_runtime.clone();
move |body| read_job::allow_job(body, conn, target, system_load, min_runtime)
})
.layer(DefaultBodyLimit::disable()),
)
Expand Down Expand Up @@ -497,6 +498,7 @@ mod tests {
load_shed: config::RSCLoadShedConfig {
tick_rate: 10,
target: 10.0,
min_runtime: 0.5,
},
}
}
Expand Down
3 changes: 2 additions & 1 deletion rust/rsc/src/bin/rsc/read_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ pub async fn allow_job(
conn: Arc<DatabaseConnection>,
target_load: f64,
system_load: Arc<RwLock<f64>>,
min_runtime: f64,
) -> StatusCode {
// Reject a subset of jobs that are never worth caching
if payload.runtime < 0.1 {
if payload.runtime < min_runtime {
return StatusCode::NOT_ACCEPTABLE;
}

Expand Down

0 comments on commit 722ccaa

Please sign in to comment.