Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
loverdos committed Sep 30, 2024
0 parents commit 3a4ad66
Show file tree
Hide file tree
Showing 91 changed files with 15,645 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.move]
indent_size = 4

[*.yml]
indent_size = 2

[*.rs]
indent_size = 4
21 changes: 21 additions & 0 deletions .github/actions/fetch-sui-cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Setup Sui CLI"
description: "Downloads and sets up the Sui CLI"
inputs:
sui_ref:
description: "Sui version to download from the Sui's Github release page"
required: true
runs:
using: "composite"
steps:
- run: wget "https://github.com/MystenLabs/sui/releases/download/${{ inputs.sui_ref }}/sui-${{ inputs.sui_ref }}-ubuntu-x86_64.tgz"
shell: bash
- run: tar -xvf "sui-${{ inputs.sui_ref }}-ubuntu-x86_64.tgz"
shell: bash
- run: mkdir -p /home/runner/.local/bin
shell: bash
- run: mv sui /home/runner/.local/bin/sui
shell: bash
- run: sudo chmod +x /home/runner/.local/bin/sui
shell: bash
- run: sui --version
shell: bash
13 changes: 13 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Github workflow to check python code

name: Python
on: [push]

jobs:
# https://black.readthedocs.io/en/stable/integrations/github_actions.html
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
160 changes: 160 additions & 0 deletions .github/workflows/talus-agentic-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Github workflow to build and test the Talus Agentic Framework project

name: Talus Agentic Framework
on: [push]

env:
# defines what Sui version to install from the Sui's Github release page
# https://github.com/MystenLabs/sui/releases
SUI_REF: testnet-v1.26.1

jobs:
# 1. Get Sui CLI
# 2. Builds and tests talus framework package
build-agentic-framework:
name: (Move) Build Agentic Framework
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

# 1.
- name: Fetch Sui CLI
uses: ./.github/actions/fetch-sui-cli
with:
sui_ref: ${{ env.SUI_REF }}

# 2.
- run: sui move build -p onchain
- run: sui move test -p onchain

# We use nightly for formatting only because lots of nice format rules are
# not available in stable Rust yet.
#
# 1. Get nightly Rust toolchain
# 2. Check Rust formatting
check-e2e-tests-fmt:
name: (Rust) Check Formatting
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

# 1.
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
components: rustfmt

# 2.
- run: cd e2e_tests && cargo fmt -- --check

# 1. Get stable Rust toolchain
# 2. Set up caching
# 3. Build and check Rust binary
# 4. Upload Rust binary as artifact
build-e2e-tests:
name: (Rust) Build E2E Tests
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

# 1.
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy

# 2.
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
e2e_tests/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
# 3.
- run: cd e2e_tests && cargo build
- run: cd e2e_tests && cargo clippy -- -D warnings

# 4.
- name: Upload Rust binary
uses: actions/upload-artifact@v3
with:
name: e2e-tests-binary # ARTIFACT NAME
path: e2e_tests/target/debug/e2e_tests_bin # FROM THIS PATH
retention-days: 1 # we only need this for the next job

# 1. Get necessary files: code, Sui CLI, Rust binary.
# The Ollama APIs are mocked in the Rust e2e binary
# 2. Start Sui Localnet as a bg process with a fresh genesis and localnet wallet
# 3. Deploy Talus Pkg and export FW_PKG_ID env variable
# 4. Run E2E Tests binary with appropriate env variables
# 5. Shutdown the localnet to clean up
run-e2e-tests:
name: Run E2E Tests
runs-on: ubuntu-latest
needs: [build-agentic-framework, build-e2e-tests]
steps:
# 1.
- name: Check out repository code
uses: actions/checkout@v4
- name: Fetch Sui CLI
uses: ./.github/actions/fetch-sui-cli
with:
sui_ref: ${{ env.SUI_REF }}
- name: Download Rust binary
uses: actions/download-artifact@v3
with:
name: e2e-tests-binary

# 2.
- name: Start Sui Localnet
run: |
sui genesis -f
nohup sui start &
echo $! > sui-localnet.pid &
sleep 5
shell: bash

# 3.
- name: Deploy Talus Pkg and export FW_PKG_ID
run: |
cd onchain
json=$(sui client publish --skip-dependency-verification --json)
fw_pkg_id=$(echo $json | jq -cr '.objectChanges[] | select(.packageId) | .packageId')
if [ -z "$fw_pkg_id" ]; then
echo "Cannot get pkg ID from JSON \n\n${json}"
else
echo "Talus framework package ID: $fw_pkg_id"
fi
echo "FW_PKG_ID=$(echo $fw_pkg_id)" >> $GITHUB_ENV
# 4.
- name: Run E2E Tests binary
run: |
export SUI_WALLET_PATH=~/.sui/sui_config/client.yaml
export RUST_LOG=info,e2e_tests=debug
chmod +x e2e_tests_bin
./e2e_tests_bin
# 5.
- name: Shutdown Sui Localnet
run: |
kill $(cat sui-localnet.pid)
shell: bash
164 changes: 164 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Mac stuff
.DS_Store

# python things
__pycache__
__pypackages__

# Generator obsolete
.openapi-generator

node_modules

tmp.*
.wrk.local

Move.lock
model_addresses.json

# Bash tools
nohup.out

# IDEs
.idea
*.iml
.vscode
Loading

0 comments on commit 3a4ad66

Please sign in to comment.