Skip to content

Commit 40a6c59

Browse files
committed
infernet-1.0.0 update
1 parent 2a11fd3 commit 40a6c59

File tree

98 files changed

+882
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+882
-509
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ venv
3838

3939
# sync scripts
4040
remote_sync
41+
42+
# forge generated files
43+
**/broadcast
44+
**/out
45+
46+
# secrets
47+
*-key.json

.gitmodules

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
url = https://github.com/foundry-rs/forge-std
44
[submodule "projects/hello-world/contracts/lib/infernet-sdk"]
55
path = projects/hello-world/contracts/lib/infernet-sdk
6-
url = https://github.com/ritual-net/infernet-sdk
6+
url = https://github.com/ritual-net/infernet-sdk.git
77
[submodule "projects/torch-iris/contracts/lib/infernet-sdk"]
88
path = projects/torch-iris/contracts/lib/infernet-sdk
9-
url = https://github.com/ritual-net/infernet-sdk
9+
url = https://github.com/ritual-net/infernet-sdk.git
1010
[submodule "projects/torch-iris/contracts/lib/forge-std"]
1111
path = projects/torch-iris/contracts/lib/forge-std
1212
url = https://github.com/foundry-rs/forge-std
1313
[submodule "projects/onnx-iris/contracts/lib/infernet-sdk"]
1414
path = projects/onnx-iris/contracts/lib/infernet-sdk
15-
url = https://github.com/ritual-net/infernet-sdk
15+
url = https://github.com/ritual-net/infernet-sdk.git
1616
[submodule "projects/onnx-iris/contracts/lib/forge-std"]
1717
path = projects/onnx-iris/contracts/lib/forge-std
1818
url = https://github.com/foundry-rs/forge-std
@@ -21,13 +21,13 @@
2121
url = https://github.com/foundry-rs/forge-std
2222
[submodule "projects/prompt-to-nft/contracts/lib/infernet-sdk"]
2323
path = projects/prompt-to-nft/contracts/lib/infernet-sdk
24-
url = https://github.com/ritual-net/infernet-sdk
24+
url = https://github.com/ritual-net/infernet-sdk.git
2525
[submodule "projects/prompt-to-nft/contracts/lib/solmate"]
2626
path = projects/prompt-to-nft/contracts/lib/solmate
2727
url = https://github.com/transmissions11/solmate
2828
[submodule "projects/gpt4/contracts/lib/infernet-sdk"]
2929
path = projects/gpt4/contracts/lib/infernet-sdk
30-
url = https://github.com/ritual-net/infernet-sdk
30+
url = https://github.com/ritual-net/infernet-sdk.git
3131
[submodule "projects/gpt4/contracts/lib/forge-std"]
3232
path = projects/gpt4/contracts/lib/forge-std
3333
url = https://github.com/foundry-rs/forge-std
@@ -36,4 +36,10 @@
3636
url = https://github.com/foundry-rs/forge-std
3737
[submodule "projects/tgi-llm/contracts/lib/infernet-sdk"]
3838
path = projects/tgi-llm/contracts/lib/infernet-sdk
39+
url = https://github.com/ritual-net/infernet-sdk.git
40+
[submodule "projects/payment/contracts/lib/forge-std"]
41+
path = projects/payment/contracts/lib/forge-std
42+
url = https://github.com/foundry-rs/forge-std
43+
[submodule "projects/payment/contracts/lib/infernet-sdk"]
44+
path = projects/payment/contracts/lib/infernet-sdk
3945
url = https://github.com/ritual-net/infernet-sdk

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
- ##### The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
- ##### This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2024-06-06
9+
10+
### Added
11+
- New project `payment` for an end-to-end flow of the payments feature of `infernet
12+
1.0.0`.
13+
14+
### Changed
15+
- All workflows are updated to use `infernet-ml 1.0.0`
16+
- All contracts are updated to use `infernet-sdk 1.0.0`
17+
18+
### Fixed
19+
- Recursive submodule cloning issue with forge's libraries.
20+
21+
## [0.1.0] - 2024-03-21
22+
23+
### Added
24+
- Initial release of the Infernet Container Starter repository.

Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
build-container:
2-
$(MAKE) -C ./projects/$(project)/container build
1+
include internal.mk
2+
3+
index_url ?= ''
4+
5+
build-container: get_index_url
6+
$(MAKE) -C ./projects/$(project)/container build index_url=$(index_url)
37

48
remove-containers:
59
docker compose -f deploy/docker-compose.yaml down || true
@@ -8,10 +12,18 @@ remove-containers:
812
build-multiplatform:
913
$(MAKE) -C ./projects/$(project)/container build-multiplatform
1014

