Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration #9

Merged
merged 172 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
f7bce5a
test with assets
scx1332 Sep 25, 2024
5189756
test with assets
scx1332 Sep 25, 2024
1bef5af
test with assets
scx1332 Sep 25, 2024
b25c2dd
test with assets
scx1332 Sep 25, 2024
8c9410d
test with assets
scx1332 Sep 25, 2024
21893a2
test with assets
scx1332 Sep 25, 2024
aac27d9
test with assets
scx1332 Sep 25, 2024
e67c549
test with assets
scx1332 Sep 25, 2024
aa58987
test with assets
scx1332 Sep 25, 2024
a04227a
test with assets
scx1332 Sep 25, 2024
b2756c9
test with assets
scx1332 Sep 25, 2024
a5c7d88
test with assets
scx1332 Sep 25, 2024
6660d06
test with assets
scx1332 Sep 25, 2024
543dbc6
test with assets
scx1332 Sep 25, 2024
3e15765
test with assets
scx1332 Sep 25, 2024
2a1c4d2
test with assets
scx1332 Sep 25, 2024
1473740
test with assets
scx1332 Sep 25, 2024
59dcf75
test with assets
scx1332 Sep 25, 2024
2613477
test with assets
scx1332 Sep 25, 2024
1c76faa
test with assets
scx1332 Sep 25, 2024
ed8bc06
test with assets
scx1332 Sep 25, 2024
b09b67c
test with assets
scx1332 Sep 25, 2024
25589b1
test with assets
scx1332 Sep 25, 2024
8027f54
test with assets
scx1332 Sep 25, 2024
91d06a3
test with assets
scx1332 Sep 25, 2024
611a40f
test with assets
scx1332 Sep 25, 2024
4f953d9
test with assets
scx1332 Sep 25, 2024
be7cf2a
test with assets
scx1332 Sep 25, 2024
7410d08
test with assets
scx1332 Sep 25, 2024
c830988
test with assets
scx1332 Sep 25, 2024
82cedba
test with assets
scx1332 Sep 25, 2024
e47daa7
test with assets
scx1332 Sep 25, 2024
2ff4a2f
test with assets
scx1332 Sep 25, 2024
103d8a8
test with assets
scx1332 Sep 25, 2024
375c096
test with assets
scx1332 Sep 25, 2024
07b23db
test with assets
scx1332 Sep 25, 2024
52e09c0
test with assets
scx1332 Sep 25, 2024
de43e2c
test with assets
scx1332 Sep 25, 2024
483519f
test with assets
scx1332 Sep 25, 2024
687feb5
test with assets
scx1332 Sep 25, 2024
9777d56
test with assets
scx1332 Sep 25, 2024
da16452
test provision accounts
scx1332 Sep 25, 2024
c528ce6
test provision accounts
scx1332 Sep 25, 2024
8cb8b1c
test provision accounts
scx1332 Sep 25, 2024
06f87ca
test provision accounts
scx1332 Sep 25, 2024
941aa1f
test provision accounts
scx1332 Sep 25, 2024
cafa541
work on tests
scx1332 Sep 26, 2024
b256941
Merge branch 'refs/heads/main' into integration
scx1332 Sep 26, 2024
7a82d7c
work on tests
scx1332 Sep 26, 2024
6ee05dc
work on tests
scx1332 Sep 26, 2024
b15123b
work on tests
scx1332 Sep 26, 2024
86a838a
work on tests
scx1332 Sep 26, 2024
0fc62bb
work on tests
scx1332 Sep 26, 2024
ef6c03d
work on tests
scx1332 Sep 26, 2024
5582ff1
work on tests
scx1332 Sep 26, 2024
23eea85
work on tests
scx1332 Sep 26, 2024
46fd682
work on tests
scx1332 Sep 26, 2024
62df151
work on tests
scx1332 Sep 26, 2024
06850d4
work on tests
scx1332 Sep 26, 2024
820d431
Added action download key
scx1332 Sep 26, 2024
a9fc2e3
Added action download key
scx1332 Sep 26, 2024
7ce7d54
Added action download key
scx1332 Sep 26, 2024
bb03495
Added action download key
scx1332 Sep 26, 2024
dd2c5dd
Added action download key
scx1332 Sep 26, 2024
49f7261
Added action download key
scx1332 Sep 26, 2024
1b140f8
Added action download key
scx1332 Sep 26, 2024
a70cbf2
Added action download key
scx1332 Sep 26, 2024
096c437
Added action download key
scx1332 Sep 26, 2024
b6d249f
Added action download key
scx1332 Sep 26, 2024
f9fbc14
Added action download key
scx1332 Sep 26, 2024
50e456d
Added action download key
scx1332 Sep 26, 2024
70cfa91
Added action download key
scx1332 Sep 26, 2024
d80224f
Added action download key
scx1332 Sep 26, 2024
c12a6c9
Added action download key
scx1332 Sep 26, 2024
8d2c077
Added action download key
scx1332 Sep 26, 2024
8cda163
Added action download key
scx1332 Sep 26, 2024
e93d442
Added action download key
scx1332 Sep 26, 2024
131eac4
Added action download key
scx1332 Sep 26, 2024
9c3cf08
Added action download key
scx1332 Sep 26, 2024
62f728e
Added action download key
scx1332 Sep 26, 2024
7536787
Added action download key
scx1332 Sep 26, 2024
4b109eb
Added action download key
scx1332 Sep 26, 2024
e46e3f8
Added action download key
scx1332 Sep 26, 2024
3a13e6e
Added for test
scx1332 Sep 26, 2024
4826650
Added for test
scx1332 Sep 26, 2024
d1205c1
Added for test
scx1332 Sep 26, 2024
acb04c3
Added for test
scx1332 Sep 26, 2024
0183346
Added for test
scx1332 Sep 26, 2024
2e34e19
Added for test
scx1332 Sep 26, 2024
2cf467b
Added reports
scx1332 Sep 26, 2024
00b4c31
Added reports
scx1332 Sep 26, 2024
5b7709a
Added reports
scx1332 Sep 26, 2024
1e1d579
Added reports
scx1332 Sep 26, 2024
699877d
Added reports
scx1332 Sep 26, 2024
fce10e3
wait for paid items
scx1332 Sep 26, 2024
aa91765
wait for paid items
scx1332 Sep 26, 2024
28f9e09
wait for paid items
scx1332 Sep 26, 2024
4353fcc
wait for paid items
scx1332 Sep 26, 2024
4b9cd05
wait for paid items
scx1332 Sep 26, 2024
76f1537
working on tests
scx1332 Sep 27, 2024
28217f0
working on tests
scx1332 Sep 27, 2024
52a144a
working on tests
scx1332 Sep 27, 2024
615a882
working on tests
scx1332 Sep 27, 2024
7180119
working on tests
scx1332 Sep 27, 2024
af98496
working on tests
scx1332 Sep 27, 2024
077f848
working on tests
scx1332 Sep 27, 2024
3ed3fa2
working on tests
scx1332 Sep 27, 2024
4af1905
working on tests
scx1332 Sep 27, 2024
ce34855
working on tests
scx1332 Sep 27, 2024
a00a352
working on tests
scx1332 Sep 27, 2024
f2ae99a
working on tests
scx1332 Sep 27, 2024
05f4219
working on tests
scx1332 Sep 27, 2024
bc4c73c
working on tests
scx1332 Sep 27, 2024
1ff92d3
working on tests
scx1332 Sep 27, 2024
82f7ca6
working on tests
scx1332 Sep 27, 2024
62185db
working on tests
scx1332 Sep 27, 2024
a9059c4
working on tests
scx1332 Sep 27, 2024
617c5b6
working on tests
scx1332 Sep 27, 2024
c01c6cb
working on tests
scx1332 Sep 28, 2024
b36b2c4
provisioning updated
scx1332 Sep 28, 2024
56d67ee
Merge branch 'main' into integration
scx1332 Sep 28, 2024
211b9a8
appkey
scx1332 Sep 28, 2024
8655783
Merge branch 'main' into integration
scx1332 Sep 28, 2024
2739473
provision
scx1332 Sep 28, 2024
83fdc6e
Merge remote-tracking branch 'origin/integration' into integration
scx1332 Sep 28, 2024
b09dee7
provision
scx1332 Sep 29, 2024
1c753af
provision
scx1332 Sep 29, 2024
ed2a08d
Merge branch 'main' into integration
scx1332 Sep 29, 2024
6113f09
update key name
scx1332 Sep 29, 2024
2cbae32
update key name
scx1332 Sep 29, 2024
b54656e
Merge branch 'main' into integration
scx1332 Sep 29, 2024
da7cc7b
reupload used keys
scx1332 Sep 29, 2024
226cc98
reupload used keys
scx1332 Sep 29, 2024
420ef3f
Give eth from used keys back
scx1332 Sep 29, 2024
a7f45ae
Give eth from used keys back
scx1332 Sep 29, 2024
e566291
Give eth from used keys back
scx1332 Sep 29, 2024
1516291
Give eth from used keys back
scx1332 Sep 29, 2024
1bc7052
Merge branch 'main' into integration
scx1332 Sep 29, 2024
1c2f7d8
Base same id
scx1332 Oct 2, 2024
5df62f3
Disable other test for the moment
scx1332 Oct 2, 2024
f4143bc
Merge branch 'main' into integration
scx1332 Oct 2, 2024
ce08c65
Working on base same id test
scx1332 Oct 2, 2024
d19a99f
Merge remote-tracking branch 'origin/integration' into integration
scx1332 Oct 2, 2024
29e0664
Working on base same id test
scx1332 Oct 2, 2024
71081b5
Base same id test
scx1332 Oct 2, 2024
ce2b62c
Update multiple providers
scx1332 Oct 2, 2024
3d34250
Test multiple providers
scx1332 Oct 2, 2024
eaac1ee
Test multiple providers
scx1332 Oct 2, 2024
36144c5
Test multiple providers
scx1332 Oct 2, 2024
ad14943
Test multiple providers
scx1332 Oct 2, 2024
38e5572
Test multiple providers
scx1332 Oct 2, 2024
6c5e0ec
Check base key
scx1332 Oct 2, 2024
3944dfe
Fix scripts
scx1332 Oct 2, 2024
22dd109
update base same id
scx1332 Oct 2, 2024
7458f86
working on multi allocation test
scx1332 Oct 2, 2024
7981af5
fix upload
scx1332 Oct 2, 2024
dfb6ce7
fix upload
scx1332 Oct 2, 2024
fae5945
fix upload
scx1332 Oct 2, 2024
46542da
Merge branch 'main' into integration
scx1332 Oct 2, 2024
13376e6
Better tests
scx1332 Oct 3, 2024
0729ec3
Update actions
scx1332 Oct 3, 2024
1455d00
Update actions
scx1332 Oct 3, 2024
7a01fd4
Update actions
scx1332 Oct 3, 2024
9d5848f
Update actions
scx1332 Oct 3, 2024
9a5c60d
Update actions
scx1332 Oct 3, 2024
60b8f55
Update actions
scx1332 Oct 3, 2024
4bfbe74
Update actions
scx1332 Oct 3, 2024
ae610d5
Update actions
scx1332 Oct 3, 2024
1e7994b
Update actions
scx1332 Oct 3, 2024
702c15f
Update actions
scx1332 Oct 3, 2024
6d2c1b8
Update actions
scx1332 Oct 3, 2024
6db75e3
Update version to beta 10
scx1332 Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 276 additions & 0 deletions .github/workflows/base_same_id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
name: Base same keys
on:
push:
branches: [ "main", "actions/base-same-id" ]
pull_request:
branches: [ "main" ]


