@@ -417,6 +417,8 @@ pub struct BackgroundTaskConfig {
417417 /// configuration for region snapshot replacement finisher task
418418 pub region_snapshot_replacement_finish :
419419 RegionSnapshotReplacementFinishConfig ,
420+ /// configuration for TUF artifact replication task
421+ pub tuf_artifact_replication : TufArtifactReplicationConfig ,
420422}
421423
422424#[ serde_as]
@@ -722,6 +724,17 @@ pub struct RegionSnapshotReplacementFinishConfig {
722724 pub period_secs : Duration ,
723725}
724726
727+ #[ serde_as]
728+ #[ derive( Clone , Debug , Deserialize , Eq , PartialEq , Serialize ) ]
729+ pub struct TufArtifactReplicationConfig {
730+ /// period (in seconds) for periodic activations of this background task
731+ #[ serde_as( as = "DurationSeconds<u64>" ) ]
732+ pub period_secs : Duration ,
733+ /// The number of sleds that artifacts must be present on before a local
734+ /// copy of a repo's artifacts is dropped.
735+ pub min_sled_replication : usize ,
736+ }
737+
725738/// Configuration for a nexus server
726739#[ derive( Clone , Debug , Deserialize , PartialEq , Serialize ) ]
727740pub struct PackageConfig {
@@ -978,6 +991,8 @@ mod test {
978991 region_snapshot_replacement_garbage_collection.period_secs = 30
979992 region_snapshot_replacement_step.period_secs = 30
980993 region_snapshot_replacement_finish.period_secs = 30
994+ tuf_artifact_replication.period_secs = 300
995+ tuf_artifact_replication.min_sled_replication = 3
981996 [default_region_allocation_strategy]
982997 type = "random"
983998 seed = 0
@@ -1174,6 +1189,11 @@ mod test {
11741189 RegionSnapshotReplacementFinishConfig {
11751190 period_secs: Duration :: from_secs( 30 ) ,
11761191 } ,
1192+ tuf_artifact_replication:
1193+ TufArtifactReplicationConfig {
1194+ period_secs: Duration :: from_secs( 300 ) ,
1195+ min_sled_replication: 3 ,
1196+ } ,
11771197 } ,
11781198 default_region_allocation_strategy:
11791199 crate :: nexus_config:: RegionAllocationStrategy :: Random {
@@ -1257,6 +1277,8 @@ mod test {
12571277 region_snapshot_replacement_garbage_collection.period_secs = 30
12581278 region_snapshot_replacement_step.period_secs = 30
12591279 region_snapshot_replacement_finish.period_secs = 30
1280+ tuf_artifact_replication.period_secs = 300
1281+ tuf_artifact_replication.min_sled_replication = 3
12601282 [default_region_allocation_strategy]
12611283 type = "random"
12621284 "## ,
0 commit comments