From f5818a014308ab7a6b59fc1d37de716d0ce38060 Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Tue, 4 Feb 2025 16:54:37 +0000 Subject: [PATCH 1/6] WIP try CI --- .snpcc_canary | 20 +++++++++++++++++++- docker/ccf_ci_built | 10 +++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.snpcc_canary b/.snpcc_canary index bc1c6f559e2..c92fcf49879 100644 --- a/.snpcc_canary +++ b/.snpcc_canary @@ -4,4 +4,22 @@ /-xXx--//-----x=x--/-xXx--/---x---->>>--/ ... /\/\d(-_-)b/\/\ -----vmpl--- \ No newline at end of file +----vmpl--- + + ,~. + ,-'__ `-, + {,-' `. } ,') + ,( a ) `-.__ ,',')~, + <=.) ( `-.__,==' ' ' '} + ( ) /) + `-'\ , ) + | \ `~. / + \ `._ \ / + \ `._____,' ,' + `-. ,' + `-._ _,-' + 77jj' + //_|| + __//--'/` hjw + ,--'/` ' + ' diff --git a/docker/ccf_ci_built b/docker/ccf_ci_built index 254431d9bee..0224c5a644a 100644 --- a/docker/ccf_ci_built +++ b/docker/ccf_ci_built @@ -3,13 +3,13 @@ # Also contains CCF source and build directory # Latest image as of this change -ARG base=ghcr.io/microsoft/ccf/ci/default:build-14-01-2025 +ARG base=mcr.microsoft.com/azurelinux/base/core:3.0 FROM ${base} # SSH. Note that this could (should) be done in the base ccf_ci image instead # if we wanted to build this image faster -RUN apt update \ - && apt install -y openssh-server \ +RUN tdnf -y update \ + && tdnf -y install openssh-server \ && sed -i "s/.*PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config \ && sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config \ && mkdir -p /run/sshd # To avoid "Missing privilege separation directory: /run/sshd" error @@ -24,6 +24,10 @@ RUN useradd -m $user \ # Copy CCF source and build RUN mkdir /CCF COPY . /CCF/ +RUN gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY + && tdnf -y update + && tdnf -y install ca-certificates git + && /CCF/scripts/./install-azure-linux-deps.sh RUN mkdir /CCF/build \ && cd /CCF/build \ && cmake -GNinja -DCOMPILE_TARGET=snp .. \ From 19cb8a406384e6955f314824b6b3386a45c141ed Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Tue, 4 Feb 2025 17:02:42 +0000 Subject: [PATCH 2/6] FIx docker --- .snpcc_canary | 2 +- docker/ccf_ci_built | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.snpcc_canary b/.snpcc_canary index c92fcf49879..bbb81ddb931 100644 --- a/.snpcc_canary +++ b/.snpcc_canary @@ -10,7 +10,7 @@ ,-'__ `-, {,-' `. } ,') ,( a ) `-.__ ,',')~, - <=.) ( `-.__,==' ' ' '} + <==.) ( `-.__,==' ' ' '} ( ) /) `-'\ , ) | \ `~. / diff --git a/docker/ccf_ci_built b/docker/ccf_ci_built index 0224c5a644a..95499db6dea 100644 --- a/docker/ccf_ci_built +++ b/docker/ccf_ci_built @@ -24,9 +24,9 @@ RUN useradd -m $user \ # Copy CCF source and build RUN mkdir /CCF COPY . /CCF/ -RUN gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY - && tdnf -y update - && tdnf -y install ca-certificates git +RUN gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY \ + && tdnf -y update \ + && tdnf -y install ca-certificates git \ && /CCF/scripts/./install-azure-linux-deps.sh RUN mkdir /CCF/build \ && cd /CCF/build \ From 8dfa83e69eacaf6d52a9e38f5f18a6ae626267d0 Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Tue, 4 Feb 2025 17:18:09 +0000 Subject: [PATCH 3/6] Update ci image ref --- .azure-pipelines-templates/deploy_aci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines-templates/deploy_aci.yml b/.azure-pipelines-templates/deploy_aci.yml index 27119203fcb..33b3204f8b3 100644 --- a/.azure-pipelines-templates/deploy_aci.yml +++ b/.azure-pipelines-templates/deploy_aci.yml @@ -50,7 +50,7 @@ jobs: env: ACR_REGISTRY_RESOURCE_NAME: ccfmsrc ACR_REGISTRY: ccfmsrc.azurecr.io - BASE_IMAGE: ghcr.io/microsoft/ccf/ci/default:build-14-01-2025 + BASE_IMAGE: mcr.microsoft.com/azurelinux/base/core:3.0 - script: | set -ex From eba0b096145c3c499d4084ed38e220a0cd8676b6 Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Tue, 4 Feb 2025 17:27:11 +0000 Subject: [PATCH 4/6] . --- docker/ccf_ci_built | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ccf_ci_built b/docker/ccf_ci_built index 95499db6dea..a99f90ccb7b 100644 --- a/docker/ccf_ci_built +++ b/docker/ccf_ci_built @@ -30,7 +30,7 @@ RUN gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY \ && /CCF/scripts/./install-azure-linux-deps.sh RUN mkdir /CCF/build \ && cd /CCF/build \ - && cmake -GNinja -DCOMPILE_TARGET=snp .. \ + && CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=snp .. \ && ninja \ && chmod -R 777 /CCF From 15622a2bb78332cb7c233dfedcf322fa04ae1cf1 Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Wed, 5 Feb 2025 11:47:21 +0000 Subject: [PATCH 5/6] Don't post-delete deployment --- .azure-pipelines-templates/deploy_aci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines-templates/deploy_aci.yml b/.azure-pipelines-templates/deploy_aci.yml index 33b3204f8b3..287ab4ba481 100644 --- a/.azure-pipelines-templates/deploy_aci.yml +++ b/.azure-pipelines-templates/deploy_aci.yml @@ -156,11 +156,11 @@ jobs: python3 -m venv ./scripts/azure_deployment/.env source ./scripts/azure_deployment/.env/bin/activate pip install -r ./scripts/azure_deployment/requirements.txt - python3 scripts/azure_deployment/arm_template.py remove aci \ - --subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \ - --resource-group ccf-aci \ - --aci-type dynamic-agent \ - --deployment-name ci-$(Build.BuildNumber) + # python3 scripts/azure_deployment/arm_template.py remove aci \ + # --subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \ + # --resource-group ccf-aci \ + # --aci-type dynamic-agent \ + # --deployment-name ci-$(Build.BuildNumber) name: cleanup_primary_aci displayName: "Delete the primary ACIs and Azure Deployments" continueOnError: true From 08cf246e2fd2b9d44707f81765d1f68f43ba7483 Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Wed, 5 Feb 2025 13:41:41 +0000 Subject: [PATCH 6/6] Ssh?.. --- CMakeLists.txt | 2 +- docker/ccf_ci_built | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b31cfc08066..248dd602cbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ endfunction() option(PROFILE_TESTS "Profile tests" OFF) if("$ENV{CI}" STREQUAL "") - set(PYTHON unbuffer python3) + set(PYTHON python3) else() set(PYTHON python3) endif() diff --git a/docker/ccf_ci_built b/docker/ccf_ci_built index a99f90ccb7b..74e8b9b4d43 100644 --- a/docker/ccf_ci_built +++ b/docker/ccf_ci_built @@ -34,4 +34,6 @@ RUN mkdir /CCF/build \ && ninja \ && chmod -R 777 /CCF +RUN ssh-keygen -A + CMD ["/usr/sbin/sshd", "-D"]