Repository: hyperledger/indy-node (language: python)

Issue:
Rework Buildimage and Pipeline due to Circular Dependency of Rocksdb in Build Image
Same as https://github.com/hyperledger/indy-plenum/issues/1634

- [x]  move to a slimmed down buildimage(only the dependencies needed for creating the package),

 - [x]  rearrange the pipeline so that it installs node with the just built package for testing, which should pull in all the required dependencies.
 - [x]  rework the indy-shared-gha call of the jfrog-cli to be able to override/update files (maybe just permissions for the token )


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/PR.yaml b/.github/workflows/PR.yaml
index 1d491c45b..ce507a035 100644
--- a/.github/workflows/PR.yaml
+++ b/.github/workflows/PR.yaml
@@ -56,17 +56,9 @@ jobs:
       DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/node-build
       UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
 
-  indy_node_tests:
-    name: Indy Node Tests
-    needs: [workflow-setup, build-image]
-    uses: ./.github/workflows/reuseable_test.yaml
-    with:
-      GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
-      UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
-
   build_packages:
     name: Build Packages
-    needs: [workflow-setup, indy_node_tests]
+    needs: [workflow-setup, build-image]
     uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@v1
     with:
       DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/node-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
@@ -75,10 +67,18 @@ jobs:
       isRC: false
       moduleName: indy_node
 
+  indy_node_tests:
+    name: Indy Node Tests
+    needs: [workflow-setup, build_packages]
+    uses: ./.github/workflows/reuseable_test.yaml
+    with:
+      GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
+      UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
+
   statusCheck:
     name: statusCheck
     runs-on: ubuntu-latest
