Skip to content

Commit a94aa4a

Browse files
MasterPtatoNathanFlurry
authored andcommitted
feat(pegboard): add local image cache and overlay fs mounts
1 parent 5b30dea commit a94aa4a

61 files changed

Lines changed: 1361 additions & 622 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"builds": {
3-
"ws-isolate": {
4-
"script": "src/isolate/main.ts"
5-
},
3+
// "ws-isolate": {
4+
// "script": "src/isolate/main.ts"
5+
// },
66
"ws-container": {
7-
"dockerfile": "Dockerfile"
7+
"dockerfile": "Dockerfile",
8+
// "unstable": {
9+
// "compression": "none"
10+
// }
811
}
912
}
1013
}

packages/common/chirp-workflow/core/src/db/fdb_sqlite_nats/debug.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ use std::{
1515
use tracing::Instrument;
1616
use uuid::Uuid;
1717

18-
use super::{
19-
keys,
20-
sqlite::SqlStub,
21-
DatabaseFdbSqliteNats,
22-
};
18+
use super::{keys, sqlite::SqlStub, DatabaseFdbSqliteNats};
2319
use crate::{
2420
db::debug::{
2521
ActivityError, ActivityEvent, DatabaseDebug, Event, EventData, HistoryData, LoopEvent,

packages/common/chirp-workflow/core/src/db/fdb_sqlite_nats/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,10 @@ impl Database for DatabaseFdbSqliteNats {
12771277
async move {
12781278
let pool = &self
12791279
.pools
1280-
.sqlite(crate::db::sqlite_db_name_internal(partial.workflow_id), false)
1280+
.sqlite(
1281+
crate::db::sqlite_db_name_internal(partial.workflow_id),
1282+
false,
1283+
)
12811284
.await?;
12821285

12831286
// Handle error during sqlite init

packages/common/pools/src/db/sqlite/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,7 @@ impl SqlitePoolInner {
907907

908908
#[tracing::instrument(name = "sqlite_pool_evict", skip_all)]
909909
pub async fn evict(&self) -> GlobalResult<()> {
910-
self
911-
.manager
910+
self.manager
912911
.evict_with_key(&[self.key_packed.clone()])
913912
.await
914913
}

packages/core/api/actor/src/route/builds.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,7 @@ pub async fn complete_build(
520520
edge_intercom_pegboard_prewarm_image(
521521
&config,
522522
&build_id.to_string(),
523-
models::EdgeIntercomPegboardPrewarmImageRequest {
524-
image_artifact_url_stub: pegboard::util::image_artifact_url_stub(
525-
ctx.config(),
526-
build.upload_id,
527-
&build::utils::file_name(build.kind, build.compression),
528-
)?,
529-
},
523+
json!({}),
530524
)
531525
.await
532526
.map_err(Into::<GlobalError>::into)
@@ -542,10 +536,11 @@ pub async fn complete_build(
542536
}
543537
}
544538

545-
// Error only if all prewarm requests failed
546-
if !results.is_empty() && results.iter().all(|res| res.is_err()) {
547-
return Err(unwrap!(unwrap!(results.into_iter().next()).err()));
548-
}
539+
// TODO: Disabled until deploy
540+
// // Error only if all prewarm requests failed
541+
// if !results.is_empty() && results.iter().all(|res| res.is_err()) {
542+
// return Err(unwrap!(unwrap!(results.into_iter().next()).err()));
543+
// }
549544
}
550545

551546
Ok(json!({}))

packages/core/services/cluster/src/workflows/server/install/install_scripts/files/pegboard_configure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ ExecStart=/usr/local/bin/rivet-client -c /etc/rivet-client/config.json
353353
Restart=always
354354
RestartSec=2
355355
356+
# High scheduling priority
357+
Nice=-15
356358
# Real time service
357359
CPUSchedulingPolicy=fifo
358360
# High CPU priority

packages/core/services/cluster/src/workflows/server/install/install_scripts/files/rivet_guard_configure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ExecStart=/usr/local/bin/rivet-guard
2626
Restart=always
2727
RestartSec=2
2828
29+
# High scheduling priority
30+
Nice=-15
2931
# Real time service
3032
CPUSchedulingPolicy=fifo
3133
# High CPU priority

packages/core/services/cluster/src/workflows/server/install/install_scripts/files/rivet_worker_configure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ ExecStart=/usr/local/bin/rivet-edge-server start --skip-provision
2828
Restart=always
2929
RestartSec=2
3030
31+
# High scheduling priority
32+
Nice=-15
3133
# Real time service
3234
CPUSchedulingPolicy=fifo
3335
# High CPU priority

packages/edge/api/intercom/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rivet-env.workspace = true
2626
rivet-health-checks.workspace = true
2727
rivet-operation.workspace = true
2828
rivet-pools.workspace = true
29+
s3-util.workspace = true
2930
serde = { version = "1.0", features = ["derive"] }
3031
serde_json = "1.0"
3132
thiserror = "1.0"
@@ -35,4 +36,6 @@ tracing-subscriber = { version = "0.3", default-features = false, features = ["f
3536
url = "2.2.2"
3637
uuid = { version = "1", features = ["v4"] }
3738

39+
build.workspace = true
40+
cluster.workspace = true
3841
pegboard.workspace = true

packages/edge/api/intercom/src/route/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ define_router! {
1212
POST: pegboard::prewarm_image(
1313
internal_endpoint: true,
1414
opt_auth: true,
15-
body: models::EdgeIntercomPegboardPrewarmImageRequest,
15+
body: serde_json::Value,
1616
),
1717
},
1818

0 commit comments

Comments
 (0)