Skip to content

added reference to new hot-fixed IMA beta #550

added reference to new hot-fixed IMA beta

added reference to new hot-fixed IMA beta #550

Workflow file for this run

name: Comprehensive test
on:
push:
branches-ignore:
- 'docs-v*'
pull_request:
branches-ignore:
- 'docs-v*'
jobs:
cancel-runs:
name: Cancel Previous Runs
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
test-comprehensive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: oven-sh/setup-bun@v1
- name: INFO - github environment variable checks
run: |
echo ------------ GIT_CURRENT_BRANCH
export GIT_CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo $GIT_CURRENT_BRANCH
echo ------------ GIT_SYMBOLIC_BRANCH
export GIT_SYMBOLIC_BRANCH=$(git symbolic-ref --short HEAD)
echo $GIT_SYMBOLIC_BRANCH
echo ------------ GITHUB_WORKFLOW
echo $GITHUB_WORKFLOW
echo ------------ GITHUB_RUN_ID
echo $GITHUB_RUN_ID
echo ------------ GITHUB_RUN_NUMBER
echo $GITHUB_RUN_NUMBER
echo ------------ GITHUB_ACTION
echo $GITHUB_ACTION
echo ------------ GITHUB_ACTIONS
echo $GITHUB_ACTIONS
echo ------------ GITHUB_ACTOR
echo $GITHUB_ACTOR
echo ------------ GITHUB_REPOSITORY
echo $GITHUB_REPOSITORY
echo ------------ GITHUB_EVENT_NAME
echo $GITHUB_EVENT_NAME
echo ------------ GITHUB_EVENT_PATH
echo $GITHUB_EVENT_PATH
echo ------------ GITHUB_WORKSPACE
echo $GITHUB_WORKSPACE
echo ------------ GITHUB_SHA
echo $GITHUB_SHA
echo ------------ GITHUB_REF
echo $GITHUB_REF
echo ------------ GITHUB_HEAD_REF
echo $GITHUB_HEAD_REF
echo ------------ GITHUB_BASE_REF
echo $GITHUB_BASE_REF
- name: INFO - user information checks
run: |
echo ------------ user
echo $USER
echo ------------ home
echo $HOME
echo ------------ path
echo $PATH
- name: INFO - system information checks
run: |
echo ------------ pwd
pwd
echo ------------ unix name - a
uname -a || true
echo ------------ unix name - r
uname -r || true
echo ------------ lsb_release - cat
cat /etc/lsb-release
echo ------------ lsb_release - a
lsb_release -a || true
echo ------------ hostnamectl
hostnamectl || true
echo ------------ /etc/os-release
cat /etc/os-release || true
echo ------------ /proc/version
cat /proc/version || true
echo ------------ lscpu
lscpu || true
- name: UPDATE - system deps and install libc6, net-tools, btrfs-progs, zip, unzip, bash, procps, curl
run: |
sudo apt-get update
sudo apt-get install -y libc6 net-tools btrfs-progs zip unzip build-essential
sudo apt-get install -y bash
sudo apt-get install -y procps
sudo apt-get install -y curl
- name: INIT - install docker
run: |
sudo apt-get remove -y docker* containerd* || true
curl -fsSL https://get.docker.com -o install-docker.sh
sudo sh install-docker.sh
docker --version
docker-compose --version
- name: INIT - reconfigure docker and restart its daemon
run: |
sudo systemctl unmask docker
sudo groupadd docker || true
sudo gpasswd -a username docker || true
sudo service docker restart || true
- name: INIT - uninstall old Node JS if any
run: |
sudo npm cache clean -f || true &> /dev/null
sudo apt-get remove -y nodejs npm node -y || true &> /dev/null
sudo apt-get purge -y nodejs -y || true &> /dev/null
sudo apt-get autoremove -y || true &> /dev/null
sudo rm -rf /usr/bin/node || true &> /dev/null
sudo rm -rf /usr/include/node || true &> /dev/null
sudo rm -rf /usr/lib/node_modules || true &> /dev/null
sudo rm -rf /usr/local/bin/npm || true &> /dev/null
sudo rm -rf /usr/local/share/man/man1/node* || true &> /dev/null
sudo rm -rf /usr/local/lib/dtrace/node.d || true &> /dev/null
sudo rm -rf ~/.npm || true &> /dev/null
sudo rm -rf ~/.node-gyp || true &> /dev/null
sudo rm -rf /opt/local/bin/node || true &> /dev/null
sudo rm -rf /opt/local/include/node || true &> /dev/null
sudo rm -rf /opt/local/lib/node_modules || true &> /dev/null
sudo rm -rf /usr/local/lib/node* || true &> /dev/null
sudo rm -rf /usr/local/include/node* || true &> /dev/null
sudo rm -rf /usr/local/bin/node* || true &> /dev/null
- name: INIT - install Node JS
run: |
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt-get install -y nodejs
sudo ln -s /usr/bin/node /usr/local/bin/node || true
- name: INIT - install Node utilities
run: |
sudo npm install --global npm
sudo npm install --global color-support
sudo npm install --global yarn
sudo npm install --global node-gyp
- name: INIT - version checks of Node JS and its utilities
run: |
which node
node --version
which npx
npx --version
which npm
npm --version
which yarn
yarn --version
which node-gyp
node-gyp --version
- name: INIT - version checks of Bun SH
run: |
which bun
bun --version
- name: INIT - Download comprehensive-test
working-directory: ${{env.working-directory}}
run: |
export IMA_AGENT_ROOT_DIR=$(pwd)
echo IMA_AGENT_ROOT_DIR = $IMA_AGENT_ROOT_DIR
git clone https://github.com/skalenetwork/comprehensive-test.git --recursive
- name: INIT - install Ethereum Main Net emulation
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
pwd
cd cli-hh
./clean.sh
./init.sh
cd ../..
- name: INIT - startup Ethereum Main Net emulation
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd cli-hh
./run.sh &> ../local_mainnet_output_log.txt &
cd ../..
- name: INIT - Install PYTHON
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: INIT - Install everything in IMA
working-directory: ${{env.working-directory}}
run: |
yarn install
- name: INIT - build IMA
working-directory: ${{env.working-directory}}
run: |
yarn rebuild
- name: INIT - initialize comprehensive test tokens
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test/test_tokens
yarn install
cd ../..
- name: INIT - initialize S-Chain configuration creator
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd s_chain_gen
yarn install
cd ..
cd ..
- name: INIT - initialize S-Chain configuration creator
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd s_chain_gen
yarn install
cd ..
cd ..
- name: INIT - check skaled can run
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
export DETECTED_UBUNTU_VERSION=$(lsb_release -r | cut -f2)
export TRYING_SKALED_AT_PATH=./app_cache/bin_$DETECTED_UBUNTU_VERSION/skaled
$TRYING_SKALED_AT_PATH --colors --version
$TRYING_SKALED_AT_PATH --help
cd ..
- name: INIT - generate configuration files for S-Chain nodes
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd s_chain_gen
./init.sh
cd ../..
- name: INIT - download Skale Manager
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
git clone https://github.com/skalenetwork/skale-manager.git --recursive
cd ..
- name: INIT - install Skale Manager dependencies
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd skale-manager
yarn install
cd ../..
- name: INIT - install comprehensive engine dependencies
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd engine
yarn install
cd ../..
- name: SELF-TEST A - use IMA to browse S-Chain via node 00-00 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.1:2164 || true
- name: SELF-TEST B - use IMA to browse S-Chain via node 00-01 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.2:2264 || true
- name: SELF-TEST C - use IMA to browse S-Chain via node 01-00 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.3:2364 || true
- name: SELF-TEST D - use IMA to browse S-Chain via node 01-01 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.4:2464 || true
- name: INIT - download SGX Wallet
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
git clone https://github.com/skalenetwork/sgxwallet.git --recursive
cd sgxwallet
git checkout develop
git fetch
git pull
git branch
git status
cd ..
cd ..
- name: INIT - update docker image SGX Wallet in the emulation mode
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd sgxwallet/run_sgx_sim
rm -rf ../../local_sgxwallet_output_log.txt &> /dev/null
echo " --------------------------- stopping sgx wallet ------------------------------------------------------------------------------------------------------ "
docker-compose down
echo " --------------------------- fixing sgx wallets docker config ----------------------------------------------------------------------------------------- "
mv docker-compose.yml docker-compose.yml.old-previous || true
echo "version: '3'" > docker-compose.yml
echo 'services:' >> docker-compose.yml
echo ' sgxwallet:' >> docker-compose.yml
echo ' image: skalenetwork/sgxwallet_sim:1.83.0-develop.19' >> docker-compose.yml
echo ' restart: unless-stopped' >> docker-compose.yml
echo ' ports:' >> docker-compose.yml
echo ' - "1026:1026"' >> docker-compose.yml
echo ' - "1027:1027"' >> docker-compose.yml
echo ' - "1028:1028"' >> docker-compose.yml
echo ' - "1029:1029"' >> docker-compose.yml
echo ' - "1030:1030"' >> docker-compose.yml
echo ' - "1031:1031"' >> docker-compose.yml
echo ' volumes:' >> docker-compose.yml
echo ' - ./sgx_data:/usr/src/sdk/sgx_data' >> docker-compose.yml
echo ' - /dev/urandom:/dev/random' >> docker-compose.yml
echo ' logging:' >> docker-compose.yml
echo ' driver: json-file' >> docker-compose.yml
echo ' options:' >> docker-compose.yml
echo ' max-size: "10m"' >> docker-compose.yml
echo ' max-file: "4"' >> docker-compose.yml
echo ' command: -s -y -V -d' >> docker-compose.yml
echo " --------------------------- pulling sgx wallet ------------------------------------------------------------------------------------------------------- "
docker-compose pull
cd ../..
cd ..
- name: INIT - start SGX Wallet
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd sgxwallet/run_sgx_sim
docker-compose up &> ../../local_sgxwallet_output_log.txt &
sleep 90
cd ../..
cd ..
- name: INIT - check SGX Wallet has listening ports
working-directory: ${{env.working-directory}}
run: |
echo "sleeping 45 seconds..."
sleep 45
echo "checking port 1026 commonly used by SGX Wallet for HTTPS..."
sudo netstat -tulpn | grep 1026
echo "...Done"
echo "checking port 1027 commonly used by SGX Wallet for HTTP..."
sudo netstat -tulpn | grep 1027
echo "...Done"
- name: INIT - download transaction manager
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
rm -rf transaction-manager || true
git clone https://github.com/skalenetwork/transaction-manager --recursive
cd ..
- name: INIT - start transaction manager and redis
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd transaction-manager
export SGX_SERVER_URL=http://127.0.0.1:1027
export ENDPOINT=http://127.0.0.1:8545
export ETH_PRIVATE_KEY=23ABDBD3C61B5330AF61EBE8BEF582F4E5CC08E554053A718BDCE7813B9DC1FC
./scripts/run-test-containers.sh
cd ..
echo "------------------------------------------------------------------------------------"
docker ps
echo "------------------------------------------------------------------------------------"
export TM_CONTAINER_ID=$(docker ps | grep transaction-manager | awk '{print $1;}')
echo "Transaction manager docker container ID:" $TM_CONTAINER_ID
docker logs $TM_CONTAINER_ID -f &> engine/tm.log &
echo "------------------------------------------------------------------------------------"
export REDIS_CONTAINER_ID=$(docker ps | grep redis | awk '{print $1;}')
echo "Redis container ID:" $REDIS_CONTAINER_ID
docker logs $REDIS_CONTAINER_ID -f &> engine/redis.log &
cd ..
- name: INIT - prepare ulimit
working-directory: ${{env.working-directory}}
run: |
ulimit -n 65535 > /dev/null
echo "ulimit is now set to" $(ulimit -n)
- name: RUN - create certificates
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd engine/create_pems
./create_pems.sh
cd ../..
cd ..
- name: RUN - main engine steps
working-directory: ${{env.working-directory}}
run: |
export IMA_AGENT_ROOT_DIR=$(pwd)
echo IMA_AGENT_ROOT_DIR = $IMA_AGENT_ROOT_DIR
cd comprehensive-test/engine
export ALL_SKALE_TEST_CLOUD_RUN=1
export SEPARATED_IMA_AGENT_MODE=1
node ./index.js
cd ../..
- name: SHUTDOWN - stop SGX Wallet
run: |
cd comprehensive-test
cd sgxwallet/run_sgx_sim
docker-compose down
cd ../..
cd ..
- name: SHUTDOWN - stop transaction manager and redis
run: |
docker stop $TM_CONTAINER_ID $REDIS_CONTAINER_ID || true
docker rm $TM_CONTAINER_ID $REDIS_CONTAINER_ID || true
- name: SHUTDOWN - zombie cleanup, if any
run: |
killall -9 skaled node npx python python3 || true
pkill -9 -f skaled || true