Skip to content

Commit

Permalink
Merge branch 'beatrice' into 'master'
Browse files Browse the repository at this point in the history
Mainnet release

See merge request PBSA/peerplays!251
  • Loading branch information
bobinson committed Oct 6, 2023
2 parents 058937a + 97e85a8 commit 1f70857
Show file tree
Hide file tree
Showing 144 changed files with 10,831 additions and 6,594 deletions.
66 changes: 56 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ stages:
- build
- test
- dockerize
- python-test
- deploy

build-mainnet:
stage: build
Expand Down Expand Up @@ -44,12 +46,11 @@ test-mainnet:

dockerize-mainnet:
stage: dockerize
dependencies:
- test-mainnet
variables:
IMAGE: $CI_REGISTRY_IMAGE/mainnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
before_script:
- docker info
- docker builder prune -a -f
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --no-cache -t $IMAGE .
Expand All @@ -58,8 +59,6 @@ dockerize-mainnet:
- docker rmi $IMAGE
tags:
- builder
when:
manual
timeout:
3h

Expand All @@ -80,12 +79,27 @@ build-testnet:
- build/libraries/
- build/programs/
- build/tests/
when: manual
tags:
- builder
when:
manual
timeout:
3h

deploy-testnet:
stage: deploy
dependencies:
- build-testnet
script:
- sudo systemctl stop witness
- rm $WORK_DIR/peerplays/witness_node || true
- cp build/programs/witness_node/witness_node $WORK_DIR/peerplays/
- sudo systemctl restart witness
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
environment:
name: devnet
url: $DEVNET_URL
tags:
- devnet

test-testnet:
stage: test
Expand All @@ -105,8 +119,6 @@ test-testnet:

dockerize-testnet:
stage: dockerize
dependencies:
- test-testnet
variables:
IMAGE: $CI_REGISTRY_IMAGE/testnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
before_script:
Expand All @@ -123,3 +135,37 @@ dockerize-testnet:
manual
timeout:
3h

test-e2e:
stage: python-test
variables:
IMAGE: $CI_REGISTRY_IMAGE/mainnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
before_script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- git clone https://gitlab.com/PBSA/tools-libs/peerplays-utils.git
- cd peerplays-utils/peerplays-qa-environment
- git checkout origin/feature/python-e2e-tests-for-CI
- cd e2e-tests/
- python3 -m venv venv
- source venv/bin/activate
- pip3 install -r requirements.txt
- docker-compose down --remove-orphans
- docker ps -a
- docker pull $IMAGE
- docker tag $IMAGE peerplays-base:latest
- docker image ls -a
- docker-compose build
- python3 main.py --start all
- docker ps -a
- python3 -m pytest test_btc_init_state.py test_hive_inital_state.py test_pp_inital_state.py
- python3 main.py --stop
- deactivate
- docker ps -a
after_script:
- docker rmi $(docker images -a | grep -v 'hive-for-peerplays\|ethereum-for-peerplays\|bitcoin-for-peerplays\|ubuntu-for-peerplays' | awk '{print $3}')
tags:
- python-tests
when:
manual
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[submodule "libraries/fc"]
path = libraries/fc
url = https://gitlab.com/PBSA/tools-libs/peerplays-fc.git
branch = latest-fc
branch = develop
ignore = dirty
120 changes: 101 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM ubuntu:20.04
MAINTAINER Peerplays Blockchain Standards Association

#===============================================================================
# Ubuntu setup
Expand All @@ -11,15 +10,14 @@ RUN \
apt-utils \
autoconf \
bash \
bison \
build-essential \
ca-certificates \
cmake \
dnsutils \
doxygen \
expect \
flex \
git \
graphviz \
libboost1.67-all-dev \
libbz2-dev \
libcurl4-openssl-dev \
libncurses-dev \
Expand All @@ -35,7 +33,6 @@ RUN \
ntp \
openssh-server \
pkg-config \
perl \
python3 \
python3-jinja2 \
sudo \
Expand All @@ -53,43 +50,126 @@ RUN echo 'peerplays:peerplays' | chpasswd
# SSH
EXPOSE 22

