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

Node Stages and Dependency Manager #1759

Merged
merged 49 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6e571fc
execiute post deploy in the scheduleNode goroutine
steiler Nov 23, 2023
e4b8760
added runtime.GetContainerHealth() and extended WaitFor struct
steiler Nov 24, 2023
5a7c774
update
steiler Nov 28, 2023
6a8b52d
upgrade gomock from depricated google codebase to uber fork
steiler Nov 28, 2023
9a1f525
dependency working
steiler Nov 29, 2023
a0d3916
add comment
steiler Nov 29, 2023
d440ab0
make waitfor healt work
steiler Nov 30, 2023
aef93f3
DependencyManger: introduce exit state dependency, allowing for e.g. …
steiler Nov 30, 2023
2720009
fix test
steiler Nov 30, 2023
10fe6a4
properly wait for all links in create-links
steiler Nov 30, 2023
2a88b38
fix test
steiler Nov 30, 2023
4adf6d6
relocate UpdateConfigWithRuntimeInfo to populate MgmtIP before PostDe…
steiler Nov 30, 2023
22bd11a
new stages struct as @hellt suggested
steiler Nov 30, 2023
1b99394
adjust test
steiler Nov 30, 2023
6636e16
dependencymanager: stabelize string output order
steiler Nov 30, 2023
b045cbd
make the DM a field in CLab with a WithDependencymanager Option
steiler Dec 1, 2023
6c00985
exec from topology as part of node schedule
steiler Dec 1, 2023
33a23fc
fixed mgmt-ipv4 for cert test
steiler Dec 28, 2023
6587acb
execcollection: introduce mutex
steiler Jan 8, 2024
23f8638
please deepsource
steiler Jan 8, 2024
f9de1cd
Stages: Seperate Structs per Stage
steiler Jan 23, 2024
b4b2678
added stages comments
hellt Jan 24, 2024
0a2bc36
waitfor comment
hellt Jan 24, 2024
c1f9f14
node_definition and config to provide stages instead of WaitFor
steiler Feb 5, 2024
f513127
fix tests
steiler Feb 5, 2024
3cbd2a8
make format
hellt Feb 8, 2024
e00fd64
move stages to its own file
hellt Feb 8, 2024
c07c624
WaitForList comments
hellt Feb 8, 2024
45870f2
added unit tests for Equals and Merge for stages
hellt Feb 8, 2024
41797ef
comments for merge function
hellt Feb 9, 2024
15110d3
move waitfor phase name to stages
hellt Feb 9, 2024
e06858b
swap global var for a func
hellt Feb 9, 2024
52d784b
short import path for dep mgr
hellt Feb 9, 2024
a623f8b
address @hellt comments
steiler Feb 9, 2024
ff9a458
use dependency phases instead of dependency state to align with the type
hellt Feb 9, 2024
f0a3808
use Phase in the WaitFor state for consistency with the type
hellt Feb 10, 2024
0332ffa
use EnterPhase
hellt Feb 10, 2024
583d3b6
enter the creation phase in the worker func to keep it consistent
hellt Feb 10, 2024
260cc3c
added stages base test
hellt Feb 11, 2024
40820bf
added test condition for the healthy wait for
hellt Feb 11, 2024
908723b
added schema
hellt Feb 11, 2024
aae9af7
swap phase->stage to keep consistent naming
hellt Feb 11, 2024
14d880b
rename Barrier to WG
hellt Feb 11, 2024
580e852
remove extra layer of indirection with calling Enter and Done methods…
hellt Feb 11, 2024
ad17d07
reverting entering the wait stage in the worker func
hellt Feb 12, 2024
e376758
Merge branch 'main' into postdeployrelocate
hellt Feb 12, 2024
fd53fd8
DMNode: DependencyCount -> MustWait
steiler Feb 12, 2024
d4ed2ec
add node.IsHealthy and node.GetContainerStatus
steiler Feb 12, 2024
6dad097
use MustWait on node level
hellt Feb 12, 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: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ robot-test: build-debug
MOCKDIR = ./mocks
.PHONY: mocks-gen
mocks-gen: mocks-rm ## Generate mocks for all the defined interfaces.
go install github.com/golang/mock/mockgen@v1.6.0
go install go.uber.org/mock/mockgen@latest
mockgen -package=mocknodes -source=nodes/node.go -destination=$(MOCKDIR)/mocknodes/node.go
mockgen -package=mocks -source=clab/dependency_manager/dependency_manager.go -destination=$(MOCKDIR)/dependency_manager.go
mockgen -package=mockruntime -source=runtime/runtime.go -destination=$(MOCKDIR)/mockruntime/runtime.go
Expand Down
51 changes: 46 additions & 5 deletions border0_api/border0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/h2non/gock"
"github.com/srl-labs/containerlab/mocks/mocknodes"
"github.com/srl-labs/containerlab/nodes"
"github.com/srl-labs/containerlab/types"
"go.uber.org/mock/gomock"
)

func TestLogin(t *testing.T) {
Expand Down Expand Up @@ -226,7 +226,18 @@ func getNodeMap(mockCtrl *gomock.Controller) map[string]nodes.Node {
&types.NodeConfig{
Image: "alpine:3",
ShortName: "node2",
WaitFor: []string{"node1"},
Stages: &types.Stages{
Configure: &types.StageConfigure{
StageBase: types.StageBase{
WaitFor: types.WaitForList{
&types.WaitFor{
Node: "node1",
State: types.WaitForCreate,
},
},
},
},
},
Publish: []string{
"tls/22",
"tls/23/myfunnypolicy",
Expand All @@ -242,8 +253,23 @@ func getNodeMap(mockCtrl *gomock.Controller) map[string]nodes.Node {
Image: "alpine:3",
NetworkMode: "container:node2",
ShortName: "node3",
WaitFor: []string{"node1", "node2"},
LongName: "clab-TestTopo-node3",
Stages: &types.Stages{
Configure: &types.StageConfigure{
StageBase: types.StageBase{
WaitFor: types.WaitForList{
&types.WaitFor{
Node: "node1",
State: types.WaitForCreate,
},
&types.WaitFor{
Node: "node2",
State: types.WaitForCreate,
},
},
},
},
},
LongName: "clab-TestTopo-node3",
},
).AnyTimes()

Expand All @@ -265,7 +291,22 @@ func getNodeMap(mockCtrl *gomock.Controller) map[string]nodes.Node {
Image: "alpine:3",
MgmtIPv4Address: "172.10.10.2",
ShortName: "node5",
WaitFor: []string{"node3", "node4"},
Stages: &types.Stages{
Configure: &types.StageConfigure{
StageBase: types.StageBase{
WaitFor: types.WaitForList{
&types.WaitFor{
Node: "node3",
State: types.WaitForCreate,
},
&types.WaitFor{
Node: "node4",
State: types.WaitForCreate,
},
},
},
},
},
Publish: []string{
"tls/22",
"tls/25/test,additionalpolicy",
Expand Down
Loading
Loading