Skip to content

Commit

Permalink
Pull new base image from GHCR (#6390)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyashton authored Jul 25, 2024
1 parent b5e9bb7 commit bc1d75e
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .azure-pipelines-templates/daily-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
- checkout: self
clean: true
fetchDepth: 10000
- script: |
sudo rm -rf build
displayName: "Cleanup"
- script: |
set -ex
mkdir build_make
Expand Down
3 changes: 3 additions & 0 deletions .azure-pipelines-templates/deploy_aci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- script: |
set -ex
az acr login --name $ACR_REGISTRY_RESOURCE_NAME
python3.8 -m venv ./scripts/azure_deployment/.env
source ./scripts/azure_deployment/.env/bin/activate
pip install -r ./scripts/azure_deployment/requirements.txt
Expand All @@ -64,6 +65,7 @@ jobs:
--aci-type dynamic-agent \
--deployment-name ci-$(Build.BuildNumber) \
--aci-image ccfmsrc.azurecr.io/ccf/ci:pr-`git rev-parse HEAD` \
--managed-identity $(CCF_SNP_CI_MANAGED_IDENTITY_ID)
--ports 22 \
--aci-setup-timeout 300 \
--aci-private-key-b64 $(sshKey) \
Expand All @@ -75,6 +77,7 @@ jobs:
name: deploy_primary_aci
displayName: "Deploy Primary ACI"
env:
ACR_REGISTRY_RESOURCE_NAME: ccfmsrc
CCF_AZURE_SUBSCRIPTION_ID: $(CCF_AZURE_SUBSCRIPTION_ID)
- script: |
Expand Down
2 changes: 1 addition & 1 deletion .azure_pipelines_snp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-06-26-virtual-clang15
image: ghcr.io/microsoft/ccf/ci/default:build-25-07-2024
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-06-26-virtual-clang15
image: ghcr.io/microsoft/ccf/ci/default:build-25-07-2024
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE

- container: snp
image: ccfmsrc.azurecr.io/ccf/ci:2024-06-26-snp-clang15
image: ghcr.io/microsoft/ccf/ci/default:build-25-07-2024
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-06-26-sgx
image: ghcr.io/microsoft/ccf/ci/sgx:build-25-07-2024
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .multi-thread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pr:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-06-26-virtual-clang15
image: ghcr.io/microsoft/ccf/ci/default:build-25-07-2024
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

jobs:
Expand Down
13 changes: 13 additions & 0 deletions scripts/azure_deployment/arm_aci.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from argparse import ArgumentParser, Namespace
import base64
import tempfile
import urllib.parse

from azure.identity import AzureCliCredential
from azure.mgmt.resource.resources.models import (
Expand Down Expand Up @@ -253,6 +254,12 @@ def make_aci_deployment(args: Namespace) -> Deployment:
"initContainers": [],
"restartPolicy": "Never",
"osType": "Linux",
"imageRegistryCredentials": [
{
"server": urllib.parse.urlparse(f"//{args.aci_image}").netloc,
"identity": args.managed_identity,
}
],
}

if args.ports:
Expand Down Expand Up @@ -308,6 +315,12 @@ def make_aci_deployment(args: Namespace) -> Deployment:
"name": f"{deployment_name}-{i}",
"location": args.region,
"properties": container_group_properties,
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
args.managed_identity: {},
},
},
}

arm_template["resources"].append(container_group)
Expand Down
5 changes: 5 additions & 0 deletions scripts/azure_deployment/arm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
type=lambda in_str: str(in_str).replace(".", ""),
)

parser.add_argument(
"--managed-identity",
help="The managed identity on the host that you want the ACI to inherit, so it can access its container registries",
)

parser.add_argument(
"--out",
help="Location to write the deployment info to",
Expand Down

0 comments on commit bc1d75e

Please sign in to comment.