Skip to content

Update PixelArch and Cluster OS #100

Update PixelArch and Cluster OS

Update PixelArch and Cluster OS #100

name: Update PixelArch and Cluster OS
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'
jobs:
push_arch_to_hub:
name: Push Midori AI's PixelArch (Arch Linux) to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: false
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/pixelarch
tags: |
type=raw,value=latest
type=raw,value=quartz
- name: Build and push PixelArch Docker Image
uses: docker/build-push-action@master
with:
context: ./Cluster-OS/pixelarch_os/
file: ./Cluster-OS/pixelarch_os/arch_dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Clean up Docker Cache
run: |
docker image prune -f
push_gentoo_to_hub:
name: Push Midori AI's PixelGen (Gentoo Linux) to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: false
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/pixelgen
tags: |
type=raw,value=latest
type=raw,value=quartz
- name: Build and push PixelGen Docker Image
uses: docker/build-push-action@master
with:
context: ./Cluster-OS/pixelgen_os/
file: ./Cluster-OS/pixelgen_os/gentoo_dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Clean up Docker Cache
run: |
docker image prune -f
push_cluster_os_arch_to_hub:
name: Push Cluster OS (Arch Linux) to Docker Hub
runs-on: ubuntu-latest
needs: Build-PixelArch-Programs
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: false
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/midori_ai_cluster
tags: |
type=raw,value=latest
- name: Build and push Cluster OS (Arch Linux) Docker Image
uses: docker/build-push-action@master
with:
context: ./Cluster-OS/aiclusteros/
file: ./Cluster-OS/aiclusteros/dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Clean up Docker Cache
run: |
docker image prune -f
push_pixelarch_ver_amethyst_to_hub:
name: Push Midori AI's PixelArch (Amethyst) to Docker Hub
runs-on: ubuntu-latest
needs: push_arch_to_hub
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: false
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/pixelarch
tags: |
type=raw,value=amethyst
- name: Build and push PixelArch OS (Amethyst) Docker Image
uses: docker/build-push-action@master
with:
context: ./Cluster-OS/pixelarch_os/
file: ./Cluster-OS/pixelarch_os/arch_dockerfile_amethyst
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_pixelarch_ver_topaz_to_hub:
name: Push Midori AI's PixelArch (Topaz) to Docker Hub
runs-on: ubuntu-latest
needs: push_pixelarch_ver_amethyst_to_hub
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: false
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/pixelarch
tags: |
type=raw,value=topaz
- name: Build and push PixelArch OS (Topaz) Docker Image
uses: docker/build-push-action@master
with:
context: ./Cluster-OS/pixelarch_os/
file: ./Cluster-OS/pixelarch_os/arch_dockerfile_topaz
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_pixelarch_ver_emerald_to_hub:
name: Push Midori AI's PixelArch (Emerald) to Docker Hub
runs-on: ubuntu-latest
needs: push_pixelarch_ver_topaz_to_hub
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
logout: false
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/pixelarch
tags: |
type=raw,value=emerald
- name: Build and push PixelArch OS (Emerald) Docker Image
uses: docker/build-push-action@master
with:
context: ./Cluster-OS/pixelarch_os/
file: ./Cluster-OS/pixelarch_os/arch_dockerfile_emerald
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Build-PixelArch-Programs:
name: Update PixelArch Programs
runs-on: ubuntu-latest
needs: push_arch_to_hub
container:
image: lunamidori5/pixelarch:quartz
steps:
- name: Update OS
run: |
yay -Syu --noconfirm python python-pip python-virtualenv
- name: Update Version Name
run: |
mkdir -p /tmp/artifacts
mkdir -p /tmp/workfolder
- name: Move everything to working dir
run: |
cd /tmp/workfolder
curl -k --disable --disable-eprt -s https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/Webserver/Programs/Downloader/helper_app.py > helper_app.py
curl -k --disable --disable-eprt -s https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/Webserver/Programs/Login_program/midori_ai_login_app.py > midori_ai_login_app.py
curl -k --disable --disable-eprt -s https://raw.githubusercontent.com/lunamidori5/Midori-AI-Subsystem-Manager/master/midori_ai_manager/huggingface_downloader.py > huggingface_downloader.py
curl -k --disable --disable-eprt -s https://raw.githubusercontent.com/lunamidori5/Midori-AI-Subsystem-Manager/master/model_installer/requirements.txt > requirements.txt
- name: Install Dependencies
run: |
cd /tmp/workfolder
python3 -m venv os
os/bin/pip install pyinstaller
os/bin/pip install tor-proxy
os/bin/pip install -r requirements.txt
- name: Download the Uploader
run: |
cd /tmp/workfolder
os/bin/python helper_app.py git_uploader.py
- name: Build Programs
run: |
cd /tmp/workfolder
source os/bin/activate
pyinstaller --onefile --clean --distpath /tmp/artifacts/ helper_app.py
pyinstaller --onefile --clean --distpath /tmp/artifacts/ midori_ai_login_app.py
pyinstaller --onefile --clean --distpath /tmp/artifacts/ huggingface_downloader.py
pyinstaller --onefile --clean --distpath /tmp/artifacts/ git_uploader.py
- name: Move Exec
run: |
cd /tmp/workfolder
mv /tmp/artifacts/helper_app midori_ai_downloader
mv /tmp/artifacts/midori_ai_login_app midori_ai_login
mv /tmp/artifacts/huggingface_downloader hf-downloader
mv /tmp/artifacts/git_uploader git_uploader
- name: Upload Programs
run: |
cd /tmp/workfolder
chmod +x git_uploader
./git_uploader --type Linux --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "midori_ai_downloader" --filename "pixelarch-midori-ai-downloader"
./git_uploader --type Linux --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "hf-downloader" --filename "pixelarch-hf-downloader"
./git_uploader --type Linux --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "midori_ai_login" --filename "pixelarch-midori-ai-login"
./git_uploader --type Linux --username "${{ secrets.MIDORI_AI_USERNAME }}" --password "${{ secrets.MIDORI_AI_PASSWORD }}" --twoflogin "${{ secrets.MIDORI_AI_TFA }}" --file "git_uploader" --filename "pixelarch-midori-ai-uploader"