From 95ddffe7ffd44425d0a86cdc30cd603081462f4e Mon Sep 17 00:00:00 2001 From: Kim Ebert Date: Fri, 3 May 2024 14:40:06 -0600 Subject: [PATCH] fix: fix missing popitem and msgpack naming chore: Enable workflows on ubuntu-22.04 branch fix: update test to use ubuntu 22.04 fix: pin version of msgpack for tests chore: pin msgpack to 0.5.6 chore: remove downgrade, as pinning in setup.py should work better fix: fix tag to use 22.04 chore: set permissions chore: fix exclude data dir chore: pin rocksdb fix: fix repos fix: add ursa fix: fix relative path build issue (#14) fix: fix apt issue feat: prep for hyperledger Signed-off-by: Kim Ebert --- .github/workflows/PR.yaml | 3 ++- .github/workflows/Push.yaml | 2 ++ .github/workflows/build/Dockerfile.ubuntu-2204 | 8 ++++---- .github/workflows/publishRelease.yaml | 4 ++++ .github/workflows/reuseable_test.yaml | 4 ++-- .github/workflows/tag.yaml | 6 +++++- .readthedocs.yaml | 2 +- build-scripts/ubuntu-2204/build-3rd-parties.sh | 6 ++++-- build-scripts/ubuntu-2204/build-plenum.sh | 2 +- build-scripts/ubuntu-2204/postinst | 2 +- plenum/__version__.json | 2 +- plenum/server/consensus/ordering_service.py | 2 +- setup.py | 4 ++-- 13 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/PR.yaml b/.github/workflows/PR.yaml index d1fe66cb45..50113581a0 100644 --- a/.github/workflows/PR.yaml +++ b/.github/workflows/PR.yaml @@ -7,6 +7,7 @@ on: branches: - main + - ubuntu-22.04 jobs: workflow-setup: @@ -80,4 +81,4 @@ jobs: needs: [workflow-setup, plenum_tests] if: ${{ needs.workflow-setup.outputs.testsNeeded == 'false' || success() }} steps: - - run: 'echo "Just a status Check (Always true, when executed) for branch protection rules(blocks merging while test are running and if tests fail)." ' \ No newline at end of file + - run: 'echo "Just a status Check (Always true, when executed) for branch protection rules(blocks merging while test are running and if tests fail)." ' diff --git a/.github/workflows/Push.yaml b/.github/workflows/Push.yaml index f1f08d09cb..46577c1f04 100644 --- a/.github/workflows/Push.yaml +++ b/.github/workflows/Push.yaml @@ -3,12 +3,14 @@ on: push: branches: - main + - ubuntu-22.04 paths: - '**.py' - '.github/**' - 'build-scripts/**' - 'bump_version.sh' + jobs: workflow-setup: name: Initialize Workflow diff --git a/.github/workflows/build/Dockerfile.ubuntu-2204 b/.github/workflows/build/Dockerfile.ubuntu-2204 index 0de89a80f1..c3eb0113af 100644 --- a/.github/workflows/build/Dockerfile.ubuntu-2204 +++ b/.github/workflows/build/Dockerfile.ubuntu-2204 @@ -17,9 +17,8 @@ RUN apt-get update -y && apt-get install -y \ # Update repository signing keys # -------------------------------------------------------------------------------------------------------- # Hyperledger -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 && \ - # Sovrin - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 + # ======================================================================================================== # Plenum @@ -30,7 +29,8 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 && # echo "deb https://repo.sovrin.org/sdk/deb bionic master" >> /etc/apt/sources.list # TODO change this to official repo -RUN echo "deb [trusted=yes] http://209.141.41.82:8000/ packagedir/" >> /etc/apt/sources.list +RUN echo "deb https://hyperledger.jfrog.io/artifactory/indy focal stable" >> /etc/apt/sources.list +RUN echo "deb https://hyperledger.jfrog.io/artifactory/indy bionic master" >> /etc/apt/sources.list RUN apt-get update -y && apt-get install -y \ diff --git a/.github/workflows/publishRelease.yaml b/.github/workflows/publishRelease.yaml index 3d69cf4dbc..aa69d7ac11 100644 --- a/.github/workflows/publishRelease.yaml +++ b/.github/workflows/publishRelease.yaml @@ -10,6 +10,10 @@ on: - '!**' - "plenum/__version__.json" +permissions: + contents: write + pull-requests: write + jobs: release-infos: name: release-infos diff --git a/.github/workflows/reuseable_test.yaml b/.github/workflows/reuseable_test.yaml index 485de6a82f..254dfb07e1 100644 --- a/.github/workflows/reuseable_test.yaml +++ b/.github/workflows/reuseable_test.yaml @@ -14,7 +14,7 @@ jobs: indy_plenum_tests: name: Sliced Module Tests # Reference to workflow-setup job is required to access the GITHUB_REPOSITORY_NAME output. - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 # Fix for scacap/action-surefire-report out of memory error: # - https://github.com/ScaCap/action-surefire-report/issues/17 env: @@ -86,7 +86,7 @@ jobs: indy_plenum_module_tests: name: Module Tests # Reference to workflow-setup job is required to access the GITHUB_REPOSITORY_NAME output. - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: UBUNTU_VERSION: ${{ inputs.UBUNTU_VERSION }} container: diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 41cc936741..d8cbf3add1 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -5,6 +5,10 @@ on: tags: - setRelease-v** +permissions: + contents: write + pull-requests: write + jobs: taginfos: name: get Tag infos @@ -33,7 +37,7 @@ jobs: bump_version: name: Bump Version Number needs: taginfos - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out code uses: actions/checkout@v4 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 01a34f08b5..bc162e265a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,7 +1,7 @@ version: 2 build: - os: "ubuntu-20.04" + os: "ubuntu-22.04" tools: python: "3.6" diff --git a/build-scripts/ubuntu-2204/build-3rd-parties.sh b/build-scripts/ubuntu-2204/build-3rd-parties.sh index 03be8f31ef..3c30762b69 100755 --- a/build-scripts/ubuntu-2204/build-3rd-parties.sh +++ b/build-scripts/ubuntu-2204/build-3rd-parties.sh @@ -3,7 +3,8 @@ set -e set -x -OUTPUT_PATH=${1:-.} +# Ensure the output is an absolute path and not a relative path +OUTPUT_PATH="$(realpath -m ${1:-.})" wheel2debconf="$(dirname "$(realpath "$0")")"/wheel2deb.yml @@ -23,6 +24,7 @@ function build_rocksdb_deb { # Install it in the system as it is needed by python-rocksdb. make install cd - + mkdir -p ${OUTPUT_PATH} cp /tmp/rocksdb/package/rocksdb_${VERSION}_amd64.deb $OUTPUT_PATH rm -rf /tmp/rocksdb } @@ -140,7 +142,7 @@ pushd `dirname ${SCRIPT_PATH}` >/dev/null # Install any python requirements needed for the builds. pip install -r requirements.txt -pip3 install wheel2deb && apt-get install -y debhelper +pip3 install wheel2deb && apt update && apt install -y debhelper apt-get install -y cython3 # Build rocksdb at first diff --git a/build-scripts/ubuntu-2204/build-plenum.sh b/build-scripts/ubuntu-2204/build-plenum.sh index 8ec1c3dfb5..db0120614f 100755 --- a/build-scripts/ubuntu-2204/build-plenum.sh +++ b/build-scripts/ubuntu-2204/build-plenum.sh @@ -27,7 +27,7 @@ fpm --input-type "python" \ --verbose \ --python-package-name-prefix "python3"\ --python-bin "/usr/bin/python3" \ - --exclude "usr/local/lib/python3.8/dist-packages/data" \ + --exclude "usr/local/lib/python3.10/dist-packages/data" \ --exclude "usr/local/bin" \ --exclude "*.pyc" \ --exclude "*.pyo" \ diff --git a/build-scripts/ubuntu-2204/postinst b/build-scripts/ubuntu-2204/postinst index 31b5145050..bd8a31d2a8 100644 --- a/build-scripts/ubuntu-2204/postinst +++ b/build-scripts/ubuntu-2204/postinst @@ -2,7 +2,7 @@ # Automatically added from template: if which py3compile >/dev/null 2>&1; then - py3compile -O -p {package_name} /usr/local/lib/python3.8/dist-packages/ + py3compile -O -p {package_name} /usr/local/lib/python3.10/dist-packages/ fi # End automatically added section diff --git a/plenum/__version__.json b/plenum/__version__.json index 9aeee5109b..50db741aed 100644 --- a/plenum/__version__.json +++ b/plenum/__version__.json @@ -1 +1 @@ -[1, 13, 1, "", ""] +[1, 13, 2, "rc", 20] diff --git a/plenum/server/consensus/ordering_service.py b/plenum/server/consensus/ordering_service.py index 2eb349144a..62f2dd0890 100644 --- a/plenum/server/consensus/ordering_service.py +++ b/plenum/server/consensus/ordering_service.py @@ -1910,7 +1910,7 @@ def dequeue_pre_prepares(self): r = 0 while self.prePreparesPendingPrevPP and self._can_dequeue_pre_prepare( *self.prePreparesPendingPrevPP.keys()[0]): - _, (pp, sender) = self.prePreparesPendingPrevPP.popitem(index=0) + _, (pp, sender) = self.prePreparesPendingPrevPP.popitem(0) if not self._can_pp_seq_no_be_in_view(pp.viewNo, pp.ppSeqNo): self._discard(pp, "Pre-Prepare from a previous view", logger.debug) diff --git a/setup.py b/setup.py index 96aa05298d..da247ede39 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ def run(self): # Pinned because of changing size of `crypto_sign_SECRETKEYBYTES` from 32 to 64 'libnacl==1.6.1', # 'msgpack-python==0.5.6', - 'msgpack-python', + 'msgpack==0.5.6', # 'orderedset==2.0.3', 'orderedset', # 'packaging==20.9', @@ -123,7 +123,7 @@ def run(self): # 'python-dateutil==2.8.1', 'python-dateutil', # 'python-rocksdb==0.7.0', - 'python-rocksdb', + 'python-rocksdb==0.7.0', 'python-ursa==0.1.1', ### Tests fail without version pin (GHA run: https://github.com/udosson/indy-plenum/actions/runs/1078745445) 'rlp==2.0.0',