-    needs: [workflow-setup, build_packages]
+    needs: [workflow-setup, indy_node_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
diff --git a/.github/workflows/Push.yaml b/.github/workflows/Push.yaml
index 5099ac9a4..aad1792ce 100644
--- a/.github/workflows/Push.yaml
+++ b/.github/workflows/Push.yaml
@@ -3,6 +3,7 @@ on:
   push:
     branches:
       - ubuntu-20.04-upgrade
+      - rocksdbfix
     paths:
       - '**.py'
       - '.github/**'
@@ -43,17 +44,9 @@ jobs:
       DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/node-build
       UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
 
-  indy_node_tests:
-    name: Indy Node Tests
-    needs: [workflow-setup, build-image]
-    uses: ./.github/workflows/reuseable_test.yaml
-    with:
-      GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
-      UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
-
   build_packages:
     name: Build Packages
-    needs: [workflow-setup, indy_node_tests]
+    needs: [workflow-setup, build-image]
     uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@v1
     with:
       DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/node-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
@@ -62,9 +55,17 @@ jobs:
       isRC: false
       moduleName: indy_node
 
+  indy_node_tests:
+    name: Indy Node Tests
+    needs: [workflow-setup, build_packages]
+    uses: ./.github/workflows/reuseable_test.yaml
+    with:
+      GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
+      UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
+
   publish_artifacts:
     name: Publish Artifacts
-    needs: [workflow-setup, build_packages]
+    needs: [workflow-setup, indy_node_tests]
     if: needs.workflow-setup.outputs.publish == 'true'
     uses: hyperledger/indy-shared-gha/.github/workflows/publish_artifacts.yaml@v1
     with:
diff --git a/.github/workflows/build/Dockerfile.ubuntu-2004 b/.github/workflows/build/Dockerfile.ubuntu-2004
index 39991dc4b..1d2616577 100644
--- a/.github/workflows/build/Dockerfile.ubuntu-2004
+++ b/.github/workflows/build/Dockerfile.ubuntu-2004
@@ -26,48 +26,13 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 &&
 # Plenum
 #  - https://github.com/hyperledger/indy-plenum/issues/1546
 #  - Needed to pick up rocksdb=5.8.8
-RUN echo "deb  https://hyperledger.jfrog.io/artifactory/indy focal dev"  >> /etc/apt/sources.list && \
+RUN echo "deb  https://hyperledger.jfrog.io/artifactory/indy focal dev rc main"  >> /etc/apt/sources.list && \
     echo "deb http://security.ubuntu.com/ubuntu bionic-security main"  >> /etc/apt/sources.list && \
     echo "deb https://repo.sovrin.org/deb bionic master" >> /etc/apt/sources.list && \
     echo "deb https://repo.sovrin.org/sdk/deb bionic master" >> /etc/apt/sources.list
 
-RUN apt-get update -y && apt-get install -y \
-    # Python
-    python3-pip \
-    python3-nacl \
-    # rocksdb python wrapper
-    rocksdb=5.8.8 \
-    libgflags-dev \
-    libsnappy-dev \
-    zlib1g-dev \
-    libbz2-dev \
-    liblz4-dev \
-    libgflags-dev \
-    # zstd is needed for caching in github actions pipeline
-    zstd \
-    # fpm
-    ruby \
-    ruby-dev \
-    rubygems \
-    gcc \
-    make \
-    # Indy Node and Plenum
-    libssl1.0.0 \
-    ursa=0.3.2-1 \
-    # Indy SDK
-    libindy=1.15.0~1625-bionic \
-    # Need to move libursa.so to parent dir
-    && mv /usr/lib/ursa/* /usr/lib && rm -rf /usr/lib/ursa
-
-RUN pip3 install -U \
-    # Required by setup.py
-    setuptools==50.3.2 \
-    'pyzmq==22.3.0'
-
+RUN apt-get update -y && apt-get install -y rubygems python3-pip && apt-get -y autoremove && rm -rf /var/lib/apt/lists/* 
 
 # install fpm
 RUN gem install --no-document rake 
 RUN gem install --no-document fpm -v 1.14.2
-
-RUN apt-get -y autoremove \
-    && rm -rf /var/lib/apt/lists/*
diff --git a/.github/workflows/releasepr.yaml b/.github/workflows/releasepr.yaml
index 44ac6c918..6ec56418e 100644
--- a/.github/workflows/releasepr.yaml
+++ b/.github/workflows/releasepr.yaml
@@ -49,20 +49,9 @@ jobs:
       DOCKER_IMAGE: ghcr.io/${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}/node-build
       UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
 
-
-  indy_node_tests:
-    name: Indy Node Tests
-    needs: [release-infos, build-docker-image]
-    if: needs.release-infos.outputs.isVersionBump == 'true'
-    uses: ./.github/workflows/reuseable_test.yaml
-    with:
-      GITHUB_REPOSITORY_NAME: ${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}
-      UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
-
-
   build_packages:
     name: Build Packages
-    needs: [release-infos, indy_node_tests]
+    needs: [release-infos, build-docker-image]
     if: needs.release-infos.outputs.isVersionBump == 'true'
     uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@v1
     with:
@@ -72,9 +61,18 @@ jobs:
       isRC: '${{ needs.release-infos.outputs.isPreRelease }}'
       moduleName: indy_node
 
+  indy_node_tests:
+    name: Indy Node Tests
+    needs: [release-infos, build_packages]
+    if: needs.release-infos.outputs.isVersionBump == 'true'
+    uses: ./.github/workflows/reuseable_test.yaml
+    with:
+      GITHUB_REPOSITORY_NAME: ${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}
+      UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
+
   statusCheck:
     name: statusCheck
     runs-on: ubuntu-latest
-    needs: [build_packages]
+    needs: [indy_node_tests]
     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
diff --git a/build-scripts/ubuntu-2004/build-indy_node.sh b/build-scripts/ubuntu-2004/build-indy_node.sh
index 1035f28ed..c52b46c36 100755
--- a/build-scripts/ubuntu-2004/build-indy_node.sh
+++ b/build-scripts/ubuntu-2004/build-indy_node.sh
@@ -16,7 +16,7 @@ cd "${TMP_DIR}/build-scripts/ubuntu-2004"
 ./prepare-package.sh "${TMP_DIR}" indy_node "${VERSION}" debian-packages
 
 echo "Fetching the indy-plenum version from setup.py and converting it to deb format ..."
-plenumDebVersion=$(grep -oP "indy-plenum==\d+.\d+.\d+((-|.)?rc\d+)?" ${TMP_DIR}/setup.py | grep -oP "\d+.\d+.\d+((-|.)?rc\d+)?" | sed 's/\./\~/3')
+plenumDebVersion=$(grep -oP "indy-plenum==\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" ${TMP_DIR}/setup.py | grep -oP "\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" | sed 's/\./\~/3')
 echo "plenumDebVersion: ${plenumDebVersion}"
 
 sed -i "s/{package_name}/${PACKAGE_NAME}/" "prerm"
diff --git a/setup.py b/setup.py
index b90f45f80..23c554cd8 100644
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@
 
     # Update ./build-scripts/ubuntu-xxxx/build-3rd-parties.sh when this list gets updated.
     # - Excluding changes to indy-plenum.
-    install_requires=['indy-plenum==1.13.1.rc4',
+    install_requires=['indy-plenum==1.13.1.dev1677853403',
                     # importlib-metadata needs to be pinned to 3.10.1 because from v4.0.0 the package
                     # name ends in python3-importlib-metadata_0.0.0_amd64.deb
                     # see also build-scripts/ubuntu-2004/build-3rd-parties.sh


Test patch:
diff --git a/.github/workflows/reuseable_test.yaml b/.github/workflows/reuseable_test.yaml
index 63368b97e..0c6e3879c 100644
--- a/.github/workflows/reuseable_test.yaml
+++ b/.github/workflows/reuseable_test.yaml
@@ -46,6 +46,28 @@ jobs:
       #     key: ${{ runner.os }}-indy-node-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
       #     restore-keys: |
       #       ${{ runner.os }}-indy-node-pip-
+      - name: Download node deb
+        uses: actions/download-artifact@v3
+        with:
+          name: indy_node-deb
+
+      - name: Install dependencies from deb
+        run: |
+          apt update
+          function getDeps(){
+              echo "$(apt show ${1} 2>/dev/null  | grep -P "Depends: " | sed 's~Depends:~~g;s~(~~g;s~)~~g;s~>~~g;s~<~~g' |tr -d " \t\n\r" | tr "," "\n")";
+          }
+          aptStr=$(dpkg-deb -I $(pwd)/indy-node*.deb | grep -P "Depends: " | sed 's~Depends:~~g;s~(~~g;s~)~~g;s~>~~g;s~<~~g' | tr -d " \t\n\r" | tr "," "\n")
+          nodeStr="$(getDeps $(echo "$aptStr" | grep plenum))"
+          echo "Installing dependancies:" && \
+          echo ${aptStr} && \
+          echo ${fullStr}&& \
+          echo && \
+          apt install -y $(pwd)/indy-node*.deb $aptStr $nodeStr
+          #Libindy till it is set in dependencies
+          apt install -y libindy
+          ln -s /usr/lib/ursa/libursa.so /usr/lib/libursa.so
+        shell: bash
 
       - name: Install dependencies
         run: |