Skip to content

Commit 1d6b4f1

Browse files
authored
changes to support the biweekly update from master (#409)
* changes to support the biweekly update from master. CA enabled switch is now in the CS yaml config file, not in the topology anymore. Updated test data. * data migration supporting the biweekly update from master. Bump the version of those hosts that run the Control Service of Core ASes. They need to get new configuration from the Coordinator, due to a change in how the CA type is specified.
1 parent bddfcc9 commit 1d6b4f1

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 3.1.6 on 2022-01-27 14:35
2+
3+
from django.db import migrations
4+
5+
from scionlab.models.core import Host, Service
6+
7+
8+
def bump_version(apps, schema_editor):
9+
"""
10+
Data migration: bump the version of those hosts that run
11+
the Control Service of Core ASes.
12+
They need to get new configuration from the Coordinator, due to a change in how the
13+
CA type is specified.
14+
"""
15+
Host.objects.bump_config(services__type=Service.CS, AS__is_core=True)
16+
17+
18+
class Migration(migrations.Migration):
19+
20+
dependencies = [
21+
('scionlab', '0005_trc_pem'),
22+
]
23+
24+
operations = [
25+
migrations.RunPython(bump_version, # forward
26+
lambda a, b: None), # backward
27+
]

scionlab/models/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,12 @@ def create(self, uid=None, secret=None, **kwargs):
447447
**kwargs
448448
)
449449

450-
def bump_config(self):
450+
def bump_config(self, **filter_args):
451451
"""
452452
Increment the config version counter, i.e. set `needs_config_deployement` to True.
453+
If filter_args is not empty, only the subset of those filters will be bumped.
453454
"""
454-
self.update(config_version=F('config_version') + 1)
455+
self.filter(**filter_args).update(config_version=F('config_version') + 1)
455456

456457
def reset_needs_config_deployment(self):
457458
"""

scionlab/scion/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ def build_cs_conf(self, service):
316316
'address': _join_host_port(service.host.internal_ip, CS_QUIC_PORT),
317317
},
318318
})
319+
if service.AS.is_core:
320+
conf.update({
321+
'ca': {
322+
'mode': 'in-process',
323+
},
324+
})
319325

320326
return conf
321327

scionlab/tests/data/test_config_tar/host_1.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ etc/scion/cs-1.toml: |
495495
origination_interval = "60s"
496496
propagation_interval = "60s"
497497
498+
[ca]
499+
mode = "in-process"
500+
498501
[general]
499502
config_dir = "/etc/scion"
500503
id = "cs-1"
@@ -600,7 +603,7 @@ scionlab-config.json: |-
600603
"etc/scion/crypto/voting/ISD17-ASffaa_0_1101.sensitive.crt": "131ec8597fbf56d7f65c9bba48874c5cd64c157a",
601604
"etc/scion/crypto/voting/regular-voting.key": "48fd836d8c4f7a3cb2bec2045d03a46c2ca99337",
602605
"etc/scion/crypto/voting/sensitive-voting.key": "0ca15a73e4d864f32228f4687f29505ac093dbfc",
603-
"etc/scion/cs-1.toml": "47ad2499da3f424ae2e5632598f002efee1119c5",
606+
"etc/scion/cs-1.toml": "9aa4d5460b518ac50caac845f9e70f1b7918f589",
604607
"etc/scion/keys/master0.key": "9a91ea3b0c0121326d29224de5d444a31c74ef20",
605608
"etc/scion/keys/master1.key": "9a91ea3b0c0121326d29224de5d444a31c74ef20",
606609
"etc/scion/topology.json": "c1afb4da9e309ca7a1c697cb0238e41fc84ae96b"

0 commit comments

Comments
 (0)