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

Regular maintenance updates for Linux VMs #1885

Merged
merged 33 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4beb403
Skeleton of sre maintenance component
craddm May 10, 2024
24b1b59
add azure_native maintenance typings
craddm May 10, 2024
d089519
Add standard maintenance configuration for linux vms
craddm May 10, 2024
a2c4a7a
Merge branch 'alan-turing-institute:develop' into maintenance-updates
craddm May 10, 2024
1404417
Correction of comment before SREMaintenanceComp
craddm May 10, 2024
1976928
Change vm patch_mode to work with maintenance config
craddm May 10, 2024
016828d
Merge branch 'alan-turing-institute:develop' into maintenance-updates
craddm May 13, 2024
8084492
Update automatic patch settings on VMs
craddm May 13, 2024
bf32481
Import and deploy maintenance config elements in workspaces
craddm May 13, 2024
8cfd2a1
Assign vm to maintenance configuration during deployment
craddm May 13, 2024
febcc02
output maintenance config id
craddm May 13, 2024
c577a73
No longer deploy maintenance at the SRE level
craddm May 13, 2024
f1ddfc7
rename to component variable to maintenance configuration
craddm May 13, 2024
0306cde
fix linting error
craddm May 13, 2024
1bb26f8
Create maintenance config in workspace RG
craddm May 14, 2024
0028eb4
Merge branch 'alan-turing-institute:develop' into maintenance-updates
craddm May 14, 2024
84099fa
Unique test filename for each workspace
craddm May 14, 2024
c584cde
Remove unneeded imports and variables
craddm May 14, 2024
2d05271
Unique name for each config assignment
craddm May 14, 2024
16b73e9
Use enumerate for vm indices
craddm May 14, 2024
e84fa40
remove unneeded variable
craddm May 14, 2024
b835aff
Remove manual increment of index
craddm May 14, 2024
3cc631c
remove SRE level monitoring component
craddm May 15, 2024
23fc03d
Update data_safe_haven/infrastructure/components/composite/virtual_ma…
JimMadge May 15, 2024
48690ad
Update data_safe_haven/infrastructure/components/composite/virtual_ma…
JimMadge May 15, 2024
7e37269
Update data_safe_haven/infrastructure/components/composite/virtual_ma…
JimMadge May 15, 2024
9513f37
Merge branch 'alan-turing-institute:develop' into maintenance-updates
craddm May 15, 2024
7972a86
Merge branch 'develop' into maintenance-updates
jemrobinson May 16, 2024
791293c
:truck: Move SREMaintenanceComponent creation to declarative_sre.py
jemrobinson May 16, 2024
13f6d98
:sparkles: Add 'iso_minute' option to next_occurrence
jemrobinson May 16, 2024
a1624b0
:wrench: Run maintenance configuration at 02:04 local time
jemrobinson May 16, 2024
fec84cb
:loud_sound: Add comment explaining 03:55 duration
jemrobinson May 16, 2024
c5bb258
:coffin: Removed unused shm-monitoring options passed to SRE
jemrobinson May 16, 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
Prev Previous commit
Next Next commit
🔧 Run maintenance configuration at 02:04 local time
  • Loading branch information
jemrobinson committed May 16, 2024
commit a1624b02739b53dd034c415503f7159741c67feb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def __init__(
)

# Register with maintenance configuration
self.configuration_assignment_resource = maintenance.ConfigurationAssignment(
maintenance.ConfigurationAssignment(
f"{name_underscored}_configurationAssignment",
location=props.location,
maintenance_configuration_id=props.maintenance_configuration_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ def __call__(self) -> None:
SREMaintenanceProps(
location=self.context.location,
resource_group_name=data.resource_group_name,
timezone=self.cfg.shm.timezone,
),
tags=self.tags,
)
Expand Down
15 changes: 13 additions & 2 deletions data_safe_haven/infrastructure/programs/sre/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from pulumi import ComponentResource, Input, Output, ResourceOptions
from pulumi_azure_native import maintenance

from data_safe_haven.functions import next_occurrence


class SREMaintenanceProps:
"""Properties for SREMaintenanceComponent"""
Expand All @@ -13,9 +15,11 @@ def __init__(
self,
location: Input[str],
resource_group_name: Input[str],
timezone: Input[str],
) -> None:
self.location = location
self.resource_group_name = resource_group_name
self.timezone = timezone


class SREMaintenanceComponent(ComponentResource):
Expand Down Expand Up @@ -48,8 +52,15 @@ def __init__(
recur_every="1Day",
resource_group_name=props.resource_group_name,
resource_name_=f"{stack_name}-maintenance-configuration",
start_date_time="2020-04-30 01:00",
time_zone="GMT Standard Time",
start_date_time=Output.from_input(props.timezone).apply(
lambda timezone: next_occurrence(
hour=2,
minute=4,
timezone=timezone,
time_format="iso_minute",
) # Run maintenance at 02:04 local time every night
),
time_zone="UTC", # Our start time is given in UTC
visibility=maintenance.Visibility.CUSTOM,
tags=child_tags,
)
Expand Down
Loading