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

Fix#400: Re-merge YAML & CLI #403

Merged
merged 189 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
c5987e1
First stab at porting various functions over to polars... lots to go
idiom-bytes Nov 22, 2023
c1fedf7
TOHLCV df initialization and type checking added. 2/8 pdutil tests pa…
idiom-bytes Nov 22, 2023
2a0a94b
black formatted
idiom-bytes Nov 22, 2023
a579c4d
Fixing initialization and improving test. datetime is not generated i…
idiom-bytes Nov 22, 2023
c5efe9f
Restructured pdutil a bit to reduce DRY and utilize schema more stric…
idiom-bytes Nov 22, 2023
6c1f3ec
test initializing the df and datetime
idiom-bytes Nov 22, 2023
b7a60b2
improve init test to show exception without timestamp
idiom-bytes Nov 22, 2023
754aaee
fixing test_concat such that it verifies that schemas must match, and…
idiom-bytes Nov 22, 2023
fce6718
saving parquet enforces datetime and transform. updated test_load_app…
idiom-bytes Nov 22, 2023
f9e6cb8
black formatted
idiom-bytes Nov 22, 2023
d0dccaf
data_eng tests are passing
idiom-bytes Nov 22, 2023
026ad39
initial data_eng tests are passing w/ black, mypy, and pylint.
idiom-bytes Nov 22, 2023
2006f1a
_merge_parquet_dfs updated and create_xy test_1 is passing. all data_…
idiom-bytes Nov 23, 2023
933f1d8
2exch_2coins_2signals is passing
idiom-bytes Nov 23, 2023
6264c61
Added polars support for fill_nans, has_nans, and create_xy__handle_n…
idiom-bytes Nov 23, 2023
1b5b665
Starting to deprecate references to pandas and csv in data_factory.
idiom-bytes Nov 23, 2023
a511bd5
Black formatted
idiom-bytes Nov 23, 2023
444862b
Deprecated csv logic in DataFactory and created tests around get_hist…
idiom-bytes Nov 23, 2023
6666618
All tests should be passing.
idiom-bytes Nov 24, 2023
4e06884
Fix #370: YAML & CLI (#371)
trentmc Nov 24, 2023
80faf81
Update CI to use pdr instead of scripts/ (#399)
trizin Nov 24, 2023
25bfa3e
Replace long try/except with _safe*() function; rename pdutil -> plut…
trentmc Nov 27, 2023
148cb94
Update entrypoint script to use pdr cli (#406)
trizin Nov 27, 2023
6d7661a
Add main.py back (#404)
trizin Nov 27, 2023
43a43df
Merge from issue388-refactor-csvs-pandas, plus many changes
trentmc Nov 27, 2023
fa3b672
Merge branch 'yaml-cli2' of https://github.com/oceanprotocol/pdr-back…
trentmc Nov 27, 2023
f7bbca4
make black happy
trentmc Nov 27, 2023
27ac78e
small bug fix
trentmc Nov 27, 2023
97370c7
many bug fixes. Still >=1 left
trentmc Nov 27, 2023
036ca3e
fix warning
trentmc Nov 27, 2023
c96464d
Add support for polars where needed
trentmc Nov 27, 2023
6b4383f
tweak docstring
trentmc Nov 27, 2023
6ff502d
Fix #408: test_sim_engine failing in yaml-cli2, bc hist_df is s not m…
trentmc Nov 27, 2023
1b6556c
BaseContract tests that Web3PP type is input
trentmc Nov 27, 2023
4c78f72
goes with previous commit
trentmc Nov 27, 2023
24e4345
tweak - lowercase
trentmc Nov 27, 2023
9ca66e7
Bug fix - fix failing tests
trentmc Nov 27, 2023
e24cfcb
Remove unwanted file
trentmc Nov 28, 2023
9e9abc5
(a) better organize ppss.yaml for usability (b) ensure user isn't ann…
trentmc Nov 28, 2023
7855bef
add a more precise test for modeling
trentmc Nov 28, 2023
8c7d0c4
make black happy
trentmc Nov 28, 2023
516d6e9
Small refactor: make transform_df() part of helper routine
trentmc Nov 28, 2023
1dc2836
Fix #414: Split data_factory into (1) CEX -> parquet -> df (2) df -> …
trentmc Nov 28, 2023
4dc204c
Fix #415: test_cli_do_dfbuyer.py is hanging #415
trentmc Nov 28, 2023
67c2b96
test create_xy() even more. Clarify the order of timestamps
trentmc Nov 28, 2023
5ba906c
Add a model-building test, using data shaped like data from test_mode…
trentmc Nov 28, 2023
06aa946
Fix #416: [YAML branch] No Feeds Found - data_pp.py changes pair stan…
trentmc Nov 29, 2023
995df8b
For barge#391: update to *not* use barge's predictoor branch
trentmc Nov 29, 2023
97512a6
Merge branch 'main' into yaml-cli2
trentmc Nov 29, 2023
a1db778
Merge branch 'main' into yaml-cli2
trentmc Nov 30, 2023
4d6e8ff
Update vps.md: nicer order of operations
trentmc Nov 30, 2023
21a65d4
For #417, #418 in yaml-cli2 branch. publisher TUSD -> USDT
trentmc Nov 30, 2023
7fd76e3
Merge branch 'main' into yaml-cli2
trentmc Nov 30, 2023
50ab141
Merge branch 'main' into yaml-cli2
trentmc Nov 30, 2023
5a47226
Merge branch 'main' into yaml-cli2
trentmc Nov 30, 2023
49d546e
remove default_network from ppss.yaml (obsolete)
trentmc Nov 30, 2023
610062d
Fix #427 - time now
trentmc Nov 30, 2023
8156b30
Fix #428: test_get_hist_df - FileNotFoundError. Includes lots of extr…
trentmc Dec 1, 2023
bedf654
remove dependency that we don't need, which caused problems
trentmc Dec 1, 2023
151e79c
Merge branch 'main' into yaml-cli2
trentmc Dec 1, 2023
851dab0
Fix #421: Add cli + logic to calculate and plot traction metrics (PR …
idiom-bytes Dec 1, 2023
2d95c57
bug fix: YAML_FILE
trentmc Dec 1, 2023
ede6efe
fix breaking test; clean it up too
trentmc Dec 1, 2023
0e7b021
add barge-calls.md
trentmc Dec 1, 2023
7dd9d0f
Fix #433. Calculate metrics and draw plots for epoch-based stats (PR …
idiom-bytes Dec 4, 2023
de9b650
git merge main
trentmc Dec 5, 2023
1785713
Tweak barge-calls.md
trentmc Dec 6, 2023
9905f60
Tweak barge-calls.md: more compactly show RPC_URL calc
trentmc Dec 6, 2023
af6ce32
update stake_token
trentmc Dec 6, 2023
a3789f9
Merge branch 'yaml-cli2' of https://github.com/oceanprotocol/pdr-back…
trentmc Dec 6, 2023
59f3462
bug fix
trentmc Dec 6, 2023
206428a
Update release-process.md: bug fix
trentmc Dec 6, 2023
8e571d6
Tweak barge-calls.md
trentmc Dec 6, 2023
482e9fe
git merge main
trentmc Dec 6, 2023
909a5ab
Tune #405 (PR #406): Update entrypointsh script to use pdr CLI
trentmc Dec 6, 2023
9168f78
Update vps.md: docker doesn't need to prompt to delete
trentmc Dec 6, 2023
f5be9ac
Update vps.md: add docker-stop instrs
trentmc Dec 6, 2023
ac7670e
allow CLI to have NETWORK_OVERRIDE, for more flexiblity from barge
trentmc Dec 6, 2023
784ed60
Merge branch 'yaml-cli2' of https://github.com/oceanprotocol/pdr-back…
trentmc Dec 6, 2023
ef2d6b2
fix pylint issue
trentmc Dec 6, 2023
52c11f3
Update barge-calls.md: link to barge.md
trentmc Dec 6, 2023
8e4bb22
Update release-process.md: fix typo
trentmc Dec 6, 2023
823c02f
touch
trentmc Dec 6, 2023
c73502a
Update vps.md: more instrs around waiting for barge to be ready
trentmc Dec 6, 2023
d53fbb0
add unit tests for cli_module
trentmc Dec 7, 2023
699fb1c
Merge branch 'yaml-cli2' of https://github.com/oceanprotocol/pdr-back…
trentmc Dec 7, 2023
5362ac2
Towards #437: [YAML] Publisher error 'You must set RPC_URL environmen…
trentmc Dec 7, 2023
93720d1
Bug fixes
trentmc Dec 7, 2023
f66cee2
refactor tweaks to predictoor and trader
trentmc Dec 7, 2023
3988f29
Clean up some envvar stuff. Document ppss vars better.
trentmc Dec 7, 2023
8f2f2d4
publish_assets.py now supports barge-pytest and barge-predictoor-bot
trentmc Dec 7, 2023
8addd57
bug fix
trentmc Dec 7, 2023
1dffc03
bug fix the previous 'bug fix'
trentmc Dec 7, 2023
720aa64
Clean up how dfbuyer/predictoor/trader agents get feeds: web3_pp.quer…
trentmc Dec 8, 2023
75b943b
fix breaking subgraph tests. Still breakage in trader & dfbuyer (that…
trentmc Dec 9, 2023
5b19f0b
Fix failing tests in tradder, dfbuyer. And greatly speed up the tests…
trentmc Dec 10, 2023
711905e
Fix bugs for failing tests of https://github.com/oceanprotocol/pdr-ba…
trentmc Dec 10, 2023
f667f46
fix tmpdir bug
trentmc Dec 10, 2023
9f112fd
Fix (hopefully) failing unit test - restricted region in querying bin…
trentmc Dec 10, 2023
c9bbf41
consolidate gas_price setting, make it consistent; set gas_price to 0…
trentmc Dec 10, 2023
94c74b3
fix linter complaints
trentmc Dec 10, 2023
ae9fe21
Fix remaining failing unit tests for predictoor_batcher
trentmc Dec 10, 2023
d1eea21
Finish the consolidation of gas pricing. All tests pass
trentmc Dec 10, 2023
96d157f
Merge branch 'main' into yaml-cli2
trentmc Dec 11, 2023
63d9de3
Update vps.md: add debugging info
trentmc Dec 11, 2023
0053961
add to/from wei utility. Copied from ocean.py
trentmc Dec 11, 2023
c118763
tweak docs in conftest_ganache
trentmc Dec 11, 2023
21b8b2f
tweaks from black for wei
trentmc Dec 11, 2023
8f21c7b
Make fixed_rate.py and its test easier to understand via better var n…
trentmc Dec 11, 2023
21d0d89
Make predictoor_contract.py easier to understandn via better var anmi…
trentmc Dec 11, 2023
b0dc81d
test fixed_rate calcBaseInGivenOutDT
trentmc Dec 11, 2023
ffb693a
Refactor predictoor_contract: push utility methods out of the class, …
trentmc Dec 11, 2023
535de12
Tweak docstrings for fixed_rate.py
trentmc Dec 11, 2023
3f6d60f
Improve DX: show dev what the parameters are. Improve UX: print when …
trentmc Dec 11, 2023
f88a958
Improve DX & UX for predictoor_contract
trentmc Dec 11, 2023
bb5ab0f
Tweak UX (prints)
trentmc Dec 11, 2023
1df1da3
Update vps.md: export PATH
trentmc Dec 11, 2023
5524b1f
Logging for predictoor is way better: more calm yet more informative.…
trentmc Dec 11, 2023
ef02b65
Merge branch 'yaml-cli2' of https://github.com/oceanprotocol/pdr-back…
trentmc Dec 11, 2023
11b6bd0
TraderAgent -> BaseTraderAgent
trentmc Dec 12, 2023
4460259
Rename parquet_dfs -> rawohlcv_dfs; hist_df -> mergedohlcv_df; update…
trentmc Dec 12, 2023
568f93e
apply black to test_plutil.py
trentmc Dec 12, 2023
055f0c7
apply black to test_model_data_factory.py
trentmc Dec 12, 2023
e564f75
apply black to ohlcv_data_factory.py
trentmc Dec 12, 2023
1559ec3
refactor test_ohlcv_data_factory: cleanup mocks; remove redundant tes…
trentmc Dec 12, 2023
f11d881
Fix #443: [YAML] yaml timescale is 5m, yet predictoor logs s_per_epoc…
trentmc Dec 12, 2023
833ec16
Update feed str() to give full address; and order to be similar to pr…
trentmc Dec 12, 2023
d45cd34
Small bug fix: not printing properly
trentmc Dec 12, 2023
e0de941
Tweak: logging in predictoor_contract.py
trentmc Dec 12, 2023
c3fe7b9
Tweak: logging in trueval_agent_single.py
trentmc Dec 12, 2023
20171b6
Two bug fixes: pass in web3_pp not web3_config to PredictoorContract …
trentmc Dec 12, 2023
a3948cc
enhance typechecking
trentmc Dec 12, 2023
54a2c96
tweak payout.py: make args passed more obvious
trentmc Dec 12, 2023
626e773
fix broken unit test
trentmc Dec 12, 2023
c67fd2d
make black happy
trentmc Dec 12, 2023
9644408
fix breaking unit test
trentmc Dec 12, 2023
3e045c0
Tweak predictoor_contract DX & UX
trentmc Dec 12, 2023
9bfb404
Improve trueval: Have fewer layers of try/except, better DX via docst…
trentmc Dec 12, 2023
9d620cf
Rename TruevalAgentBase -> BaseTruevalAgent
trentmc Dec 12, 2023
0137395
(a) Fix #445: merge 3 trueval agent files into 1. (b) Fix #448 contra…
trentmc Dec 13, 2023
9aa6c49
Fix #450: test_contract_main[barge-pytest] fails
trentmc Dec 13, 2023
addf921
renaming pq_data_factory to ohlcv_data_factory
idiom-bytes Dec 14, 2023
6874ead
Removing all TODOs
idiom-bytes Dec 14, 2023
422b12e
Fix #452: Add clean code guidelines README
trentmc Dec 14, 2023
8bca663
Merge branch 'yaml-cli2' of https://github.com/oceanprotocol/pdr-back…
trentmc Dec 14, 2023
7e8a87e
removing dangling _ppss() inside predictoor_agent_runner.py
idiom-bytes Dec 14, 2023
e4fadc6
Fixing linter
idiom-bytes Dec 14, 2023
9f33dc2
Fix #454: Refactor: Rename MEXCOrder -> MexcOrder, ERC721Factory
trentmc Dec 15, 2023
67a8cde
Fix #455: Cyclic import issue
trentmc Dec 15, 2023
8fe215d
Fix #454 redux: the first commit introduced a bug, this one fixes the…
trentmc Dec 15, 2023
d3029a7
Fix #436 - Implement GQL data factory (PR #438)
idiom-bytes Dec 15, 2023
d759284
Fix #350: [Sim] Tweaks to plot title
trentmc Dec 17, 2023
f70aece
Merge branch 'main' into yaml-cli2
trentmc Dec 17, 2023
3c0b3e3
make black happy
trentmc Dec 17, 2023
974799a
Fix #446: [YAML] Rename/move files & dirs for proper separation among…
trentmc Dec 17, 2023
bbfef0d
Fix #459: In CI, polars error: col timestamp_right already exists (#460)
trentmc Dec 18, 2023
a4c117b
Fix #397: Remove need to specify 'stake_token' in ppss.yaml (#461)
trentmc Dec 18, 2023
aa999b7
Docs fixes (#456)
calina-c Dec 19, 2023
80e9fb6
Make Feeds objects instead of tuples. (#464)
calina-c Dec 20, 2023
b5496c6
Move and rename utils (#467)
calina-c Dec 20, 2023
1dec231
Objectify pairstr. (#470)
calina-c Dec 21, 2023
bd01d71
Towards #462: Separate lake and aimodel SS, lake command (#473)
calina-c Dec 29, 2023
a0244c9
[Lake] integrate pdr_subscriptions into GQL Data Factory (#469)
idiom-bytes Jan 4, 2024
80725f8
Improve DRY (#475)
calina-c Jan 4, 2024
1fb88ac
Add Code climate. (#484)
calina-c Jan 5, 2024
243ae7e
Adds manual trigger to pytest workflow.
calina-c Jan 5, 2024
3a5c639
issue483: move the logic from subgraph_slot.py (#489)
kdetry Jan 9, 2024
56392e4
Add some test coverage (#488)
calina-c Jan 9, 2024
27f94d2
git merge main
trentmc Jan 10, 2024
cd69814
Fix #501: ModuleNotFoundError: No module named 'flask' (PR #504)
trentmc Jan 10, 2024
77d7b4c
Fix #509: Refactor test_update_rawohlcv_files (PR #508)
trentmc Jan 10, 2024
ff66cbf
Merge branch 'main' into yaml-cli2
trizin Jan 10, 2024
69d3c8e
Fix #505: polars.exceptions.ComputeError: datatypes of join keys don'…
trentmc Jan 10, 2024
4959b5d
Fix #517: aimodel_data_factory.py missing data: binance:BTC/USDT:None…
trentmc Jan 11, 2024
474ec9c
Towards #494: Improve coverage 2 (#498)
calina-c Jan 11, 2024
3f24fdd
Fix #519: aimodel_data_factory.py missing data col: binance:ETH/USDT:…
trentmc Jan 12, 2024
e21f9a2
Replace `dftool` with `pdr` (#522)
trizin Jan 12, 2024
413d065
Fix #525: Plots pop up unwanted in tests. (PR #528)
calina-c Jan 13, 2024
fdb4545
Issue 519 feed dependencies (#529)
calina-c Jan 13, 2024
63891cd
Update to #519: remove do_verify, it's redundant (#532)
trentmc Jan 13, 2024
3eae232
Fix #507: fix asyncio issues (PR #531)
calina-c Jan 13, 2024
35a2799
#413 - YAML thorough system level tests (#527)
trizin Jan 15, 2024
11f05d2
Adds incremental waiting for subgraph tries. (#534)
calina-c Jan 15, 2024
9402e5f
Add publisher feeds filtering. (#533)
calina-c Jan 15, 2024
995a103
Pass the ppss.web3_pp instead of web3_config into WrappedToken class …
trizin Jan 15, 2024
9422c82
Fix #542: Add code climate usage to developer flow READMEs
trentmc Jan 16, 2024
d14c702
#538 - check network main subgraph query fails (#539)
trizin Jan 16, 2024
11b7244
#540 - YAML CLI topup and check network actions require address file …
trizin Jan 16, 2024
a851f79
Remove predictoor2 ref from pytest
trizin Jan 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions .github/workflows/check_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ jobs:
with:
python-version: "3.11"

- name: Fetch the address file and move it to contracts directory
run: |
wget https://raw.githubusercontent.com/oceanprotocol/contracts/main/addresses/address.json
mkdir -p ~/.ocean/ocean-contracts/artifacts/
mv address.json ~/.ocean/ocean-contracts/artifacts/

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Notify Slack
env:
RPC_URL: "https://sapphire.oasis.io"
SUBGRAPH_URL: "https://v4.subgraph.sapphire-mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph"
PRIVATE_KEY: "0xb23c44b8118eb7a7f70d21b0d20aed9b05d85d22ac6a0e57697c564da1c35554"
run: |
output=$(python scripts/check_network.py 1 | grep -E 'FAIL|WARNING|error' || true)
output=$(python pdr check_network ppss.yaml sapphire-mainnet | grep -E 'FAIL|WARNING|error' || true)
fact=$(curl -s https://catfact.ninja/fact | jq -r '.fact')
if [ -z "$output" ]; then
echo "No output, so no message will be sent to Slack"
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/check_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ jobs:
with:
python-version: "3.11"

- name: Fetch the address file and move it to contracts directory
run: |
wget https://raw.githubusercontent.com/oceanprotocol/contracts/main/addresses/address.json
mkdir -p ~/.ocean/ocean-contracts/artifacts/
mv address.json ~/.ocean/ocean-contracts/artifacts/

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Notify Slack
env:
RPC_URL: "https://testnet.sapphire.oasis.dev"
SUBGRAPH_URL: "https://v4.subgraph.sapphire-testnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph"
PRIVATE_KEY: "0xb23c44b8118eb7a7f70d21b0d20aed9b05d85d22ac6a0e57697c564da1c35554"
run: |
output=$(python scripts/check_network.py 1 | grep -E 'FAIL|WARNING|error' | grep -v "1h" || true)
output=$(python pdr check_network ppss.yaml sapphire-testnet | grep -E 'FAIL|WARNING|error' | grep -v "1h" || true)
joke=$(curl -s https://official-joke-api.appspot.com/jokes/general/random | jq -r '.[0].setup, .[0].punchline')
if [ -z "$output" ]; then
echo "No output, so no message will be sent to Slack"
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/cron_topup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Topup accounts
on:
schedule:
- cron: "0 * * * *"

jobs:
topup-mainnet:
runs-on: ubuntu-latest
Expand All @@ -15,18 +15,20 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.11"

- name: Fetch the address file and move it to contracts directory
run: |
wget https://raw.githubusercontent.com/oceanprotocol/contracts/main/addresses/address.json
mkdir -p ~/.ocean/ocean-contracts/artifacts/
mv address.json ~/.ocean/ocean-contracts/artifacts/
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set env variables
run: |
echo "SUBGRAPH_URL=http://v4.subgraph.sapphire-mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph" >> $GITHUB_ENV
echo "RPC_URL=https://sapphire.oasis.io" >> $GITHUB_ENV
echo "PRIVATE_KEY=${{ secrets.TOPUP_SCRIPT_PK }}" >> $GITHUB_ENV
- name: Run top-up script
run: python3 scripts/topup.py
run: python3 pdr topup ppss.yaml sapphire-mainnet

topup-testnet:
runs-on: ubuntu-latest
Expand All @@ -41,10 +43,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Fetch the address file and move it to contracts directory
run: |
wget https://raw.githubusercontent.com/oceanprotocol/contracts/main/addresses/address.json
mkdir -p ~/.ocean/ocean-contracts/artifacts/
mv address.json ~/.ocean/ocean-contracts/artifacts/
- name: Set env variables
run: |
echo "SUBGRAPH_URL=http://v4.subgraph.sapphire-testnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph" >> $GITHUB_ENV
echo "RPC_URL=https://testnet.sapphire.oasis.dev" >> $GITHUB_ENV
echo "PRIVATE_KEY=${{ secrets.TOPUP_SCRIPT_PK }}" >> $GITHUB_ENV
- name: Run top-up script
run: python3 scripts/topup.py
run: python3 pdr topup ppss.yaml sapphire-testnet
8 changes: 6 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
name: Checkout Barge
with:
repository: "oceanprotocol/barge"
ref: "main"
path: "barge"

- name: Run Barge
Expand Down Expand Up @@ -57,5 +56,10 @@ jobs:
- name: Test with pytest
id: pytest
run: |
coverage run --omit="*test*" -m pytest
coverage run --source=pdr_backend --omit=*/test/*,*/test_ganache/*,*/test_noganache/* -m pytest
coverage report
coverage xml
- name: Publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,12 @@ cython_debug/
.test_cache/
.cache/

# predictoor dynamic modeling
# predictoor-specific
out*.txt
my_ppss.yaml
csvs/
parquet_data/

# pdr_backend accuracy output
pdr_backend/accuracy/output/*.json
# pm2 configs
Expand Down
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ disable=too-many-locals,
consider-using-dict-items,
consider-using-generator,
dangerous-default-value,
unidiomatic-typecheck
unidiomatic-typecheck,
unsubscriptable-object

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
73 changes: 54 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,79 @@ SPDX-License-Identifier: Apache-2.0

# pdr-backend

⚠️ As of v0.2, the CLI replaces previous `main.py` calls. Update your flows accordingly.

## Run bots (agents)

- **[Run predictoor bot](READMEs/predictoor.md)** - make predictions, make $
- **[Run trader bot](READMEs/trader.md)** - consume predictions, trade, make $


(If you're a predictoor or trader, you can safely ignore the rest of this README.)

## Settings: PPSS

A "ppss" yaml file, like [`ppss.yaml`](ppss.yaml), holds parameters for all bots and simulation flows.
- We follow the idiom "pp" = problem setup (what to solve), "ss" = solution strategy (how to solve).
- `PRIVATE_KEY` is an exception; it's set as an envvar.

When you run a bot from the CLI, you specify your PPSS YAML file.

## CLI

(First, [install pdr-backend](READMEs/predictoor.md#install-pdr-backend-repo) first.)

To see CLI options, in console:
```console
pdr
```

This will output something like:
```text
Usage: pdr sim|predictoor|trader|..

Main tools:
pdr sim YAML_FILE
pdr predictoor APPROACH YAML_FILE NETWORK
pdr trader APPROACH YAML_FILE NETWORK
...
```

## Atomic READMEs

- [Get tokens](READMEs/get-tokens.md): [testnet faucet](READMEs/testnet-faucet.md), [mainnet ROSE](READMEs/get-rose-on-sapphire.md) & [OCEAN](READMEs/get-ocean-on-sapphire.md)
- [Envvars](READMEs/envvars.md)
- [Predictoor subgraph](READMEs/subgraph.md)
- [Dynamic model codebase](READMEs/dynamic-model-codebase.md)
- [Static models in predictoors](READMEs/static-model.md)
- [Claim payout for predictoor bot](READMEs/payout.md)
- [Predictoor subgraph](READMEs/subgraph.md). [Subgraph filters](READMEs/filters.md)
- [Run barge locally](READMEs/barge.md)

## Flows for core team

- **Backend dev** - for `pdr-backend` itself
- [Main backend-dev README](READMEs/backend-dev.md)
- Backend-dev - for `pdr-backend` itself
- [Local dev flow](READMEs/dev.md)
- [VPS dev flow](READMEs/vps.md)
- [Release process](READMEs/release-process.md)
- [Run barge locally](READMEs/barge.md)
- [Run barge remotely on VPS](READMEs/vps.md)
- [MacOS gotchas](READMEs/macos.md) wrt Docker & ports
- **[Run dfbuyer bot](READMEs/dfbuyer.md)** - runs Predictoor DF rewards
- **[Run publisher](READMEs/publisher.md)** - publish new feeds
- **[Scripts](scripts/)** for performance stats, more
- [Clean code guidelines](READMEs/clean-code.md)
- [Run dfbuyer bot](READMEs/dfbuyer.md) - runs Predictoor DF rewards
- [Run publisher](READMEs/publisher.md) - publish new feeds
- [Run trueval](READMEs/trueval.md) - run trueval bot

## Repo structure

This repo implements all bots in Predictoor ecosystem.

Each bot has a directory:
- `predictoor` - submits individual predictions
- `trader` - buys aggregated predictions, then trades
- other bots: `trueval` report true values to contract, `dfbuyer` implement Predictoor Data Farming, `publisher` to publish
Each bot has a directory. Alphabetically:
- `dfbuyer` - buy feeds on behalf of Predictoor DF
- `predictoor` - submit individual predictions
- `publisher` - publish pdr data feeds
- `trader` - buy aggregated predictions, then trade
- `trueval` - report true values to contract

Other directories:
- `util` - tools for use by any agent
- `models` - classes that wrap Predictoor contracts; for setup (BaseConfig); and for data feeds (Feed)
Other directories, alphabetically:
- `accuracy` - calculates % correct, for display in predictoor.ai webapp
- `data_eng` - data engineering & modeling
- `models` - class-based data structures, and classes to wrap contracts
- `payout` - OCEAN & ROSE payout
- `ppss` - settings
- `sim` - simulation flow
- `util` - function-based tools

93 changes: 0 additions & 93 deletions READMEs/backend-dev.md

This file was deleted.

41 changes: 41 additions & 0 deletions READMEs/barge-calls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Barge flow of calls

From getting barge going, here's how it calls specific pdr-backend components and passes arguments.

- user calls `/barge/start_ocean.sh` to get barge going
- then, `start_ocean.sh` fills `COMPOSE_FILES` incrementally. Eg `COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-publisher.yml"`
- `barge/compose-files/pdr-publisher.yml` sets:
- `pdr-publisher: image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest}`
- `pdr-publisher: command: publisher`
- `pdr-publisher: networks: backend: ipv4_address: 172.15.0.43`
- `pdr-publisher: environment:`
- `RPC_URL: ${NETWORK_RPC_URL}` (= `http://localhost:8545` via `start_ocean.sh`)
- `ADDRESS_FILE: /root/.ocean/ocean-contracts/artifacts/address.json`
- (many `PRIVATE_KEY_*`)

- then, `start_ocean.sh` pulls the `$COMPOSE_FILES` as needed:
- `[ ${FORCEPULL} = "true" ] && eval docker-compose "$DOCKER_COMPOSE_EXTRA_OPTS" --project-name=$PROJECT_NAME "$COMPOSE_FILES" pull`

- then, `start_ocean.sh` runs docker-compose including all `$COMPOSE_FILES`:
- `eval docker-compose "$DOCKER_COMPOSE_EXTRA_OPTS" --project-name=$PROJECT_NAME "$COMPOSE_FILES" up --remove-orphans`
- it executes each of the `"command"` entries in compose files.
- (Eg for pdr-publisher.yml, `"command" = "publisher ppss.yaml development"`)
- Which then goes to `pdr-backend/entrypoint.sh` via `"python /app/pdr_backend/pdr $@"`
- (where `@` is unpacked as eg `publisher ppss.yaml development`) [Ref](https://superuser.com/questions/1586997/what-does-symbol-mean-in-the-context-of#:).
- Then it goes through the usual CLI at `pdr-backend/pdr_backend/util/cli_module.py`


### How to make changes to calls

If you made a change to pdr-backend CLI interface, then barge must call using the updated CLI command.

How:
- change the relevant compose file's `"command"`. Eg change `barge/compose-files/pdr-publisher.yml`'s "command" value to `publisher ppss.yaml development`
- also, change envvar setup as needed. Eg in compose file, remove `RPC_URL` and `ADDRESS_FILE` entry.
- ultimately, ask: "does Docker have everything it needs to succesfully run the component?"

### All Barge READMEs

- [barge.md](barge.md): the main Barge README
- [barge-calls.md](barge-calls.md): order of execution from Barge and pdr-backend code
- [release-process.md](release-process.md): pdr-backend Dockerhub images get published with each push to `main`, and sometimes other branches. In turn these are used by Barge.
Loading
Loading