Skip to content

Commit

Permalink
Merge branch 'main' into readthedocs/conf_v2
Browse files Browse the repository at this point in the history
Signed-off-by: Victor <vic.6r1d@gmail.com>
Signed-off-by: 6r1d <vic.6r1d@gmail.com>
  • Loading branch information
6r1d committed Nov 16, 2023
2 parents d1a835a + 9995600 commit 9a40c94
Show file tree
Hide file tree
Showing 73 changed files with 4,223 additions and 378 deletions.
22 changes: 11 additions & 11 deletions .github/build-iroha1-fork.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
check_if_pull_request_comes_from_fork:
runs-on: ubuntu-20.04 #ubuntu-latest
permissions: read-all
name: Pull requests from forks should use this workflow
name: Pull requests from forks should use this workflow
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- &step_show_context
Expand All @@ -44,8 +44,8 @@ jobs:
uses: actions/checkout@v2
with: &step_checkout_with_head
ref: ${{ github.event.pull_request.head.sha }}
-
name: Filter files

- name: Filter files
uses: dorny/paths-filter@v2
id: filter
with:
Expand All @@ -70,13 +70,13 @@ jobs:
run: |
echo "Pull requests from forks are not allowed to change Dockerfiles"
false
- name: verify build depedencies script is not changed
if: steps.filter.outputs.build_dependecies == 'true'
run: |
echo "Pull requests from forks are not allowed to change build dependencies script"
false
## This job is to generate build matrixes for build jobs
## The matrixes depend on what is requeted to be build
## At the moment there are several options:
Expand Down Expand Up @@ -118,12 +118,12 @@ jobs:
commit_was_merged_build_spec(){
git_is_merge_commit $1 &&
git log -n1 $1 --format=%s | grep -q '^Merge branch' &&
echo "/build before-merge"
echo "/build ubuntu debug release normal gcc-10"
}
case ${{github.event_name}} in
pull_request_target) if commit_message_body_build_spec FETCH_HEAD >/tmp/comment_body ;then
if git_is_merge_commit FETCH_HEAD ;then
echo ::warning::'/build directive in merge commit overrides default "/build before-merge"'
echo ::warning::'/build directive in merge commit overrides default "/build ubuntu debug release normal gcc-10"'
fi
elif commit_was_merged_build_spec FETCH_HEAD >/tmp/comment_body ;then
true
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
matrix_dockerimage_release: ${{steps.matrixes.outputs.matrix_dockerimage_release}}
matrix_dockerimage_debug: ${{steps.matrixes.outputs.matrix_dockerimage_debug}}

## Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependancies
## Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependencies
## The result docker image is pushed with tags :pr-NUMBER, :commit-HASH, :branch-name, :tag-name,
## and conditional tags :edge for development branch, and :latest for git-tags.
Docker-iroha-builder:
Expand Down Expand Up @@ -329,7 +329,7 @@ jobs:
needs:
- Docker-iroha-builder
- generate_matrixes
runs-on: [ self-hosted, Linux ]
runs-on: [ self-hosted, Linux, iroha ]
permissions: read-all
container: ## Container is taken from previous job
image: &container_image ${{needs.Docker-iroha-builder.outputs.container}}
Expand Down Expand Up @@ -413,7 +413,7 @@ jobs:
key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- &step_vcpkg_build
name: Build iroha vcpkg dependancies
name: Build iroha vcpkg dependencies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
## Takes 48m16s on default GitHub runner with 2 cores
## Takes 13m41s on self-hosted AWS EC2 c5.x4large
Expand Down Expand Up @@ -751,7 +751,7 @@ jobs:
needs:
- build-UR
- generate_matrixes
runs-on: [ self-hosted, Linux ] #ubuntu-latest
runs-on: [ self-hosted, Linux, iroha ] #ubuntu-latest
# strategy: *strategy_ubuntu_release
# if: *if_ubuntu_release
strategy:
Expand Down
97 changes: 49 additions & 48 deletions .github/build-iroha1.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build ubuntu debug release normal gcc-10"
Expand All @@ -221,6 +221,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down Expand Up @@ -352,13 +353,13 @@ jobs:
- &step_docker_buildx
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- &step_docker_cache
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{env.dockertag}}
restore-keys: ${{ runner.os }}-buildx-
# - &step_docker_cache
# name: Cache Docker layers
# uses: actions/cache@v2
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{env.dockertag}}
# restore-keys: ${{ runner.os }}-buildx-
- &step_docker_build_and_push
id: build_and_push
name: Build and push
Expand All @@ -379,14 +380,14 @@ jobs:
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo == github.event.pull_request.base.repo }}
tags: ${{ steps.meta_ghcr.outputs.tags }}
labels: ${{ steps.meta_ghcr.outputs.labels }}
- &step_docker_move_cache
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
# - &step_docker_move_cache
# # Temp fix
# # https://github.com/docker/build-push-action/issues/252
# # https://github.com/moby/buildkit/issues/1896
# name: Move cache
# run: |
# rm -rf /tmp/.buildx-cache
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache
-
name: Check if dockertaghash exists in remote registry
id: dockertag_already
Expand All @@ -409,7 +410,7 @@ jobs:
needs:
- Docker-iroha-builder
- generate_matrixes
runs-on: [ self-hosted, Linux ]
runs-on: [ self-hosted, Linux, iroha ]
container: ## Container is taken from previous job
image: &container_image ${{needs.Docker-iroha-builder.outputs.container}}
options: --user root
Expand Down Expand Up @@ -473,24 +474,24 @@ jobs:
echo >>$GITHUB_ENV _CCACHE_DIR=$($(realpath $CCACHE_PATH/gcc) --show-config | sed -nE 's,.*cache_dir = ,,p')
echo >>$GITHUB_ENV NPROC=$(nproc | awk '{printf("%.0f",$1*0.77)}')
echo >>$GITHUB_ENV HOME=$HOME
- &step_restore_ccache
name: Restore cache CCache
uses: actions/cache@v2
with:
path: ${{ env._CCACHE_DIR }}
key: ${{runner.os}}-ccache-${{ github.event.pull_request.head.sha }}
restore-keys: ${{runner.os}}-ccache-
- &step_store_ccache_stats
run: ccache --show-stats | tee /tmp/ccache-stats
- &step_vcpkg_cache
## Read the docs https://vcpkg.readthedocs.io/en/latest/users/binarycaching/ https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md
name: Restore cache Vcpkg binarycache ## NOTE not useng NuGet because on ubuntu nuget needs mono of 433MB, unusable.
uses: actions/cache@v2
with:
path: |
${{env.HOME}}/.cache/vcpkg/archives
key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
# - &step_restore_ccache
# name: Restore cache CCache
# uses: actions/cache@v2
# with:
# path: ${{ env._CCACHE_DIR }}
# key: ${{runner.os}}-ccache-${{ github.event.pull_request.head.sha }}
# restore-keys: ${{runner.os}}-ccache-
# - &step_store_ccache_stats
# run: ccache --show-stats | tee /tmp/ccache-stats
# - &step_vcpkg_cache
# ## Read the docs https://vcpkg.readthedocs.io/en/latest/users/binarycaching/ https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md
# name: Restore cache Vcpkg binarycache ## NOTE not useng NuGet because on ubuntu nuget needs mono of 433MB, unusable.
# uses: actions/cache@v2
# with:
# path: |
# ${{env.HOME}}/.cache/vcpkg/archives
# key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
# restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- &step_vcpkg_build
name: Build iroha vcpkg dependancies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
Expand Down Expand Up @@ -530,8 +531,8 @@ jobs:
- &step_cpack
name: CPack (linux only)
run: cd build; cpack; ## cmake --build build --target package
- &step_compare_ccache_stats
run: ccache --show-stats | diff --side-by-side /tmp/ccache-stats - ||true
# - &step_compare_ccache_stats
# run: ccache --show-stats | diff --side-by-side /tmp/ccache-stats - ||true
- &step_always_after_build
name: Show free space and disk usage
if: ${{ always() }}
Expand Down Expand Up @@ -735,13 +736,13 @@ jobs:
env:
<<: *step_export_cxx_env
CCACHE_PATH: /usr/local/opt/ccache/libexec
- *step_restore_ccache
- *step_store_ccache_stats
- *step_vcpkg_cache
# - *step_restore_ccache
# - *step_store_ccache_stats
# - *step_vcpkg_cache
- *step_vcpkg_build
- *step_cmake_configure
- *step_cmake_build
- *step_compare_ccache_stats
# - *step_compare_ccache_stats
- *step_always_after_build
- *step_artifact_suffix
- <<: *step_artifact_irohad
Expand Down Expand Up @@ -824,7 +825,7 @@ jobs:
needs:
- build-UR
- generate_matrixes
runs-on: [ self-hosted, Linux ] #ubuntu-latest
runs-on: [ self-hosted, Linux, iroha ] #ubuntu-latest
# strategy: *strategy_ubuntu_release
# if: *if_ubuntu_release
strategy:
Expand Down Expand Up @@ -873,11 +874,11 @@ jobs:
- *step_docker_login_ghcr
- *step_warn_docker_no_push
- *step_docker_buildx
- <<: *step_docker_cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-release-${{env.dockertag}}
restore-keys: ${{ runner.os }}-buildx-release
# - <<: *step_docker_cache
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-release-${{env.dockertag}}
# restore-keys: ${{ runner.os }}-buildx-release
- <<: *step_docker_build_and_push
with:
<<: *step_docker_build_and_push_with
Expand All @@ -887,7 +888,7 @@ jobs:
with:
<<: *step_docker_build_and_push_ghcr-with
context: docker/release/
- *step_docker_move_cache
# - *step_docker_move_cache