WORKDIR /home/peerplays/src

#===============================================================================
# libzmq setup
# Boost setup
#===============================================================================

WORKDIR /home/peerplays/
RUN \
wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz && \
tar -xzf boost_1_72_0.tar.gz && \
cd boost_1_72_0 && \
./bootstrap.sh && \
./b2 install && \
ldconfig && \
rm -rf /home/peerplays/src/*

#===============================================================================
# cmake setup
#===============================================================================

RUN \
wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh && \
chmod 755 ./cmake-3.24.2-linux-x86_64.sh && \
./cmake-3.24.2-linux-x86_64.sh --prefix=/usr --skip-license && \
cmake --version && \
rm -rf /home/peerplays/src/*

#===============================================================================
# libzmq setup
#===============================================================================

RUN \
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.zip && \
unzip v4.3.4.zip && \
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.tar.gz && \
tar -xzvf v4.3.4.tar.gz && \
cd libzmq-4.3.4 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) install && \
ldconfig
make -j$(nproc) && \
make install && \
ldconfig && \
rm -rf /home/peerplays/src/*

#===============================================================================
# cppzmq setup
#===============================================================================

WORKDIR /home/peerplays/
RUN \
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.9.0.tar.gz && \
tar -xzvf v4.9.0.tar.gz && \
cd cppzmq-4.9.0 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig && \
rm -rf /home/peerplays/src/*

#===============================================================================
# gsl setup
#===============================================================================

RUN \
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.8.1.zip && \
unzip v4.8.1.zip && \
cd cppzmq-4.8.1 && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libpcre3-dev

RUN \
wget https://github.com/imatix/gsl/archive/refs/tags/v4.1.4.tar.gz && \
tar -xzvf v4.1.4.tar.gz && \
cd gsl-4.1.4 && \
make -j$(nproc) && \
make install && \
rm -rf /home/peerplays/src/*

#===============================================================================
# libbitcoin-build setup
# libbitcoin-explorer setup
#===============================================================================

RUN \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libsodium-dev

RUN \
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git && \
cd libbitcoin-explorer && \
./install.sh && \
ldconfig && \
rm -rf /home/peerplays/src/*

#===============================================================================
# Doxygen setup
#===============================================================================

RUN \
sudo apt install -y bison flex && \
wget https://github.com/doxygen/doxygen/archive/refs/tags/Release_1_8_17.tar.gz && \
tar -xvf Release_1_8_17.tar.gz && \
cd doxygen-Release_1_8_17 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) install && \
ldconfig

#===============================================================================
# Peerplays setup
# Perl setup
#===============================================================================

WORKDIR /home/peerplays/
RUN \
wget https://github.com/Perl/perl5/archive/refs/tags/v5.30.0.tar.gz && \
tar -xvf v5.30.0.tar.gz && \
cd perl5-5.30.0 && \
./Configure -des && \
make -j$(nproc) install && \
ldconfig

#===============================================================================
# Peerplays setup
#===============================================================================

## Clone Peerplays
#RUN \
Expand All @@ -106,6 +186,8 @@ ADD . peerplays
# Configure Peerplays
RUN \
cd peerplays && \
git submodule update --init --recursive && \
git log --oneline -n 5 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release ..
Expand All @@ -119,8 +201,8 @@ WORKDIR /home/peerplays/peerplays-network

# Setup Peerplays runimage
RUN \
ln -s /home/peerplays/peerplays/build/programs/cli_wallet/cli_wallet ./ && \
ln -s /home/peerplays/peerplays/build/programs/witness_node/witness_node ./
ln -s /home/peerplays/src/peerplays/build/programs/cli_wallet/cli_wallet ./ && \
ln -s /home/peerplays/src/peerplays/build/programs/witness_node/witness_node ./

RUN ./witness_node --create-genesis-json genesis.json && \
rm genesis.json
Expand Down
Loading

0 comments on commit 1f70857

Please sign in to comment.