Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Consolidated layout structure.
local catalog = import '../infra/catalog.libsonnet';
{
reactive:: catalog.reactive,
active:: catalog.active,
// A single-process node serves nothing remotely, so every hosted reactive component is local-only.
localOnly:: catalog.reactive,

// Unused in this layout (no component is remote-served or consumed), kept for the descriptor
// contract; `derive` only dereferences them for remote / remote-enabled components.
ports:: {},
serviceDns:: {},
scale:: {},

services:: {
node: {
runs: catalog.reactive + catalog.active,
uses: [],
},
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Generates the `components` map for the consolidated layout.
local derive = import '../lib/infra/derive.libsonnet';
local consolidated = import '../lib/layouts/consolidated.libsonnet';

{
[service]: derive.infraFor(consolidated, service)
for service in std.objectFields(consolidated.services)
}
11 changes: 11 additions & 0 deletions crates/apollo_deployments/src/deployment_definitions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use strum::IntoEnumIterator;
use tempfile::NamedTempFile;

use crate::deployment_definitions::ComponentConfigInService;
use crate::deployments::consolidated::ConsolidatedNodeServiceName;
use crate::deployments::hybrid::HybridNodeServiceName;
use crate::jsonnet::assert_infra_matches_rust;
use crate::service::NodeType;
Expand All @@ -27,6 +28,16 @@ fn hybrid_infra_matches_rust() {
assert_infra_matches_rust::<HybridNodeServiceName>();
}

/// Verifies the jsonnet consolidated infra config matches the Rust deployment definitions
/// (consolidated.rs).
#[test]
fn consolidated_infra_matches_rust() {
env::set_current_dir(resolve_project_relative_path("").unwrap())
.expect("Couldn't set working dir.");

assert_infra_matches_rust::<ConsolidatedNodeServiceName>();
}

/// Test that the deployment file is up to date.
#[test]
fn deployment_files_are_up_to_date() {
Expand Down
Loading