jobs:
run_test:
name: Base same id
strategy:
fail-fast: false
matrix:
include:
- restart: false
one_account: true
interval: 1m
id: 0
number_of_providers: 2

- restart: true
one_account: false
interval: 2m
id: 1
number_of_providers: 2

- restart: false
one_account: true
interval: 5m
id: 2
number_of_providers: 2

- restart: false
one_account: true
interval: 10m
id: 3
number_of_providers: 2

timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

#### prepare binaries

- name: Download and install binaries
run: |
/bin/bash download_binaries.sh

- name: Install binaries
run: |
sudo mkdir -p /usr/lib/yagna
sudo mv golem/downloaded/plugins /usr/lib/yagna/plugins
sudo mv golem/downloaded/* /usr/bin/

#### Central net router is responsible for local communication of the nodes

- name: Run central-net router
run: |
ya-sb-router -l tcp://127.0.0.1:5555&
echo CENTRAL_NET_HOST=127.0.0.1:5555 >> $GITHUB_ENV

#### Script for preparing runtime (basic preparation)

- name: Prepare runtime
run: |
python advanced/prepare_runtime.py --mode central --payments full --num-providers ${{ matrix.number_of_providers }}

#### Get funding by downloading private keys with assets ready to use

- name: Download private key
run: |
set -x
curl -sSL -H "Authorization: Bearer ${{ secrets.PRIVATE_KEY_SERVER_KEY }}" https://polygongas.org/keys/get/unused_accounts > downloaded_private_key_0.key
echo "Keys left $(curl -sSL -H "Authorization: Bearer ${{ secrets.PRIVATE_KEY_SERVER_KEY }}" https://polygongas.org/keys/count/unused_accounts)"
# Check if the downloaded key is a valid private key
grep -qE '^[a-fA-F0-9]{64}$' downloaded_private_key_0.key || { echo "Error: File contents do not match expected format: $(cat downloaded_private_key_0.key)"; exit 1; }

#### Provisioning requestor

- name: Run requestor second account
if: matrix.one_account != true
run: |
cd golem/requestor
yagna service run&
sleep 4
yagna id create --password= --from-private-key=$(cat ../../downloaded_private_key_0.key) identity0
yagna app-key create --id identity0 dev_req | sed 's/^/\YAGNA_REQUESTOR_APPKEY=/' >> $GITHUB_ENV
echo YAGNA_ACCOUNT_0=$(yagna id show identity0 | grep -oP '(?<=nodeId: )[^\s]+') >> $GITHUB_ENV

- name: Run requestor one account
if: matrix.one_account
run: |
cd golem/requestor
echo "YAGNA_AUTOCONF_ID_SECRET=$(cat ../../downloaded_private_key_0.key)" >> .env
yagna service run&
sleep 4
yagna app-key create dev_req | sed 's/^/\YAGNA_REQUESTOR_APPKEY=/' >> $GITHUB_ENV
echo YAGNA_ACCOUNT_0=$(yagna id show | grep -oP '(?<=nodeId: )[^\s]+') >> $GITHUB_ENV

- name: Restart requestor if needed
if: matrix.restart
run: |
cd golem/requestor
yagna service shutdown
sleep 4
yagna service run&
sleep 4

- name: Set payment interval
run: |
cd golem/requestor
yagna payment process set --account $YAGNA_ACCOUNT_0 --interval ${{ matrix.interval }}
yagna payment process info --account $YAGNA_ACCOUNT_0

#### Provisioning providers

- name: Prepare providers
run: |
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
cd golem/provider_$i
cat .env
golemsp setup --no-interactive
echo "\n***** Provider $i - Presets before change: *****\n"
ya-provider preset list
ya-provider preset update --no-interactive --name=vm --price="cpu=0.0016" --price="duration=0.12"
echo "\n***** Provider $i - Presets after change: *****\n"
ya-provider preset list
cd ../..
done

- name: Run providers
run: |
sudo chown $USER /dev/kvm
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
cd golem/provider_$i
cat .env
golemsp setup --no-interactive
yagna service run&
sleep 6
ya-provider run&
sleep 4
env > yagnadir/env.log
cd ../..
done
env:
YA_CONSENT_EXTERNAL: "allow"

- name: Run base same id test
run: |
cd examples/base-same-id
npm install --silent
node base_sameID.js

#### Wait for payments to be finished
- name: Wait for payments
run: |
cd reports
npm install --silent
node wait_for_payments.js
env:
YAGNA_DATADIR: ../golem/requestor/yagnadir

#### Stop services

- name: Stop requestor
if: always()
run: |
cd golem/requestor
yagna service shutdown

- name: Stop providers
if: always()
run: |
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
cd golem/provider_$i
yagna service shutdown
cd ../..
done
sleep 5

#### Report analysis of entities

- name: Requestor order items
run: |
cd reports
node list_order_items.js
env:
YAGNA_DATADIR: ../golem/requestor/yagnadir

- name: Requestor activities and agreements
run: |
cd reports
node list_activities.js
env:
YAGNA_DATADIR: ../golem/requestor/yagnadir

- name: Providers activities and agreements
run: |
cd reports
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
YAGNA_DATADIR=../golem/provider_$i/yagnadir node list_activities.js | tee provider_${i}_activities.log
done

- name: Requestor payments
run: |
cd reports
YAGNA_DATADIR=../golem/requestor/yagnadir node list_payments.js | tee requestor_payments.log

- name: Providers payments
run: |
cd reports
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
YAGNA_DATADIR=../golem/provider_$i/yagnadir node list_payments.js | tee provider_${i}_payments.log
done

- name: Requestor debit notes
run: |
cd reports
YAGNA_DATADIR=../golem/requestor/yagnadir node list_debit_notes.js | tee requestor_debit_notes.log

- name: Providers debit notes
run: |
cd reports
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
YAGNA_DATADIR=../golem/provider_$i/yagnadir node list_debit_notes.js | tee provider_${i}_debit_notes.log
done

- name: Requestor allocation expenditures
run: |
cd reports
YAGNA_DATADIR=../golem/requestor/yagnadir node list_expenditures.js | tee requestor_expenditures.log

#### Prepare logs by removing binary images and pack all logs and db together

- name: Prepare logs
if: always()
run: |
# remove image cache from upload
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
rm -r golem/provider_$i/providerdir/exe-unit/cache
done
tar -cf data_${{ matrix.id }}.tar golem/requestor/yagnadir

# append provider files
for i in $(seq 0 $((${{ matrix.number_of_providers }} - 1))); do
tar -rf data_${{ matrix.id }}.tar golem/provider_$i/yagnadir
tar -rf data_${{ matrix.id }}.tar golem/provider_$i/providerdir
done

# append reports
tar -rf data_${{ matrix.id }}.tar reports/*.log || true

xz data_${{ matrix.id }}.tar

#### Upload logs

- name: Upload logs - Set current date
if: always()
run: echo "CURRENT_DATE_FOR_UPLOAD=$(date -u +"%Y-%m-%dT%H%M%SZ")" >> $GITHUB_ENV

- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: data_${{ matrix.id }}_${{env.CURRENT_DATE_FOR_UPLOAD}}.tar.xz
path: data_${{ matrix.id }}.tar.xz

#### Upload used private key back to the server

- name: Upload used private key back to the server
if: always()
run: |
grep -qE '^[a-fA-F0-9]{64}$' downloaded_private_key_0.key || { echo "Error: File contents do not match expected format: $(cat downloaded_private_key_0.key)"; exit 1; }
curl -sSL -H "Authorization: Bearer ${{ secrets.PRIVATE_KEY_SERVER_KEY }}" -d $(cat downloaded_private_key_0.key) https://polygongas.org/keys/add/used_accounts
Loading
Loading