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

Upgrade from python3.8 to python3.10 #5311

Closed
wants to merge 18 commits into from
3 changes: 3 additions & 0 deletions .azure-pipelines-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ trigger:

jobs:
- job: build_and_publish_docs
# Note: Still on ubuntu-20.04 with python3.8 because of
# https://github.com/python-babel/babel/issues/990
container: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-virtual-clang15
pool:
vmImage: ubuntu-20.04
displayName: Build and Publish Docs

steps:
- checkout: self
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-quictls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ parameters:

jobs:
- job: build_quictls
container: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-clang15
container: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-virtual-clang15
pool: 1es-dv4-focal

strategy:
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
clean: true
fetchDepth: 1

- script: python3.8 scripts/extract-release-notes.py --target-git-version
- script: python3.10 scripts/extract-release-notes.py --target-git-version
Copy link
Member

Choose a reason for hiding this comment

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

I think we ought to switch to calling python3 everywhere, and communicate the version requirement through https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#python-requires

Wherever we can, using a shebang line or setuptools entry points would be nicer too, to avoid having to specify which python, now that 2.x is thoroughly obsolete.

displayName: "Check presence of release notes entry"
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
Codeql.SkipTaskAutoInjection: true
skipComponentGovernanceDetection: true
pool:
vmImage: "ubuntu-20.04"
vmImage: "ubuntu-22.04"
steps:
- checkout: self
clean: true
Expand Down
22 changes: 11 additions & 11 deletions .azure-pipelines-templates/deploy_aci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
Codeql.SkipTaskAutoInjection: true
skipComponentGovernanceDetection: true
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
steps:
- checkout: none

Expand All @@ -26,7 +26,7 @@ jobs:
skipComponentGovernanceDetection: true
sshKey: $[ dependencies.generate_ssh_key.outputs['generate_ssh_key.sshKey'] ]
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
steps:
- script: |
env
Expand Down Expand Up @@ -65,10 +65,10 @@ jobs:

- script: |
set -ex
python3.8 -m venv ./scripts/azure_deployment/.env
python3.10 -m venv ./scripts/azure_deployment/.env
source ./scripts/azure_deployment/.env/bin/activate
pip install -r ./scripts/azure_deployment/requirements.txt
python3.8 scripts/azure_deployment/arm_template.py deploy aci \
python3.10 scripts/azure_deployment/arm_template.py deploy aci \
--subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \
--resource-group ccf-aci \
--region northeurope \
Expand All @@ -91,7 +91,7 @@ jobs:
- job: deploy_secondary_aci
displayName: "Deploy Secondary ACI"
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
dependsOn:
- generate_ssh_key
variables:
Expand Down Expand Up @@ -132,10 +132,10 @@ jobs:

- script: |
set -ex
python3.8 -m venv ./scripts/azure_deployment/.env
python3.10 -m venv ./scripts/azure_deployment/.env
source ./scripts/azure_deployment/.env/bin/activate
pip install -r ./scripts/azure_deployment/requirements.txt
python3.8 scripts/azure_deployment/arm_template.py deploy aci \
python3.10 scripts/azure_deployment/arm_template.py deploy aci \
--subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \
--resource-group ccf-aci \
--region northeurope \
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
- job: cleanup_aci
displayName: "Cleanup ACI"
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
Copy link
Member

Choose a reason for hiding this comment

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

This is also updating some of the dependencies to 22.04, which feels like a bigger change than Python 3.10. Can we describe that in the PR title, and changelog if necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should have only been done on CI jobs that used Python (3.8 but now 3.10) but do not make use of any of our containers. In other words, it's not a user-facing change, but simply for us to use 22.04 for a few CI agents. I'll reflect that in the PR description.

dependsOn:
- generate_ssh_key
- deploy_primary_aci
Expand Down Expand Up @@ -219,10 +219,10 @@ jobs:

- script: |
set -ex
python3.8 -m venv ./scripts/azure_deployment/.env
python3.10 -m venv ./scripts/azure_deployment/.env
source ./scripts/azure_deployment/.env/bin/activate
pip install -r ./scripts/azure_deployment/requirements.txt
python3.8 scripts/azure_deployment/arm_template.py remove aci \
python3.10 scripts/azure_deployment/arm_template.py remove aci \
--subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \
--resource-group ccf-aci \
--aci-type dynamic-agent \
Expand All @@ -234,7 +234,7 @@ jobs:
- script: |
source ./scripts/azure_deployment/.env/bin/activate
if [[ ${{ parameters.secondaries.count }} != 0 ]]; then
python3.8 scripts/azure_deployment/arm_template.py remove aci \
python3.10 scripts/azure_deployment/arm_template.py remove aci \
--subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \
--resource-group ccf-aci \
--aci-type dynamic-agent \
Expand Down
14 changes: 7 additions & 7 deletions .azure-pipelines-templates/deploy_attestation_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
Codeql.SkipTaskAutoInjection: true
skipComponentGovernanceDetection: true
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
steps:
- template: azure_cli.yml
parameters:
Expand All @@ -22,10 +22,10 @@ jobs:

- script: |
set -ex
python3.8 -m venv ./scripts/azure_deployment/.env
python3.10 -m venv ./scripts/azure_deployment/.env
source ./scripts/azure_deployment/.env/bin/activate
pip install -r ./scripts/azure_deployment/requirements.txt
python3.8 scripts/azure_deployment/arm_template.py deploy aci \
python3.10 scripts/azure_deployment/arm_template.py deploy aci \
--subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \
--resource-group attestationContainer \
--aci-type dynamic-agent \
Expand All @@ -40,7 +40,7 @@ jobs:
- job: cleanup_aci
displayName: "Cleanup Attestation Container"
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
dependsOn:
- deploy_attestation_container
- ${{ parameters.used_by }}
Expand All @@ -54,10 +54,10 @@ jobs:

- script: |
set -ex
python3.8 -m venv ./scripts/azure_deployment/.env
python3.10 -m venv ./scripts/azure_deployment/.env
source ./scripts/azure_deployment/.env/bin/activate
pip install -r ./scripts/azure_deployment/requirements.txt
python3.8 scripts/azure_deployment/arm_template.py remove aci \
python3.10 scripts/azure_deployment/arm_template.py remove aci \
--subscription-id $(CCF_AZURE_SUBSCRIPTION_ID) \
--resource-group attestationContainer \
--aci-type dynamic-agent \
Expand All @@ -68,7 +68,7 @@ jobs:
- job: cleanup_container_image
displayName: "Cleanup Attestation Container image"
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
dependsOn:
- deploy_attestation_container
- ${{ parameters.used_by }}
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/install_others.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- script: |
set -ex
python3.8 -m venv env
python3.10 -m venv env
source ./env/bin/activate
pip install -r requirements.txt
pip install wheel
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
Hosted:
container: virtual
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
Virtual:
container: virtual
pool: 1es-dv4-focal
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- script: |
set -ex
python3.8 ./scripts/extract-release-notes.py --target-git-version | tee $(Build.BinariesDirectory)/rel-notes.md
python3.10 ./scripts/extract-release-notes.py --target-git-version | tee $(Build.BinariesDirectory)/rel-notes.md
displayName: Extract release notes

- script: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
dependsOn: ${{ parameters.depends_on }}
condition: ${{ parameters.condition }}
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
timeoutInMinutes: 120
variables:
Codeql.SkipTaskAutoInjection: true
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/test_on_remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
dependsOn: ${{ parameters.depends_on }}
condition: ${{ parameters.condition }}
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
timeoutInMinutes: 120
variables:
runOn: ${{ parameters.run_on }}
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: snp
image: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-snp-clang15
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-snp-clang15
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:27-04-2023-sgx
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-sgx
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 -v /lib/modules:/lib/modules:ro

variables:
Expand Down
6 changes: 3 additions & 3 deletions .daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE

- container: snp
image: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-snp-clang15
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-snp-clang15
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:27-04-2023-sgx
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-sgx
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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CCF Development Environment",
"image": "ccfmsrc.azurecr.io/ccf/ci:27-04-2023-virtual-clang15",
"image": "ccfmsrc.azurecr.io/ccf/ci:30-05-2023-virtual-clang15",
"runArgs": [],
"extensions": [
"eamodio.gitlens",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_CI_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Pull CI container
run: docker pull $ACR_REGISTRY/ccf/ci:27-04-2023-snp-clang15
run: docker pull $ACR_REGISTRY/ccf/ci:30-05-2023-snp-clang15

- name: Build CCF CI SNP container
run: docker build -f docker/ccf_ci_built . --build-arg="base=ccfmsrc.azurecr.io/ccf/ci:27-04-2023-snp-clang15" --build-arg="platform=snp" -t $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
run: docker build -f docker/ccf_ci_built . --build-arg="base=ccfmsrc.azurecr.io/ccf/ci:30-05-2023-snp-clang15" --build-arg="platform=snp" -t $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`

- name: Push CI container
run: docker push $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
2 changes: 1 addition & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
checks:
runs-on: ubuntu-latest
container: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-virtual-clang15
container: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-virtual-clang15

steps:
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .multi-thread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pr:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ schedules:
resources:
containers:
- container: sgx
image: ccfmsrc.azurecr.io/ccf/ci:27-04-2023-sgx
image: ccfmsrc.azurecr.io/ccf/ci:30-05-2023-sgx
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
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.0.3]

[4.0.3]: https://github.com/microsoft/CCF/releases/tag/ccf-4.0.3

- Updated Python from 3.8 to 3.10 (#5311).

## [4.0.2]

[4.0.2]: https://github.com/microsoft/CCF/releases/tag/ccf-4.0.2
Expand All @@ -17,11 +23,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- The `set_js_runtime_options` action now accepts `return_exception_details` and `log_exception_details` boolean options, which set the corresponding keys in the `public:ccf.gov.js_runtime_options` KV map. When enabled, a stack trace is respectively returned to the caller, and emitted to the log, on uncaught JS exceptions in application code.

## Changed
### Changed

- For security reasons, OpenSSL `>=1.1.1f` must be first installed on the system (Ubuntu) before installing the CCF Debian package (#5227).

## Added
### Added

- Added `ccf::historical::populate_service_endorsements` to public C++ API, allowing custom historical endpoints to do the same work as adapters.

Expand Down
2 changes: 1 addition & 1 deletion docker/ccf_ci_built
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Latest image as of this change
ARG platform=sgx
ARG base=ccfmsrc.azurecr.io/ccf/ci:27-04-2023-snp-clang-15
ARG base=ccfmsrc.azurecr.io/ccf/ci:30-05-2023-snp-clang-15
FROM ${base}

# SSH. Note that this could (should) be done in the base ccf_ci image instead
Expand Down
7 changes: 7 additions & 0 deletions getting_started/setup_vm/roles/ccf_build/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- name: Add Python repository
Copy link
Member

Choose a reason for hiding this comment

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

I am confused by this, doesn't 22.04 ship with 3.10? If so, why do we need the ppa?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR doesn't update the base container image to 22.04, and only updates Python to 3.10. Updating our container images to 22.04 will be a bigger change (in a separate PR) which cannot be completed just yet because of the lack of Open Enclave packages on 22.04.

apt_repository:
repo: "ppa:deadsnakes/ppa"
state: present
update_cache: yes
become: yes

- name: Include vars for Clang
include_vars: "clang{{ clang_version }}.yml"

Expand Down
4 changes: 2 additions & 2 deletions getting_started/setup_vm/roles/ccf_build/vars/clang11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ debs:
- libuv1-dev
- libc++-{{ clang_ver }}-dev
- libc++abi-{{ clang_ver }}-dev
- python3.8-dev
- python3.8-venv
- python3.10-dev
- python3.10-venv
- llvm-{{ clang_ver }}
- clang-{{ clang_ver }}
- clang-format-11
Expand Down
4 changes: 2 additions & 2 deletions getting_started/setup_vm/roles/ccf_build/vars/clang15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ debs:
- libuv1-dev
- libc++-{{ clang_ver }}-dev
- libc++abi-{{ clang_ver }}-dev
- python3.8-dev
- python3.8-venv
- python3.10-dev
- python3.10-venv
- llvm-{{ clang_ver }}
- clang-{{ clang_ver }}
- clang-format-11 # On purpose, to avoid formatting conflicts
Expand Down
2 changes: 1 addition & 1 deletion livehtml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
echo "Setting up Python environment..."
if [ ! -f "env/bin/activate" ]
then
python3.8 -m venv env
python3.10 -m venv env
fi

source env/bin/activate
Expand Down
Loading