Skip to content

Commit

Permalink
Merge pull request #8 from ritual-net/staging
Browse files Browse the repository at this point in the history
feat: publishing infernet-container-starter v0.2.0
  • Loading branch information
ritual-all authored Mar 21, 2024
2 parents 60b1803 + d43f249 commit 5d33330
Show file tree
Hide file tree
Showing 156 changed files with 6,121 additions and 256 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# pre-commit workflow
#
# Ensures the codebase passes the pre-commit stack.

name: Build Docker Images

on:
pull_request:
branches:
- main
- dev

jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
project: [ "hello-world", "gpt4", "onnx-iris", "prompt-to-nft", "tgi-llm", "torch-iris"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run build example container
env:
project: ${{ matrix.project }}
CI: true
run: make build-container platform=linux/amd64
30 changes: 30 additions & 0 deletions .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# pre-commit workflow
#
# Ensures the codebase passes the pre-commit stack.

name: pre-commit ci

on: [push]

jobs:
python_ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install UV
run: python -m pip install uv

- name: Create virtual environment
run: uv venv

- name: Activate virtual environment
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install dependencies
run: uv pip install -r requirements.txt

- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure
25 changes: 21 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# OS
**/.DS_Store

# Byte-compiled / optimized / DLL files
deploy/config.json

__pycache__/
*.py[cod]
*$py


# C extensions
*.so

Expand All @@ -14,10 +18,23 @@ build/
*.egg-info/

# IDE specific files
.vscode/
.idea/
**/.vscode
**/.idea

# Virtual environment
venv/
venv
.venv/
*.env

**/.idea

# env files
**/*.env

# OS Files
**/.DS_Store

# Multi-deploykey CI
**/root-config

# sync scripts
remote_sync
33 changes: 33 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,36 @@
[submodule "projects/hello-world/contracts/lib/infernet-sdk"]
path = projects/hello-world/contracts/lib/infernet-sdk
url = https://github.com/ritual-net/infernet-sdk
[submodule "projects/torch-iris/contracts/lib/infernet-sdk"]
path = projects/torch-iris/contracts/lib/infernet-sdk
url = https://github.com/ritual-net/infernet-sdk
[submodule "projects/torch-iris/contracts/lib/forge-std"]
path = projects/torch-iris/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "projects/onnx-iris/contracts/lib/infernet-sdk"]
path = projects/onnx-iris/contracts/lib/infernet-sdk
url = https://github.com/ritual-net/infernet-sdk
[submodule "projects/onnx-iris/contracts/lib/forge-std"]
path = projects/onnx-iris/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "projects/prompt-to-nft/contracts/lib/forge-std"]
path = projects/prompt-to-nft/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "projects/prompt-to-nft/contracts/lib/infernet-sdk"]
path = projects/prompt-to-nft/contracts/lib/infernet-sdk
url = https://github.com/ritual-net/infernet-sdk
[submodule "projects/prompt-to-nft/contracts/lib/solmate"]
path = projects/prompt-to-nft/contracts/lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "projects/gpt4/contracts/lib/infernet-sdk"]
path = projects/gpt4/contracts/lib/infernet-sdk
url = https://github.com/ritual-net/infernet-sdk
[submodule "projects/gpt4/contracts/lib/forge-std"]
path = projects/gpt4/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "projects/tgi-llm/contracts/lib/forge-std"]
path = projects/tgi-llm/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "projects/tgi-llm/contracts/lib/infernet-sdk"]
path = projects/tgi-llm/contracts/lib/infernet-sdk
url = https://github.com/ritual-net/infernet-sdk
87 changes: 87 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.289
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black

- repo: local
hooks:
- id: mypy-hello-world
name: mypy hello-world
entry: mypy --strict
files: ^projects/hello-world/container/
language: system
types: [python]

- repo: local
hooks:
- id: mypy-torch-iris
name: mypy torch-iris
entry: mypy --strict
files: ^projects/torch-iris/container/
language: system
types: [python]

- repo: local
hooks:
- id: mypy-onnx-iris
name: mypy onnx-iris
entry: mypy --strict
files: ^projects/onnx-iris/container/
language: system
types: [python]


- repo: local
hooks:
- id: mypy-tgi-llm-container
name: mypy tgi-llm container
entry: mypy --strict
files: ^projects/tgi-llm/container
language: system
types: [python]

- repo: local
hooks:
- id: mypy-tgi-llm-ui
name: mypy tgi-llm ui
entry: mypy --strict
files: ^projects/tgi-llm/ui
language: system
types: [python]

- repo: local
hooks:
- id: mypy-gpt4
name: mypy gpt4
entry: mypy --strict
files: ^projects/gpt4/container
language: system
types: [python]

- repo: local
hooks:
- id: mypy-prompt-to-nft
name: mypy prompt-to-nft
entry: mypy --strict
files: ^projects/prompt-to-nft/container
language: system
types: [python]

# Default pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
# Ensure EOF exists
- id: end-of-file-fixer
# Prevent adding large files
- id: check-added-large-files
args: ["--maxkb=5000"]
# Newline at end of file
- id: trailing-whitespace
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
build-container:
$(MAKE) -C ./projects/$(project)/container build

remove-containers:
docker stop $(project) anvil-node && docker rm $(project) anvil-node || true

build-multiplatform:
$(MAKE) -C ./projects/$(project)/container build-multiplatform

deploy-container:
$(MAKE) remove-containers
cp ./projects/$(project)/container/config.json deploy/config.json
cd deploy && docker-compose up

Expand All @@ -7,3 +17,9 @@ deploy-contracts:

call-contract:
$(MAKE) -C ./projects/$(project)/contracts call-contract

build-service:
$(MAKE) -C ./projects/$(project)/$(service) build

run-service:
$(MAKE) -C ./projects/$(project)/$(service) run
Loading

0 comments on commit 5d33330

Please sign in to comment.