-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Lumerin-protocol/main
Titan Update
- Loading branch information
Showing
124 changed files
with
25,757 additions
and
1,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
create_release: | ||
description: 'Create new release' | ||
required: true | ||
type: boolean | ||
push: | ||
branches: | ||
- main | ||
paths: ['.github/workflows/**', '**/Makefile', '**/*.go'] | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
Ubuntu-22-x64: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
id: checkout | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.x' | ||
cache-dependency-path: launcher/go.sum | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd launcher | ||
go mod tidy | ||
cd ../proxy-router | ||
go mod download | ||
- name: Build | ||
id: build | ||
run: | | ||
cd launcher | ||
make | ||
cd ../proxy-router | ||
make build | ||
- name: Determine tag name | ||
id: tag | ||
run: | | ||
SHORT_HASH="$(git rev-parse --short=7 HEAD)" | ||
echo "name=${SHORT_HASH}" >> $GITHUB_OUTPUT | ||
- name: Pack artifacts | ||
id: pack_artifacts | ||
run: | | ||
ARTIFACT=mor-launch-${{ steps.tag.outputs.name }}-ubuntu-x64.zip | ||
LLAMACPP=llama-b2699-bin-ubuntu-x64.zip | ||
MODEL=tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf | ||
wget https://github.com/ggerganov/llama.cpp/releases/download/b2699/$LLAMACPP | ||
wget https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/$MODEL | ||
unzip -o -j $LLAMACPP build/bin/server | ||
echo '{"run":["./server -m ./'$MODEL'","./proxy-router"]}' > mor-launch.json | ||
cp ./proxy-router/.env.example .env | ||
zip -j $ARTIFACT ./LICENSE ./launcher/mor-launch server ./proxy-router/bin/proxy-router .env $MODEL mor-launch.json | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: mor-launch-${{ steps.tag.outputs.name }}-ubuntu-x64.zip | ||
name: mor-launch-ubuntu-x64.zip | ||
|
||
macOS-12-x64: | ||
runs-on: macos-12 | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
id: checkout | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.x' | ||
cache-dependency-path: launcher/go.sum | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd launcher | ||
go mod tidy | ||
cd ../proxy-router | ||
go mod download | ||
- name: Build | ||
id: build | ||
run: | | ||
cd launcher | ||
make | ||
cd ../proxy-router | ||
make build | ||
- name: Determine tag name | ||
id: tag | ||
run: | | ||
SHORT_HASH="$(git rev-parse --short=7 HEAD)" | ||
echo "name=${SHORT_HASH}" >> $GITHUB_OUTPUT | ||
- name: Pack artifacts | ||
id: pack_artifacts | ||
run: | | ||
ARTIFACT=mor-launch-${{ steps.tag.outputs.name }}-macos-x64.zip | ||
LLAMACPP=llama-b2699-bin-macos-x64.zip | ||
MODEL=tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf | ||
wget https://github.com/ggerganov/llama.cpp/releases/download/b2699/$LLAMACPP | ||
wget https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/$MODEL | ||
unzip -o -j $LLAMACPP build/bin/server | ||
echo '{"run":["./server -m ./'$MODEL'","./proxy-router"]}' > mor-launch.json | ||
cp ./proxy-router/.env.example .env | ||
zip -j $ARTIFACT ./LICENSE ./launcher/mor-launch ./proxy-router/bin/proxy-router .env server $MODEL mor-launch.json | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: mor-launch-${{ steps.tag.outputs.name }}-macos-x64.zip | ||
name: mor-launch-macos-x64.zip | ||
|
||
macOS-14-arm64: | ||
runs-on: macos-14 | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
id: checkout | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.x' | ||
cache-dependency-path: launcher/go.sum | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd launcher | ||
go mod tidy | ||
cd ../proxy-router | ||
go mod download | ||
- name: Build | ||
id: build | ||
run: | | ||
cd launcher | ||
make | ||
cd ../proxy-router | ||
make build | ||
- name: Determine tag name | ||
id: tag | ||
run: | | ||
SHORT_HASH="$(git rev-parse --short=7 HEAD)" | ||
echo "name=${SHORT_HASH}" >> $GITHUB_OUTPUT | ||
- name: Pack artifacts | ||
id: pack_artifacts | ||
run: | | ||
ARTIFACT=mor-launch-${{ steps.tag.outputs.name }}-macos-arm64.zip | ||
LLAMACPP=llama-b2699-bin-macos-arm64.zip | ||
MODEL=tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf | ||
wget https://github.com/ggerganov/llama.cpp/releases/download/b2699/$LLAMACPP | ||
wget https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/$MODEL | ||
unzip -o -j $LLAMACPP build/bin/server | ||
echo '{"run":["./server -m ./'$MODEL'","./proxy-router"]}' > mor-launch.json | ||
cp ./proxy-router/.env.example .env | ||
zip -j $ARTIFACT ./LICENSE ./launcher/mor-launch ./proxy-router/bin/proxy-router .env server $MODEL mor-launch.json | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: mor-launch-${{ steps.tag.outputs.name }}-macos-arm64.zip | ||
name: mor-launch-macos-arm64.zip | ||
|
||
release: | ||
if: ${{ github.event.inputs.create_release == 'true' }} | ||
runs-on: ubuntu-latest | ||
needs: | ||
- Ubuntu-22-x64 | ||
- macOS-12-x64 | ||
- macOS-14-arm64 | ||
steps: | ||
- name: Clone | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Determine tag name | ||
id: tag | ||
run: | | ||
SHORT_HASH="$(git rev-parse --short=7 HEAD)" | ||
echo "name=${SHORT_HASH}" >> $GITHUB_OUTPUT | ||
- name: Download artifacts | ||
id: download-artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./artifact | ||
|
||
- name: Move artifacts | ||
id: move_artifacts | ||
run: | | ||
mkdir -p ./artifact/release | ||
mv ./artifact/*/*.zip ./artifact/release | ||
- name: Create release | ||
id: create_release | ||
uses: anzz1/action-create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.tag.outputs.name }} | ||
|
||
- name: Upload release | ||
id: upload_release | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const release_id = '${{ steps.create_release.outputs.id }}'; | ||
for (let file of await fs.readdirSync('./artifact/release')) { | ||
if (path.extname(file) === '.zip') { | ||
console.log('uploadReleaseAsset', file); | ||
await github.repos.uploadReleaseAsset({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: release_id, | ||
name: file, | ||
data: await fs.readFileSync(`./artifact/release/${file}`) | ||
}); | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*/**/node_modules | ||
*/**/node_modules | ||
***/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# Start the 'serve' command in the background | ||
ollama serve & | ||
|
||
# Optionally, wait for 'serve' to be fully ready. Adjust the sleep as necessary. | ||
sleep 10 # This is a simple way. Consider more reliable checking mechanisms. | ||
|
||
# Proceed with other commands | ||
ollama pull llama2 | ||
ollama run llama2 | ||
|
||
# Keep the container running by tailing a file (or another long-running command) | ||
tail -f /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
version: '3.8' | ||
services: | ||
proxy-router: | ||
build: | ||
context: ./proxy-router | ||
env_file: | ||
- ./proxy-router/.env | ||
ports: | ||
- 8082:8082 | ||
- 3333:3333 | ||
depends_on: | ||
- ollama | ||
ollama: | ||
image: ollama/ollama | ||
container_name: ollama | ||
entrypoint: ["/bin/sh", "-c"] | ||
command: ["/docker-compose-startup.sh"] | ||
volumes: | ||
- ollama:/root/.ollama | ||
- ollamaconfig:/root/.ollama | ||
- ./docker-compose-startup.sh:/docker-compose-startup.sh | ||
ports: | ||
- "11434:11434" | ||
restart: unless-stopped | ||
|
||
volumes: | ||
ollama: | ||
ollamaconfig: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mor-launch | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
prefix = /usr/local | ||
PROG = mor-launch | ||
|
||
all: $(PROG) | ||
|
||
$(PROG): cmd/main.go | ||
go build -o $@ $^ | ||
|
||
clean: | ||
rm -f $(PROG) | ||
|
||
install: $(PROG) | ||
mkdir -p $(DESTDIR)$(prefix)/bin | ||
cp $< $(DESTDIR)$(prefix)/bin/ | ||
|
||
uninstall: | ||
rm $(DESTDIR)$(prefix)/bin/$(PROG) | ||
|
||
run: | ||
go run cmd/main.go | ||
|
||
.PHONY: all clean install uninstall run | ||
|
Oops, something went wrong.