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 replication regions to Azure job #64

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 5 additions & 5 deletions .github/workflows/build_gcp_azure_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
PKR_VAR_gallery_resource_group: rg-worker_images-public-westeurope
PKR_VAR_gallery_name: spacelift_worker_images_public
PKR_VAR_gallery_image_name: spacelift_worker_image
PKR_VAR_gallery_replication_regions: '["westeurope"]'
PKR_VAR_gallery_replication_regions: '["westeurope", "northeurope", "northcentralus", "eastus", "eastus2", "westus2", "westus3"]'
peterdeme marked this conversation as resolved.
Show resolved Hide resolved
PKR_VAR_gallery_image_version: 1.0.${{ github.run_number }}

steps:
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:

console.log("## Azure");
console.log("");
console.log(`- Publisher | \`spaceliftinc1625499025476\`.`);
console.log(`- Offer | \`spacelift_worker\`.`);
console.log(`- SKU | \`ubuntu_20_04\`.`);
console.log(`- Version | \`1.0.${process.env.RUN_NUMBER}\`.`);
console.log(`- Community Gallery Name | \`spacelift-40913cda-9bf9-4bcb-bf90-78fd83f30079\``);
console.log(`- Image name | \`spacelift_worker_image\``);
console.log(`- Version | \`1.0.${process.env.RUN_NUMBER}\``);
console.log(`- Resource ID | \`/CommunityGalleries/spacelift-40913cda-9bf9-4bcb-bf90-78fd83f30079/Images/spacelift_worker_image/Versions/1.0.${process.env.RUN_NUMBER}\``);
console.log("");
console.log("## Google Cloud Platform");
console.log("");
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
PKR_VAR_gallery_resource_group: rg-worker_images-public-westeurope
PKR_VAR_gallery_name: spacelift_worker_images_public
PKR_VAR_gallery_image_name: spacelift_worker_image
PKR_VAR_gallery_replication_regions: '["westeurope"]'
PKR_VAR_gallery_replication_regions: '["westeurope", "northeurope", "northcentralus", "eastus", "eastus2", "westus2", "westus3"]'
PKR_VAR_gallery_image_version: 1.0.${{ github.run_number }}

steps:
Expand Down
13 changes: 12 additions & 1 deletion azure.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ source "azure-arm" "spacelift" {
gallery_name = var.gallery_name
image_name = var.gallery_image_name
image_version = var.gallery_image_version
replication_regions = var.gallery_replication_regions

dynamic target_region {
for_each = var.gallery_replication_regions

content {
name = target_region.value
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A target region to store the image version in. The attribute supersedes replication_regions which is now considered deprecated. One or more target_region blocks can be specified for storing an imager version to various regions. In addition to specifying a region, a DiskEncryptionSetId can be specified for each target region to support multi-region disk encryption. At a minimum their must be one target region entry for the primary build region where the image version will be stored. Target region must only contain one entry matching the build region when using shallow replication.

}

os_type = "Linux"
Expand Down Expand Up @@ -151,6 +158,10 @@ build {
"shared/scripts/apt-install-jq.sh",
"azure/scripts/azure-cli.sh",
]

env = {
DEBIAN_FRONTEND = "noninteractive"
}
}

# Deprovision VM
Expand Down
4 changes: 4 additions & 0 deletions gcp.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ build {
"shared/scripts/gvisor.sh",
"shared/scripts/apt-install-jq.sh",
]

env = {
DEBIAN_FRONTEND = "noninteractive"
peterdeme marked this conversation as resolved.
Show resolved Hide resolved
}
}

post-processor "manifest" {
Expand Down