Skip to content

Commit

Permalink
Merge pull request #65 from skalenetwork/ticket-35-improved-ga-scripts
Browse files Browse the repository at this point in the history
Ticket 35 improved ga scripts
  • Loading branch information
sergiy-skalelabs authored Jan 25, 2024
2 parents 9c0f6af + ece6c73 commit 9278b67
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 672 deletions.
264 changes: 28 additions & 236 deletions .github/workflows/comprehensive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,98 +5,23 @@ 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:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- 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
Expand Down Expand Up @@ -142,35 +67,15 @@ jobs:
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
uses: actions/setup-node@v4
with:
node-version: 18

- 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
- name: INIT - install Node utilities
run: |
which bun
bun --version
npm install --global npx || true
npm install --global yarn
npm install --global node-gyp
- name: INIT - Download comprehensive-test
working-directory: ${{env.working-directory}}
Expand All @@ -185,17 +90,16 @@ jobs:
cd comprehensive-test
pwd
cd cli-hh
./clean.sh
export PATH=$PATH:$(dirname $(which npx))
yarn install
./clean.sh || true
./init.sh
cd ../..
- name: INIT - startup Ethereum Main Net emulation
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd cli-hh
cd comprehensive-test/cli-hh
./run.sh &> ../local_mainnet_output_log.txt &
cd ../..
- name: INIT - Install PYTHON
uses: actions/setup-python@v2
Expand All @@ -217,25 +121,12 @@ jobs:
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
cd comprehensive-test/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}}
Expand All @@ -245,58 +136,31 @@ jobs:
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
export PATH=$PATH:$(dirname $(which npx))
cd comprehensive-test/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
cd comprehensive-test/skale-manager
yarn install
cd ../..
- name: INIT - install comprehensive engine dependencies
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd engine
cd comprehensive-test/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}}
Expand All @@ -309,54 +173,21 @@ jobs:
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
cd comprehensive-test/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
cd comprehensive-test/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}}
Expand All @@ -370,36 +201,6 @@ jobs:
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: |
Expand All @@ -409,11 +210,8 @@ jobs:
- name: RUN - create certificates
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd engine/create_pems
cd comprehensive-test/engine/create_pems
./create_pems.sh
cd ../..
cd ..
- name: RUN - main engine steps
working-directory: ${{env.working-directory}}
Expand All @@ -422,22 +220,16 @@ jobs:
echo IMA_AGENT_ROOT_DIR = $IMA_AGENT_ROOT_DIR
cd comprehensive-test/engine
export ALL_SKALE_TEST_CLOUD_RUN=1
export DISABLE_S2S_TESTS=0
export SEPARATED_IMA_AGENT_MODE=1
export PATH=$PATH:$(dirname $(which npx))
node ./index.js
cd ../..
- name: SHUTDOWN - stop SGX Wallet
working-directory: ${{env.working-directory}}
run: |
cd comprehensive-test
cd sgxwallet/run_sgx_sim
cd comprehensive-test/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: |
Expand Down
Loading

0 comments on commit 9278b67

Please sign in to comment.