Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workload config implementation #389

Merged
merged 75 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5dbf096
Small draft code to try out handlebars
inf17101 Oct 1, 2024
ad62212
Write design decision for handlebars
inf17101 Oct 2, 2024
260b813
Add first swdds and first draft implementation
inf17101 Oct 2, 2024
0eed241
Fix reference and swdd tags
inf17101 Oct 7, 2024
a0a7f1e
Add swdd for config renderer
inf17101 Oct 7, 2024
75e63b5
Update rendered workloads only when state is updated
inf17101 Oct 7, 2024
6841368
Implement update logic of expanded workloads
inf17101 Oct 7, 2024
ab38bfd
Rename workload variables
inf17101 Oct 8, 2024
44c072a
Skip rendering on no config assignment and introduce error type
inf17101 Oct 8, 2024
f3a6c54
Fix update of config item only
inf17101 Oct 8, 2024
9be64e1
Remove in-place allocation of ConfigRenderer
inf17101 Oct 8, 2024
36daf58
Add comment
inf17101 Oct 8, 2024
f040eb8
Fix server state utests
inf17101 Oct 9, 2024
9d84050
Add config renderer utests
inf17101 Oct 9, 2024
3bc5aee
Add update of configs utest and swdd
inf17101 Oct 10, 2024
d2565b1
Add configs update utests for server state
inf17101 Oct 10, 2024
77b8e9e
Rename update_state method
inf17101 Oct 10, 2024
033a6d3
Ignore configs for agent name handling in ank apply
inf17101 Oct 10, 2024
2bc1683
Fix linkage in utest
inf17101 Oct 10, 2024
667a60e
Add completions for configs in object field mask
windsource Oct 11, 2024
680ed15
Improve log output in ank cli
inf17101 Oct 11, 2024
dbc861a
Update only desiredState
inf17101 Oct 14, 2024
40831f1
Refactor set_state function and update plantuml
inf17101 Oct 14, 2024
f681910
Write swdd for comparing rendered workloads
inf17101 Oct 14, 2024
258dd16
Split state format rendering
inf17101 Oct 15, 2024
50e827b
Fix wrong dependencies workload names in test data
inf17101 Oct 15, 2024
afeab25
Extract to constant var
inf17101 Oct 15, 2024
fc7c502
Remove not needed references
inf17101 Oct 15, 2024
b44a99c
First basic system test
inf17101 Oct 16, 2024
9127888
Rename stest file
inf17101 Oct 17, 2024
3421e64
Merge main branch into branch
inf17101 Oct 17, 2024
4c316db
Remove notes file
inf17101 Oct 17, 2024
bedb10c
Make utest more strict
inf17101 Oct 17, 2024
bc8b75a
Add more stests and link them
inf17101 Oct 17, 2024
50a9adc
Add utests for config key and alias validation
inf17101 Oct 17, 2024
809e82c
Add config key format stest
inf17101 Oct 17, 2024
0459443
Add stests for workload config refs and fix linkage
inf17101 Oct 18, 2024
71ef573
Add utests for ank apply
inf17101 Oct 18, 2024
3b8a2d7
Remove duplicated utest
inf17101 Oct 18, 2024
d0f58a6
Adapt working with complete state section
inf17101 Oct 21, 2024
30d456c
Disable wait in utest
inf17101 Oct 21, 2024
8fbcdff
Merge branch 'main' into 267_workload_config_impl
inf17101 Oct 21, 2024
fce3cd5
Merge main into branch and fix utest
inf17101 Oct 21, 2024
b25265c
Get rid of conversion in utest
inf17101 Oct 21, 2024
a177510
Adapt quickstart doc
inf17101 Oct 21, 2024
b39e151
Adapt startup-configuration user doc
inf17101 Oct 21, 2024
8c31e21
Extend user tutorial with configs
inf17101 Oct 21, 2024
2ec4009
Add update and delete config user doc
inf17101 Oct 22, 2024
0c9da86
Add comment about unrendered get complete state
inf17101 Oct 22, 2024
e04125d
Merge branch 'main' into 267_workload_config_impl
inf17101 Oct 24, 2024
e3af0e0
Fix rust contol interface example
inf17101 Oct 24, 2024
cca26b0
Add utest linkage
inf17101 Oct 25, 2024
59ae81d
Add linkage to utest for config rendering
inf17101 Oct 25, 2024
39faca4
Fix missing swdd prefix in linkage
inf17101 Oct 25, 2024
92c3eec
Merge branch 'main' into 267_workload_config_impl
inf17101 Oct 28, 2024
c09e0d3
Wording in comment
inf17101 Oct 29, 2024
f08de11
Rename api_format method
inf17101 Oct 29, 2024
2d3d9c6
Fix naming convention swdd rationale
inf17101 Oct 29, 2024
16f5cb3
Change swdd for selecting workloads for agents
inf17101 Oct 29, 2024
2c35a9a
Add newline to swdd rationale
inf17101 Oct 29, 2024
0d1ea19
Rename utest
inf17101 Oct 29, 2024
80809ca
Use mockall double for import
inf17101 Oct 29, 2024
56c836a
Output error message
inf17101 Oct 29, 2024
502d503
Space in utest linkage
inf17101 Oct 29, 2024
2d7e7e3
Change comment in utest
inf17101 Oct 29, 2024
ac2c661
Fix comment in stest documentation
inf17101 Oct 29, 2024
ece6d1f
Fix comments for precondition
inf17101 Oct 29, 2024
b5b4843
Remove config_key from workload config map and insert utest
inf17101 Oct 29, 2024
3a59722
Throw specific error upon not existing config key
inf17101 Oct 29, 2024
7b4d7c5
Adapt doc agent field description
inf17101 Oct 29, 2024
6a3d7bb
Change linkage to sub chapter
inf17101 Oct 29, 2024
a7243ed
Remove plurar
inf17101 Oct 29, 2024
38a8eec
Rename update state file in stest
inf17101 Oct 29, 2024
c28f01f
Merge branch 'main' into 267_workload_config_impl
inf17101 Oct 29, 2024
8297098
Revert to normal yaml string
inf17101 Oct 29, 2024
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
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"protobuf",
"Substate",
"swdd",
"templating",
"unrendered",
"utest",
"VecDeque"
],
Expand Down
66 changes: 66 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::path::Path;
use crate::control_interface::Directory;
use crate::control_interface::FileSystemError;
use clap::Parser;
use common::objects::state::STR_RE_AGENT;
use common::objects::STR_RE_AGENT;
use common::DEFAULT_SERVER_ADDRESS;

