Skip to content

Commit

Permalink
Merge pull request #1709 from GuillaumeBourque-QC/ubuntu-22.04
Browse files Browse the repository at this point in the history
Use new apt cli and new repo coventions
  • Loading branch information
swcurran authored Feb 13, 2025
2 parents ff6203c + b9c203a commit 708972c
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 35 deletions.
28 changes: 18 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ 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 && \
# Bionic-Security
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
# Hyperledger
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 && \
gpg --export 9692C00E657DDE61 > /etc/apt/keyrings/hyperledger.gpg

# todo: Will be removed when libindy will have been replace by indy-vdr, askar, and indy-credx
# bionic key
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 && \
gpg --export 3B4FE6ACC0B21F32 > /etc/apt/keyrings/ubuntu-bionic.gpg
# sovrin key
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 && \
gpg --export CE7709D068DB5E88 > /etc/apt/keyrings/sovrin.gpg
# ========================================================================================================

# ToDo:
Expand All @@ -36,10 +41,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 jammy dev" >> /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 echo "deb [signed-by=/etc/apt/keyrings/hyperledger.gpg] https://hyperledger.jfrog.io/artifactory/indy jammy dev rc" > /etc/apt/sources.list.d/hyperledger.list

# todo: Will be removed when libindy will have been replace by indy-vdr, askar, and indy-credx
RUN echo "deb [signed-by=/etc/apt/keyrings/ubuntu-bionic.gpg] http://security.ubuntu.com/ubuntu bionic-security main" > /etc/apt/sources.list.d/ubuntu-bionic.list
RUN echo "deb [signed-by=/etc/apt/keyrings/sovrin.gpg] https://repo.sovrin.org/deb bionic master" > /etc/apt/sources.list.d/sovrin.list
RUN echo "deb [signed-by=/etc/apt/keyrings/sovrin.gpg] https://repo.sovrin.org/sdk/deb bionic master" >> /etc/apt/sources.list.d/sovrin.list


RUN apt-get update -y && apt-get install -y \
# Python
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/Push-manual.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Indy Plenum - Push Workflow manual dispatch
on:
workflow_dispatch:

jobs:
workflow-setup:
name: Initialize Workflow
runs-on: ubuntu-latest
outputs:
CACHE_KEY_BUILD: ${{ steps.setup.outputs.CACHE_KEY_BUILD }}
UBUNTU_VERSION: ${{ steps.setup.outputs.UBUNTU_VERSION }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.setup.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ steps.setup.outputs.distribution }}
publish: ${{ steps.setup.outputs.publish }}
steps:
- name: checkout source code
uses: actions/checkout@v4
- name: setup
id: setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@v1

lint:
name: Lint
uses: hyperledger/indy-shared-gha/.github/workflows/lint.yaml@v1

build-docker-image:
name: Create Builder Image
needs: [workflow-setup, lint]
uses: hyperledger/indy-shared-gha/.github/workflows/buildimage.yaml@v1
with:
CACHE_KEY_BUILD: ${{ needs.workflow-setup.outputs.CACHE_KEY_BUILD }}
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}

build_packages:
name: Build Packages
needs: [workflow-setup, build-docker-image]
uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@v1
with:
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
isDev: 'true'
isRC: 'false'
moduleName: plenum

plenum_tests:
name: Test Plenum
needs: [workflow-setup, lint, 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, plenum_tests]
if: needs.workflow-setup.outputs.publish == 'true'
uses: hyperledger/indy-shared-gha/.github/workflows/publish_artifacts.yaml@v1
with:
COMPONENT: 'dev'
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
distribution: ${{ needs.workflow-setup.outputs.distribution }}
moduleName: plenum
secrets:
INDY_ARTIFACTORY_REPO_CONFIG: ${{ secrets.INDY_ARTIFACTORY_REPO_CONFIG }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
53 changes: 30 additions & 23 deletions .github/workflows/build/Dockerfile.ubuntu-2204
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@ FROM ubuntu:22.04
ARG uid=1000
ARG user=indy

RUN apt-get update -y && apt-get install -y \
RUN apt update -y && apt install -y \
# common stuff
git \
wget \
gnupg \
apt-transport-https \
apt-utils\
wget\
curl\
jq\
gnupg
ca-certificates \
apt-utils \
curl \
jq

# ========================================================================================================
# Update repository signing keys
# Get 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 && \
# Bionic-Security
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
# Hyperledger
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 && \
gpg --export 9692C00E657DDE61 > /etc/apt/keyrings/hyperledger.gpg

# todo: Will be removed when libindy will have been replace by indy-vdr, askar, and indy-credx
# bionic key
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 && \
gpg --export 3B4FE6ACC0B21F32 > /etc/apt/keyrings/ubuntu-bionic.gpg
# sovrin key
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 && \
gpg --export CE7709D068DB5E88 > /etc/apt/keyrings/sovrin.gpg
# ========================================================================================================

# ToDo:
Expand All @@ -30,15 +36,16 @@ 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 jammy dev" >> /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 \
rubygems && \
gem install --no-document dotenv:2.8.1 fpm:1.15.0 && \
RUN echo "deb [signed-by=/etc/apt/keyrings/hyperledger.gpg] https://hyperledger.jfrog.io/artifactory/indy jammy dev rc" > /etc/apt/sources.list.d/hyperledger.list

# todo: Will be removed when libindy will have been replace by indy-vdr, askar, and indy-credx
RUN echo "deb [signed-by=/etc/apt/keyrings/ubuntu-bionic.gpg] http://security.ubuntu.com/ubuntu bionic-security main" > /etc/apt/sources.list.d/ubuntu-bionic.list
RUN echo "deb [signed-by=/etc/apt/keyrings/sovrin.gpg] https://repo.sovrin.org/deb bionic master" > /etc/apt/sources.list.d/sovrin.list
RUN echo "deb [signed-by=/etc/apt/keyrings/sovrin.gpg] https://repo.sovrin.org/sdk/deb bionic master" >> /etc/apt/sources.list.d/sovrin.list

RUN apt update -y && apt install -y rubygems python3-pip && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*

# install fpm
RUN gem install --no-document dotenv:2.8.1 fpm:1.15.0 && \
pip3 install Cython==0.29.36

3 changes: 1 addition & 2 deletions build-scripts/ubuntu-2204/build-3rd-parties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,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
apt-get install -y cython3
pip3 install wheel2deb && apt update && apt install -y debhelper cython3

# Build rocksdb at first
### Can be removed once the code has been updated to run with rocksdb v. 5.17
Expand Down
4 changes: 4 additions & 0 deletions plenum/test/validator_info/test_validator_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def test_validator_info_file_pool_fields_valid(looper, info, txnPoolNodesLooper,

others, disconnected = txnPoolNodeSet[:-1], txnPoolNodeSet[-1]
disconnect_node_and_ensure_disconnected(txnPoolNodesLooper, txnPoolNodeSet, disconnected)

# Wait for the information to be updated, if we dont pause, the test will fail 50 % of the time
looper.runFor(2)

latest_info = node._info_tool.info

assert latest_info['Pool_info']['Reachable_nodes_count'] == nodeCount - 1
Expand Down

0 comments on commit 708972c

Please sign in to comment.