From 4e668bf6eebaa07c0265cc774d033ca597482855 Mon Sep 17 00:00:00 2001 From: jonathanrainer Date: Tue, 2 Jul 2024 09:04:12 +0100 Subject: [PATCH 1/2] Use manylinux not centos:7 Due to CentOS EOLing we have to move to a new image. `manylinux` is used to ensure Python image builds are successful but we can use it in this context too. --- .circleci/config.yml | 45 ++++++++++++++++++++++++++++----- xtask/src/commands/unit_test.rs | 16 +++++++++++- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ea7ea00f..b006728df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,12 +28,24 @@ run_release: &run_release # The machines we use to run our workflows on executors: + amd_centos: &amd_manylinux_executor + docker: + # This image is used for building Python Wheels but it has what we need for Rust compilation and crucially + # glibc 2.17. + - image: quay.io/pypa/manylinux2014_x86_64:2024.07.02-0 + resource_class: xlarge + environment: + XTASK_TARGET: "x86_64-unknown-linux-gnu" + CHECK_GLIBC: "true" + + arm_ubuntu: &arm_ubuntu_executor machine: image: ubuntu-2004:2022.04.1 resource_class: arm.large environment: XTASK_TARGET: "aarch64-unknown-linux-gnu" + CHECK_GLIBC: "true" amd_musl: &amd_musl_executor docker: @@ -70,6 +82,7 @@ executors: environment: XTASK_TARGET: "x86_64-pc-windows-msvc" + # This is only used to run supergraph-demo since you can't run Docker from Docker amd_ubuntu: &amd_ubuntu_executor machine: image: ubuntu-2004:2022.04.1 @@ -128,7 +141,7 @@ workflows: name: Run cargo tests + studio integration tests (<< matrix.rust_channel >> rust on << matrix.platform >>) matrix: parameters: - platform: [amd_ubuntu, amd_musl, amd_macos, amd_windows] + platform: [amd_manylinux, amd_musl, amd_macos, amd_windows] rust_channel: [stable] command: [test] @@ -155,7 +168,7 @@ workflows: name: Run cargo tests + studio integration tests (<< matrix.rust_channel >> rust on << matrix.platform >>) matrix: parameters: - platform: [amd_ubuntu, amd_musl, amd_macos, amd_windows] + platform: [amd_manylinux, amd_musl, amd_macos, amd_windows] rust_channel: [stable] command: [test] <<: *run_release @@ -180,12 +193,12 @@ workflows: name: Build and bundle release artifacts (<< matrix.platform >>) matrix: parameters: - platform: [amd_ubuntu, amd_musl, arm_ubuntu, amd_macos, arm_macos, amd_windows] + platform: [amd_manylinux, amd_musl, arm_ubuntu, amd_macos, arm_macos, amd_windows] rust_channel: [stable] command: [package] options: ["--rebuild"] requires: - - "Run cargo tests + studio integration tests (stable rust on amd_ubuntu)" + - "Run cargo tests + studio integration tests (stable rust on amd_manylinux)" - "Run cargo tests + studio integration tests (stable rust on amd_musl)" - "Run cargo tests + studio integration tests (stable rust on amd_macos)" - "Run cargo tests + studio integration tests (stable rust on amd_windows)" @@ -201,7 +214,7 @@ workflows: parameters: platform: [volta] requires: - - "Build and bundle release artifacts (amd_ubuntu)" + - "Build and bundle release artifacts (amd_manylinux)" - "Build and bundle release artifacts (arm_ubuntu)" - "Build and bundle release artifacts (amd_musl)" - "Build and bundle release artifacts (amd_macos)" @@ -337,13 +350,33 @@ commands: - run: name: Update apt repositories command: sudo apt-get update + - run: + name: Check glibc version + command: ldd --version - run: name: Install OpenSSL command: sudo apt-get install -y libssl-dev - when: condition: - equal: [*amd_musl_executor, << parameters.platform >>] + equal: [*amd_manylinux_executor, << parameters.platform >>] + steps: + - run: + name: Update and upgrade yum packages + command: yum -y update && yum -y upgrade + - run: + name: Install development tools + command: yum groupinstall -y "Development Tools" + - run: + name: Install gcc, OpenSSL, and git + command: yum -y install perl-core gcc openssl-devel openssl git + - run: + name: Check glibc version + command: ldd --version + + - when: + condition: + equal: [*amd_musl_executor, << parameters.platform >>] steps: - run: name: Install musl-tools and bash diff --git a/xtask/src/commands/unit_test.rs b/xtask/src/commands/unit_test.rs index e650ed628..08027c07e 100644 --- a/xtask/src/commands/unit_test.rs +++ b/xtask/src/commands/unit_test.rs @@ -1,8 +1,13 @@ +use std::env; +use std::str::FromStr; + use anyhow::Result; +use camino::Utf8PathBuf; use clap::Parser; use crate::target::Target; -use crate::tools::CargoRunner; +use crate::tools::{CargoRunner, Runner}; +use crate::utils::PKG_PROJECT_ROOT; #[derive(Debug, Parser)] pub struct UnitTest { @@ -16,6 +21,15 @@ impl UnitTest { let cargo_runner = CargoRunner::new()?; cargo_runner.test(&self.target)?; + if let Target::LinuxUnknownGnu = self.target { + if env::var_os("CHECK_GLIBC").is_some() { + let check_glibc_script = "./check_glibc.sh".to_string(); + let runner = Runner::new(Utf8PathBuf::from_str(&check_glibc_script)?.as_str()); + let bin_path = format!("./target/{}/debug/rover", &self.target); + runner.exec(&[&bin_path], &PKG_PROJECT_ROOT, None)?; + } + } + Ok(()) } } From 6118ac2ae00e81e3e9d8c4baac50ec801d6c4b85 Mon Sep 17 00:00:00 2001 From: jonathanrainer Date: Tue, 2 Jul 2024 09:08:01 +0100 Subject: [PATCH 2/2] Name executors correctly --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b006728df..704922041 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ run_release: &run_release # The machines we use to run our workflows on executors: - amd_centos: &amd_manylinux_executor + amd_manylinux: &amd_manylinux_executor docker: # This image is used for building Python Wheels but it has what we need for Rust compilation and crucially # glibc 2.17.