Skip to content

Commit d959ad9

Browse files
authored
Merge pull request #101 from PrimeIntellect-ai/develop
Release v.0.1
2 parents 0529a69 + 863793a commit d959ad9

File tree

171 files changed

+23032
-1
lines changed

Some content is hidden

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

171 files changed

+23032
-1
lines changed

.env.example

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
RPC_URL=
2+
NETWORK_ID=
3+
MIN_STAKE_AMOUNT=
4+
5+
# Private keys of privileged accounts
6+
PRIVATE_KEY_FEDERATOR=
7+
FEDERATOR_ADDRESS=
8+
PRIVATE_KEY_VALIDATOR=
9+
VALIDATOR_ADDRESS=
10+
11+
# Provider with their node
12+
PROVIDER_PRIVATE_KEY=
13+
PROVIDER_ADDRESS=
14+
NODE_PRIVATE_KEY=
15+
NODE_ADDRESS=
16+
17+
# Pool Owner
18+
POOL_OWNER_PRIVATE_KEY=
19+
POOL_OWNER_ADDRESS=
20+
21+
# Contracts
22+
PRIME_NETWORK_ADDRESS=
23+
AI_TOKEN_ADDRESS=
24+
COMPUTE_REGISTRY_ADDRESS=
25+
DOMAIN_REGISTRY_ADDRESS=
26+
STAKE_MANAGER_ADDRESS=
27+
COMPUTE_POOL_ADDRESS=

.github/workflows/checks.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Check Format & Lint
2+
on:
3+
pull_request:
4+
branches: [ main, master, develop ]
5+
paths:
6+
- '**/*.rs'
7+
- '**/Cargo.*'
8+
push:
9+
branches: [ main, master, develop ]
10+
paths:
11+
- '**/*.rs'
12+
- '**/Cargo.*'
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
CARGO_INCREMENTAL: 0
17+
RUSTFLAGS: "-C debuginfo=0"
18+
19+
jobs:
20+
check:
21+
name: Format & Lint
22+
runs-on: xl-runner
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: dtolnay/rust-toolchain@master
26+
with:
27+
toolchain: 1.83.0
28+
components: rustfmt, clippy
29+
- uses: Swatinem/rust-cache@v2
30+
with:
31+
cache-directories: "**/target"
32+
cache-on-failure: true
33+
34+
- name: Run format check
35+
run: cargo fmt -- --check
36+
- name: Run clippy
37+
if: success() || failure()
38+
run: cargo clippy -- -D warnings
39+
#- name: Install Redis binary
40+
#run: |
41+
#sudo apt-get update
42+
#sudo apt-get install -y redis-server
43+
## Ensure redis-server binary is installed but don't start the service
44+
#sudo systemctl stop redis || true
45+
#sudo systemctl disable redis || true
46+
47+
#- name: Run tests
48+
#if: success() || failure()
49+
#run: |
50+
#redis-server --version
51+
#cargo test -- --nocapture

