CI: Optimize machine sizes for best speed/cost ratio

This commit is contained in:
Kamil Śliwak 2021-10-28 22:34:48 +02:00
parent c76a6bdbab
commit 0cece8e6e7
2 changed files with 115 additions and 44 deletions

View File

@ -20,7 +20,7 @@ cd build
$boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*) $boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*)
..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" -DUSE_Z3=OFF .. ..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" -DUSE_Z3=OFF ..
if ( -not $? ) { throw "CMake configure failed." } if ( -not $? ) { throw "CMake configure failed." }
msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal msbuild solidity.sln /p:Configuration=Release /m:10 /v:minimal
if ( -not $? ) { throw "Build failed." } if ( -not $? ) { throw "Build failed." }
..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release ..\deps\cmake\bin\cmake --build . -j 10 --target install --config Release
if ( -not $? ) { throw "Install target failed." } if ( -not $? ) { throw "Install target failed." }

View File

@ -226,6 +226,14 @@ defaults:
- image: << pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image >> - image: << pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image >>
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 3
- base_ubuntu1604_clang_small: &base_ubuntu1604_clang_small
<<: *base_ubuntu1604_clang
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
- base_ubuntu2004_clang: &base_ubuntu2004_clang - base_ubuntu2004_clang: &base_ubuntu2004_clang
docker: docker:
@ -236,20 +244,44 @@ defaults:
CXX: clang++ CXX: clang++
MAKEFLAGS: -j 3 MAKEFLAGS: -j 3
- base_ubuntu2004_clang_xlarge: &base_ubuntu2004_clang_xlarge - base_ubuntu2004_clang_small: &base_ubuntu2004_clang_small
<<: *base_ubuntu2004_clang <<: *base_ubuntu2004_clang
resource_class: xlarge resource_class: small
environment: environment:
TERM: xterm TERM: xterm
CC: clang CC: clang
CXX: clang++ CXX: clang++
MAKEFLAGS: -j 10 MAKEFLAGS: -j 2
- base_ubuntu2004_clang_large: &base_ubuntu2004_clang_large
<<: *base_ubuntu2004_clang
resource_class: large
environment:
TERM: xterm
CC: clang
CXX: clang++
MAKEFLAGS: -j 5
- base_ubuntu2004: &base_ubuntu2004 - base_ubuntu2004: &base_ubuntu2004
docker: docker:
- image: << pipeline.parameters.ubuntu-2004-docker-image >> - image: << pipeline.parameters.ubuntu-2004-docker-image >>
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 3
- base_ubuntu2004_small: &base_ubuntu2004_small
<<: *base_ubuntu2004
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
- base_ubuntu2004_large: &base_ubuntu2004_large
<<: *base_ubuntu2004
resource_class: large
environment:
TERM: xterm
MAKEFLAGS: -j 5
- base_ubuntu2004_xlarge: &base_ubuntu2004_xlarge - base_ubuntu2004_xlarge: &base_ubuntu2004_xlarge
<<: *base_ubuntu2004 <<: *base_ubuntu2004
@ -258,29 +290,48 @@ defaults:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 10 MAKEFLAGS: -j 10
- base_buildpack_focal: &base_buildpack_focal - base_buildpack_focal_small: &base_buildpack_focal_small
docker: docker:
- image: buildpack-deps:focal - image: buildpack-deps:focal
resource_class: small
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 2
- base_buildpack_latest: &base_buildpack_latest - base_buildpack_latest_small: &base_buildpack_latest_small
docker: docker:
- image: buildpack-deps:latest - image: buildpack-deps:latest
resource_class: small
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 2
- base_archlinux: &base_archlinux - base_archlinux: &base_archlinux
docker: docker:
- image: archlinux:base - image: archlinux:base
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 3
- base_archlinux_large: &base_archlinux_large
docker:
- image: archlinux:base
resource_class: large
environment:
TERM: xterm
MAKEFLAGS: -j 5
- base_win_powershell: &base_win_powershell - base_win_powershell: &base_win_powershell
executor: executor:
name: win/default name: win/default
shell: powershell.exe shell: powershell.exe
- base_win_powershell_large: &base_win_powershell_large
executor:
name: win/default
shell: powershell.exe
size: large
- base_win_cmd: &base_win_cmd - base_win_cmd: &base_win_cmd
executor: executor:
name: win/default name: win/default
@ -291,26 +342,31 @@ defaults:
xcode: "11.0.0" xcode: "11.0.0"
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 5
- base_ems_xlarge: &base_ems_xlarge - base_ems_large: &base_ems_large
docker: docker:
- image: << pipeline.parameters.emscripten-docker-image >> - image: << pipeline.parameters.emscripten-docker-image >>
resource_class: xlarge resource_class: large
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 10 MAKEFLAGS: -j 5
- base_python: &base_python - base_python_small: &base_python_small
docker: docker:
- image: circleci/python:3.6 - image: circleci/python:3.6
resource_class: small
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 2
- base_node_latest: &base_node_latest - base_node_latest_small: &base_node_latest_small
docker: docker:
- image: circleci/node - image: circleci/node
resource_class: small
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 2
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Workflow Templates # Workflow Templates
@ -394,7 +450,7 @@ defaults:
jobs: jobs:
chk_spelling: chk_spelling:
<<: *base_python <<: *base_python_small
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
@ -409,7 +465,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_docs_examples: chk_docs_examples:
<<: *base_node_latest <<: *base_node_latest_small
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
@ -423,7 +479,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_coding_style: chk_coding_style:
<<: *base_buildpack_focal <<: *base_buildpack_focal_small
steps: steps:
- checkout - checkout
- run: - run:
@ -441,7 +497,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_errorcodes: chk_errorcodes:
<<: *base_python <<: *base_python_small
steps: steps:
- checkout - checkout
- run: - run:
@ -450,7 +506,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_pylint: chk_pylint:
<<: *base_buildpack_focal <<: *base_buildpack_focal_small
steps: steps:
- checkout - checkout
- run: - run:
@ -466,7 +522,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_antlr_grammar: chk_antlr_grammar:
<<: *base_buildpack_focal <<: *base_buildpack_focal_small
steps: steps:
- checkout - checkout
- run: - run:
@ -478,7 +534,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_buglist: chk_buglist:
<<: *base_node_latest <<: *base_node_latest_small
steps: steps:
- checkout - checkout
- run: - run:
@ -493,7 +549,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_proofs: chk_proofs:
<<: *base_buildpack_latest <<: *base_buildpack_latest_small
steps: steps:
- checkout - checkout
- run: - run:
@ -506,14 +562,14 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
chk_docs_pragma_min_version: chk_docs_pragma_min_version:
<<: *base_ubuntu2004 <<: *base_ubuntu2004_small
steps: steps:
- checkout - checkout
- run: *run_docs_pragma_min_version - run: *run_docs_pragma_min_version
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
t_ubu_pyscripts: t_ubu_pyscripts:
<<: *base_ubuntu2004 <<: *base_ubuntu2004_small
steps: steps:
- checkout - checkout
- run: - run:
@ -532,6 +588,8 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_ubu: &b_ubu b_ubu: &b_ubu
# this runs 2x faster on xlarge but takes 4x more resources (compared to medium).
# Enough other jobs depend on it that it's worth it though.
<<: *base_ubuntu2004_xlarge <<: *base_ubuntu2004_xlarge
steps: steps:
- checkout - checkout
@ -544,10 +602,11 @@ jobs:
# x64 ASAN build, for testing for memory related bugs # x64 ASAN build, for testing for memory related bugs
b_ubu_asan: &b_ubu_asan b_ubu_asan: &b_ubu_asan
<<: *base_ubuntu2004_xlarge # Runs slightly faster on large and xlarge but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2004
environment: environment:
CMAKE_OPTIONS: -DSANITIZE=address CMAKE_OPTIONS: -DSANITIZE=address
MAKEFLAGS: -j 10 MAKEFLAGS: -j 3
CMAKE_BUILD_TYPE: Release CMAKE_BUILD_TYPE: Release
steps: steps:
- checkout - checkout
@ -557,7 +616,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_ubu_clang: &b_ubu_clang b_ubu_clang: &b_ubu_clang
<<: *base_ubuntu2004_clang_xlarge <<: *base_ubuntu2004_clang_large
steps: steps:
- checkout - checkout
- run: *run_build - run: *run_build
@ -566,6 +625,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_ubu_asan_clang: &b_ubu_asan_clang b_ubu_asan_clang: &b_ubu_asan_clang
# This runs a bit faster on large and xlarge but on nightly efficiency matters more.
<<: *base_ubuntu2004_clang <<: *base_ubuntu2004_clang
environment: environment:
CC: clang CC: clang
@ -580,6 +640,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_ubu_ubsan_clang: &b_ubu_ubsan_clang b_ubu_ubsan_clang: &b_ubu_ubsan_clang
# This runs a bit faster on large and xlarge but on nightly efficiency matters more.
<<: *base_ubuntu2004_clang <<: *base_ubuntu2004_clang
environment: environment:
CC: clang CC: clang
@ -600,9 +661,10 @@ jobs:
MAKEFLAGS: -j 10 MAKEFLAGS: -j 10
b_ubu_static: b_ubu_static:
<<: *base_ubuntu2004_xlarge # Runs 2x faster on large and 3x on xlarge but no other jobs depend on it we can live with medium.
<<: *base_ubuntu2004
environment: environment:
MAKEFLAGS: -j 10 MAKEFLAGS: -j 3
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON
steps: steps:
- checkout - checkout
@ -614,11 +676,12 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_ubu_codecov: b_ubu_codecov:
<<: *base_ubuntu2004_xlarge # Runs ~30% faster on large but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2004
environment: environment:
COVERAGE: ON COVERAGE: ON
CMAKE_BUILD_TYPE: Debug CMAKE_BUILD_TYPE: Debug
MAKEFLAGS: -j 10 MAKEFLAGS: -j 3
steps: steps:
- checkout - checkout
- run: *run_build - run: *run_build
@ -651,11 +714,11 @@ jobs:
# Builds in C++20 mode and uses debug build in order to speed up. # Builds in C++20 mode and uses debug build in order to speed up.
# Do *NOT* store any artifacts or workspace as we don't run tests on this build. # Do *NOT* store any artifacts or workspace as we don't run tests on this build.
b_ubu_cxx20: b_ubu_cxx20:
<<: *base_ubuntu2004_xlarge <<: *base_ubuntu2004_large
environment: environment:
CMAKE_BUILD_TYPE: Debug CMAKE_BUILD_TYPE: Debug
CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF
MAKEFLAGS: -j 10 MAKEFLAGS: -j 5
steps: steps:
- checkout - checkout
- run: *run_build - run: *run_build
@ -671,7 +734,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
t_ubu_ossfuzz: &t_ubu_ossfuzz t_ubu_ossfuzz: &t_ubu_ossfuzz
<<: *base_ubuntu1604_clang <<: *base_ubuntu1604_clang_small
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
@ -688,10 +751,10 @@ jobs:
- gitter_notify_success_unless_pr - gitter_notify_success_unless_pr
b_archlinux: b_archlinux:
<<: *base_archlinux <<: *base_archlinux_large
environment: environment:
TERM: xterm TERM: xterm
MAKEFLAGS: -j 3 MAKEFLAGS: -j 5
steps: steps:
- run: - run:
name: Install build dependencies name: Install build dependencies
@ -772,7 +835,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_ems: b_ems:
<<: *base_ems_xlarge <<: *base_ems_large
steps: steps:
- checkout - checkout
- run: - run:
@ -793,7 +856,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_docs: b_docs:
<<: *base_ubuntu2004 <<: *base_ubuntu2004_small
steps: steps:
- checkout - checkout
- run: *setup_prerelease_commit_hash - run: *setup_prerelease_commit_hash
@ -850,14 +913,15 @@ jobs:
<<: *t_ubu_soltest_all <<: *t_ubu_soltest_all
t_ubu_cli: &t_ubu_cli t_ubu_cli: &t_ubu_cli
<<: *base_ubuntu2004 <<: *base_ubuntu2004_small
<<: *steps_cmdline_tests <<: *steps_cmdline_tests
t_ubu_release_cli: &t_ubu_release_cli t_ubu_release_cli: &t_ubu_release_cli
<<: *t_ubu_cli <<: *t_ubu_cli
t_ubu_asan_cli: t_ubu_asan_cli:
<<: *base_ubuntu2004 # Runs slightly faster on medium but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2004_small
environment: environment:
TERM: xterm TERM: xterm
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2 ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
@ -889,10 +953,11 @@ jobs:
<<: *steps_soltest <<: *steps_soltest
t_ubu_ubsan_clang_cli: t_ubu_ubsan_clang_cli:
<<: *base_ubuntu2004_clang <<: *base_ubuntu2004_clang_small
<<: *steps_cmdline_tests <<: *steps_cmdline_tests
t_ems_solcjs: t_ems_solcjs:
# Unlike other t_ems jobs this one actually runs 2x faster on medium (compared to small).
<<: *base_ubuntu2004 <<: *base_ubuntu2004
steps: steps:
- checkout - checkout
@ -913,7 +978,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
t_ems_ext_hardhat: t_ems_ext_hardhat:
<<: *base_node_latest <<: *base_node_latest_small
environment: environment:
TERM: xterm TERM: xterm
HARDHAT_TESTS_SOLC_PATH: /tmp/workspace/soljson.js HARDHAT_TESTS_SOLC_PATH: /tmp/workspace/soljson.js
@ -948,8 +1013,12 @@ jobs:
nodejs_version: nodejs_version:
type: string type: string
default: latest default: latest
resource_class:
type: string
default: small
docker: docker:
- image: circleci/node:<<parameters.nodejs_version>> - image: circleci/node:<<parameters.nodejs_version>>
resource_class: <<parameters.resource_class>>
# NOTE: Each external test does 3 separate compile&test runs # NOTE: Each external test does 3 separate compile&test runs
parallelism: 3 parallelism: 3
environment: environment:
@ -971,7 +1040,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_win: &b_win b_win: &b_win
<<: *base_win_powershell <<: *base_win_powershell_large
steps: steps:
# NOTE: Not disabling git's core.autocrlf here because we want to build using the typical Windows config. # NOTE: Not disabling git's core.autocrlf here because we want to build using the typical Windows config.
- checkout - checkout
@ -1028,7 +1097,7 @@ jobs:
<<: *t_win_soltest <<: *t_win_soltest
b_bytecode_ubu: b_bytecode_ubu:
<<: *base_ubuntu2004 <<: *base_ubuntu2004_small
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
@ -1094,7 +1163,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
b_bytecode_ems: b_bytecode_ems:
<<: *base_node_latest <<: *base_node_latest_small
environment: environment:
SOLC_EMSCRIPTEN: "On" SOLC_EMSCRIPTEN: "On"
steps: steps:
@ -1111,7 +1180,7 @@ jobs:
- gitter_notify_failure_unless_pr - gitter_notify_failure_unless_pr
t_bytecode_compare: t_bytecode_compare:
<<: *base_ubuntu2004 <<: *base_ubuntu2004_small
environment: environment:
REPORT_FILES: | REPORT_FILES: |
bytecode-report-emscripten.txt bytecode-report-emscripten.txt
@ -1251,6 +1320,7 @@ workflows:
project: zeppelin project: zeppelin
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported" # NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
nodejs_version: '16' nodejs_version: '16'
resource_class: medium
- t_ems_ext: - t_ems_ext:
<<: *workflow_emscripten <<: *workflow_emscripten
name: t_ems_test_ext_ens name: t_ems_test_ext_ens
@ -1321,3 +1391,4 @@ workflows:
<<: *workflow_emscripten <<: *workflow_emscripten
name: t_ems_test_ext_colony name: t_ems_test_ext_colony
project: colony project: colony
resource_class: medium