11-
deploy-container:
12-
$(MAKE) remove-containers
15+
deploy-container: stop-container
1316
cp ./projects/$(project)/container/config.json deploy/config.json
1417
docker compose -f deploy/docker-compose.yaml up -d
18+
docker logs infernet-node -f
19+
20+
stop-container:
21+
docker compose -f deploy/docker-compose.yaml kill || true
22+
docker compose -f deploy/docker-compose.yaml rm -f || true
23+
docker kill $(project) || true
24+
docker rm $(project) || true
25+
26+
watch-logs:
1527
docker compose -f deploy/docker-compose.yaml logs -f
1628

1729
deploy-contracts:

PUBLISHING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
## Get Rid Of
3+
- [ ] build versions in libraries
4+
- [ ] Node version in dockerfiles
5+
- [ ] `get_index_url`, `index_url` can stay
6+
- [ ] change ci not to use extra index url (requires pypi release)

deploy/docker-compose.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,30 @@ version: '3'
22

33
services:
44
node:
5-
image: ritualnetwork/infernet-node:latest
5+
image: ritualnetwork/infernet-node:1.0.0
66
ports:
77
- "0.0.0.0:4000:4000"
88
volumes:
99
- ./config.json:/app/config.json
1010
- node-logs:/logs
1111
- /var/run/docker.sock:/var/run/docker.sock
12+
tty: true
1213
networks:
1314
- network
1415
depends_on:
1516
- redis
17+
- infernet-anvil
1618
restart:
1719
on-failure
1820
extra_hosts:
1921
- "host.docker.internal:host-gateway"
2022
stop_grace_period: 1m
21-
tty: true
23+
container_name: infernet-node
2224

2325
redis:
2426
image: redis:latest
25-
expose:
26-
- "6379"
27+
ports:
28+
- "6379:6379"
2729
networks:
2830
- network
2931
volumes:
@@ -46,10 +48,18 @@ services:
4648
restart:
4749
on-failure
4850

51+
infernet-anvil:
52+
image: ritualnetwork/infernet-anvil:1.0.0
53+
command: --host 0.0.0.0 --port 3000 --load-state infernet_deployed.json -b 1
54+
ports:
55+
- "8545:3000"
56+
networks:
57+
- network
58+
container_name: infernet-anvil
59+
4960
networks:
5061
network:
5162

52-
5363
volumes:
5464
node-logs:
5565
redis-data:

internal.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ifneq ("$(wildcard gcp.env)","")
2+
include gcp.env
3+
endif
4+
5+
get_index_url:
6+
$(eval token := $(shell gcloud auth print-access-token))
7+
$(eval index_url := "https://_token:$(token)@$(artifact_location)-python.pkg.dev/$(gcp_project)/$(artifact_repo)/simple")
8+
9+
generate-uv-env-file: get_index_url
10+
@echo "`echo $(export_prefix)`UV_EXTRA_INDEX_URL=$(index_url)" > uv.env

projects/gpt4/container/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ ENV PYTHONDONTWRITEBYTECODE 1
77
ENV PIP_NO_CACHE_DIR 1
88
ENV RUNTIME docker
99
ENV PYTHONPATH src
10+
ARG index_url
11+
ENV UV_EXTRA_INDEX_URL ${index_url}
1012

1113
RUN apt-get update
1214
RUN apt-get install -y git curl
1315

1416
# install uv
15-
ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
17+
ADD https://astral.sh/uv/install.sh /install.sh
18+
RUN chmod 755 /install.sh
1619
RUN /install.sh && rm /install.sh
1720

1821
COPY src/requirements.txt .

projects/gpt4/container/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ TAG := $(DOCKER_ORG)/example-$(EXAMPLE_NAME)-infernet:latest
55
.phony: build run build-multiplatform try-prompt
66

77
build:
8-
mkdir -p root-config
9-
@docker build -t $(TAG) .
8+
@docker build -t $(TAG) --build-arg index_url=$(index_url) .
109

1110
run: build
1211
@docker run --env-file $(EXAMPLE_NAME).env -p 3000:3000 $(TAG)

projects/gpt4/container/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ make run
1616
## Test the Container
1717
```bash
1818
curl -X POST localhost:3000/service_output -H "Content-Type: application/json" \
19-
-d '{"source": 1, "data": {"text": "can shrimps actually fry rice?"}}'
19+
-d '{"source": 1, "data": {"prompt": "can shrimps actually fry rice?"}}'
2020
```

0 commit comments

Comments
 (0)