.github/workflows/dev-release.yml

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: Development Release
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
tags-ignore:
8+
- '*'
9+
10+
permissions:
11+
contents: write
12+
discussions: write
13+
packages: write
14+
15+
jobs:
16+
cleanup-old-releases:
17+
name: Cleanup Old Development Releases
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Delete old development releases
21+
uses: dev-drprasad/delete-older-releases@v0.3.2
22+
with:
23+
keep_latest: 5
24+
delete_tags: true
25+
delete_tag_pattern: ^dev-
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
build-and-release:
30+
name: Build and Create Development Release
31+
needs: cleanup-old-releases
32+
# Using a larger runner with more CPU cores and memory
33+
runs-on: xl-runner
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Install Rust toolchain
41+
uses: actions-rs/toolchain@v1
42+
with:
43+
toolchain: stable
44+
override: true
45+
46+
# Use all available cores for the build
47+
- name: Build all workspace members
48+
run: |
49+
export CARGO_BUILD_JOBS=$(nproc)
50+
cargo build --release --workspace
51+
52+
- name: Prepare binaries
53+
run: |
54+
mkdir -p release-artifacts
55+
if [ -f target/release/miner ]; then
56+
cp target/release/miner release-artifacts/miner-linux-x86_64
57+
fi
58+
if [ -f target/release/validator ]; then
59+
cp target/release/validator release-artifacts/validator-linux-x86_64
60+
fi
61+
if [ -f target/release/orchestrator ]; then
62+
cp target/release/orchestrator release-artifacts/orchestrator-linux-x86_64
63+
fi
64+
if [ -f target/release/discovery ]; then # Prepare discovery binary
65+
cp target/release/discovery release-artifacts/discovery-linux-x86_64
66+
fi
67+
68+
- name: Generate checksums
69+
run: |
70+
cd release-artifacts
71+
for file in *-linux-x86_64; do
72+
if [ -f "$file" ]; then
73+
sha256sum "$file" | cut -d ' ' -f 1 > "${file}.checksum"
74+
fi
75+
done
76+
cd ..
77+
78+
- name: Generate release tag
79+
id: tag
80+
run: |
81+
echo "tag_name=dev-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
82+
83+
- name: Create Release
84+
uses: softprops/action-gh-release@v1
85+
with:
86+
tag_name: ${{ steps.tag.outputs.tag_name }}
87+
name: Development Build ${{ steps.tag.outputs.tag_name }}
88+
body: |
89+
⚠️ Development Build (Not for Production Use)
90+
91+
Branch: develop
92+
Commit: ${{ github.sha }}
93+
Build Date: ${{ steps.tag.outputs.tag_name }}
94+
95+
Platform:
96+
- Linux x86_64
97+
98+
Components:
99+
- Miner
100+
- Validator
101+
- Orchestrator
102+
- Discovery svc
103+
104+
Note: This is an automated development build. For stable releases, please use builds from the master branch.
105+
files: release-artifacts/*
106+
prerelease: true
107+
generate_release_notes: true
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Authenticate to Google Cloud
112+
uses: google-github-actions/auth@v1
113+
with:
114+
credentials_json: ${{ secrets.GCP_SA_KEY }}
115+
116+
# Setup Google Cloud SDK
117+
- name: Set up Google Cloud SDK
118+
uses: google-github-actions/setup-gcloud@v1
119+
120+
# Upload to Google Cloud Storage
121+
- name: Upload to GCS
122+
run: |
123+
gsutil -m cp -r release-artifacts/* gs://prime-miner/${{ steps.tag.outputs.tag_name }}/
124+
gsutil -m cp -r gs://prime-miner/${{ steps.tag.outputs.tag_name }}/* gs://prime-miner/latest/
125+
gsutil -m setmeta -h "Cache-Control:no-cache, max-age=0" gs://prime-miner/latest/**/*
126+
127+
- name: Generate Docker metadata
128+
id: meta
129+
run: |
130+
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
131+
echo "repo_lower=${REPO_LOWER}" >> $GITHUB_OUTPUT
132+
133+
- name: Configure Docker for Artifact Registry
134+
run: |
135+
gcloud auth configure-docker us-east1-docker.pkg.dev
136+
137+
- name: Set up Docker Buildx
138+
uses: docker/setup-buildx-action@v2
139+
140+
- name: Login to GitHub Container Registry
141+
uses: docker/login-action@v2
142+
with:
143+
registry: ghcr.io
144+
username: ${{ github.actor }}
145+
password: ${{ secrets.GITHUB_TOKEN }}
146+
147+
- name: Build and push Discovery image
148+
uses: docker/build-push-action@v4
149+
with:
150+
context: .
151+
file: ./discovery/Dockerfile
152+
push: true
153+
tags: |
154+
ghcr.io/${{ steps.meta.outputs.repo_lower }}/discovery:dev
155+
ghcr.io/${{ steps.meta.outputs.repo_lower }}/discovery:${{ steps.tag.outputs.tag_name }}
156+
us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/prime-miner/discovery:dev
157+
us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/prime-miner/discovery:${{ steps.tag.outputs.tag_name }}
158+
159+
- name: Build and push Validator image
160+
uses: docker/build-push-action@v4
161+
with:
162+
context: .
163+
file: ./validator/Dockerfile
164+
push: true
165+
tags: |
166+
ghcr.io/${{ steps.meta.outputs.repo_lower }}/validator:dev
167+
ghcr.io/${{ steps.meta.outputs.repo_lower }}/validator:${{ steps.tag.outputs.tag_name }}
168+
us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/prime-miner/validator:dev
169+
us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/prime-miner/validator:${{ steps.tag.outputs.tag_name }}
170+
171+
- name: Build and push Orchestrator image
172+
uses: docker/build-push-action@v4
173+
with:
174+
context: .
175+
file: ./orchestrator/Dockerfile
176+
push: true
177+
tags: |
178+
ghcr.io/${{ steps.meta.outputs.repo_lower }}/orchestrator:dev
179+
ghcr.io/${{ steps.meta.outputs.repo_lower }}/orchestrator:${{ steps.tag.outputs.tag_name }}
180+
us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/prime-miner/orchestrator:dev
181+
us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/prime-miner/orchestrator:${{ steps.tag.outputs.tag_name }}

0 commit comments

Comments
 (0)