const DEFAULT_RUN_FOLDER: &str = "/tmp/ankaios/";
Expand Down
4 changes: 2 additions & 2 deletions agent/src/runtime_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2054,11 +2054,11 @@ mod tests {
dependencies: Some(ank_base::Dependencies {
dependencies: HashMap::from([
(
"workload A".to_string(),
"workload_A".to_string(),
AddCondition::AddCondRunning as i32,
),
(
"workload C".to_string(),
"workload_C".to_string(),
AddCondition::AddCondSucceeded as i32,
),
]),
Expand Down
7 changes: 7 additions & 0 deletions ank/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ fn workload_completer(current: &OsStr) -> Vec<CompletionCandidate> {
fn completions_object_field_mask(state: Vec<u8>, current: &OsStr) -> Vec<CompletionCandidate> {
const DESIRED_STATE: &str = "desiredState";
const WORKLOADS: &str = "workloads";
const CONFIGS: &str = "configs";
const WORKLOAD_STATES: &str = "workloadStates";

let mut result = Vec::new();
Expand All @@ -79,6 +80,12 @@ fn completions_object_field_mask(state: Vec<u8>, current: &OsStr) -> Vec<Complet
result.push(format!("{}.{}.{}", DESIRED_STATE, WORKLOADS, workload_name));
}
}
if let Some(configs) = desired_state.configs {
result.push(format!("{}.{}", DESIRED_STATE, CONFIGS));
for config_name in configs.keys() {
result.push(format!("{}.{}.{}", DESIRED_STATE, CONFIGS, config_name));
}
}
}

if let Some(workload_states) = state.workload_states {
Expand Down
2 changes: 1 addition & 1 deletion ank/src/cli_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl CliCommands {
changed_workloads.extend(update_state_success.deleted_workloads.iter().cloned());

if changed_workloads.is_empty() {
output!("No workloads to update");
output!("Apply successful. No workloads updated.");
return Ok(());
} else {
output!("Successfully applied the manifest(s).\nWaiting for workload(s) to reach desired states (press Ctrl+C to interrupt).\n");
Expand Down
Loading