docker-D:
<<: *job_docker_image_release
Expand Down
2 changes: 1 addition & 1 deletion .github/chatops-gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echoerr(){
readonly ALL_oses="ubuntu macos windows" ALL_build_types="Debug Release" ALL_cmake_opts="normal burrow ursa" ALL_compilers="gcc-9 gcc-10 clang-10 clang llvm msvc"
readonly DEFAULT_oses="ubuntu macos windows" DEFAULT_build_types="Debug" DEFAULT_cmake_opts="normal burrow ursa"
readonly DEFAULT_ubuntu_compilers="gcc-9" AVAILABLE_ubuntu_compilers="gcc-9 gcc-10 clang-10"
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang gcc-10" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_windows_compilers="msvc" AVAILABLE_windows_compilers="msvc" ## Also "clang mingw cygwin" but they are redundant

--help-buildspec(){
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build-iroha1-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ jobs:
commit_was_merged_build_spec(){
git_is_merge_commit $1 &&
git log -n1 $1 --format=%s | grep -q '^Merge branch' &&
echo "/build before-merge"
echo "/build ubuntu debug release normal gcc-10"
}
case ${{github.event_name}} in
pull_request_target) if commit_message_body_build_spec FETCH_HEAD >/tmp/comment_body ;then
if git_is_merge_commit FETCH_HEAD ;then
echo ::warning::'/build directive in merge commit overrides default "/build before-merge"'
echo ::warning::'/build directive in merge commit overrides default "/build ubuntu debug release normal gcc-10"'
fi
elif commit_was_merged_build_spec FETCH_HEAD >/tmp/comment_body ;then
true
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
matrix_windows: ${{steps.matrixes.outputs.matrix_windows}}
matrix_dockerimage_release: ${{steps.matrixes.outputs.matrix_dockerimage_release}}
matrix_dockerimage_debug: ${{steps.matrixes.outputs.matrix_dockerimage_debug}}
## Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependancies
## Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependencies
## The result docker image is pushed with tags :pr-NUMBER, :commit-HASH, :branch-name, :tag-name,
## and conditional tags :edge for development branch, and :latest for git-tags.
Docker-iroha-builder:
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
needs:
- Docker-iroha-builder
- generate_matrixes
runs-on: [self-hosted, Linux]
runs-on: [self-hosted, Linux, iroha]
permissions: read-all
container: ## Container is taken from previous job
image: ${{needs.Docker-iroha-builder.outputs.container}}
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
${{env.HOME}}/.cache/vcpkg/archives
key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- name: Build iroha vcpkg dependancies
- name: Build iroha vcpkg dependencies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
## Takes 48m16s on default GitHub runner with 2 cores
## Takes 13m41s on self-hosted AWS EC2 c5.x4large
Expand Down Expand Up @@ -616,7 +616,7 @@ jobs:
needs:
- Docker-iroha-builder
- generate_matrixes
runs-on: [self-hosted, Linux]
runs-on: [self-hosted, Linux, iroha]
permissions: read-all
container: ## Container is taken from previous job
image: ${{needs.Docker-iroha-builder.outputs.container}}
Expand Down Expand Up @@ -720,7 +720,7 @@ jobs:
${{env.HOME}}/.cache/vcpkg/archives
key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- name: Build iroha vcpkg dependancies
- name: Build iroha vcpkg dependencies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
## Takes 48m16s on default GitHub runner with 2 cores
## Takes 13m41s on self-hosted AWS EC2 c5.x4large
Expand Down Expand Up @@ -1023,7 +1023,7 @@ jobs:
${{env.HOME}}/.cache/vcpkg/archives
key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- name: Build iroha vcpkg dependancies
- name: Build iroha vcpkg dependencies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
## Takes 48m16s on default GitHub runner with 2 cores
## Takes 13m41s on self-hosted AWS EC2 c5.x4large
Expand Down Expand Up @@ -1249,7 +1249,7 @@ jobs:
working-directory:
#- *step_restore_ccache
#- *step_vcpkg_cache
- name: Build iroha vcpkg dependancies
- name: Build iroha vcpkg dependencies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
## Takes 48m16s on default GitHub runner with 2 cores
## Takes 13m41s on self-hosted AWS EC2 c5.x4large
Expand Down Expand Up @@ -1293,7 +1293,7 @@ jobs:
needs:
- build-UR
- generate_matrixes
runs-on: [self-hosted, Linux] #ubuntu-latest
runs-on: [self-hosted, Linux, iroha] #ubuntu-latest
# strategy: *strategy_ubuntu_release
# if: *if_ubuntu_release
strategy:
Expand Down Expand Up @@ -1468,7 +1468,7 @@ jobs:
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
docker-D:
runs-on: [self-hosted, Linux] #ubuntu-latest
runs-on: [self-hosted, Linux, iroha] #ubuntu-latest
env:
IMAGE_NAME: iroha
steps:
Expand Down
Loading

0 comments on commit 9a40c94

Please sign in to comment.