Skip to content

Commit

Permalink
removed docker dep
Browse files Browse the repository at this point in the history
  • Loading branch information
lunamidori5 committed Jun 23, 2024
1 parent 738b0a2 commit 6fec051
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion other_files/midori_program_ver.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
`Antioquia Brushfinch` ->| 24.6.18.0 |<-
`Antioquia Brushfinch` ->| 24.6.23.0 |<-
1 change: 0 additions & 1 deletion other_files/model_installer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ charset-normalizer
click
colorama
distro
git+https://github.com/docker/docker-py@main
exceptiongroup
h11
httpcore
Expand Down
2 changes: 1 addition & 1 deletion other_files/model_installer/setup_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import edit_models as models_edit_add_on

def dev_setup_docker(DockerClient, compose_path, ver_os_info, containers, use_gui, sg, client, ver_info, layout, client_openai, unused_int, subsystem_file_name):
def dev_setup_docker(DockerClient, compose_path, ver_os_info, containers, use_gui, sg, ver_info, layout, client_openai, unused_int, subsystem_file_name):
CPUCORES = int(psutil.cpu_count())
os_checker = platform.release()
known_niv_gpus = s.known_gpus()
Expand Down
26 changes: 11 additions & 15 deletions other_files/model_installer/subsystem_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import docker

import support as s

Expand All @@ -13,9 +12,6 @@
from version import VERSION
from version import news

from python_on_whales import DockerClient
from python_on_whales import docker as docker_two

use_cuda = "False"
use_tts = "False"
use_core = "False"
Expand Down Expand Up @@ -108,12 +104,12 @@

s.data_helper_python()

client = s.get_docker_client(Fore, ver_os_info, docker, client_openai)
docker = s.get_docker_client(Fore, ver_os_info, client_openai)

# List all containers
s.clear_window(ver_os_info)

s.check_for_update(ver_os_info, ver_info, client)
s.check_for_update(ver_os_info, ver_info, docker)

s.clear_window(ver_os_info)

Expand All @@ -125,7 +121,7 @@
local_ip_addres = "error"
print(str(e))

backend_menu = models_add_on.backend_programs_manager(ver_os_info, client, about_model_size, about_model_q_size, client_openai)
backend_menu = models_add_on.backend_programs_manager(ver_os_info, docker, about_model_size, about_model_q_size, client_openai)

use_gui = "no"
dev_mode = True
Expand Down Expand Up @@ -164,7 +160,7 @@
s.clear_window(ver_os_info)

while True:
containers = client.containers.list()
containers = docker.containers.list()

installed_backends = backend_checker.check_json()

Expand All @@ -185,7 +181,7 @@
temp_main_menu_dash = dash * main_menu_dash

s.clear_window(ver_os_info)
s.check_for_subsystem_update(ver_os_info, ver_info, DockerClient, compose_path, containers, use_gui, sg, client, ver_info, layout, client_openai, discord_id, subsystem_file_name)
s.check_for_subsystem_update(ver_os_info, ver_info, docker, compose_path, containers, use_gui, sg, ver_info, layout, client_openai, discord_id, subsystem_file_name)
s.clear_window(ver_os_info)

s.log(blank_line)
Expand Down Expand Up @@ -222,23 +218,23 @@
if answerstartup == 1:
s.data_helper_python()
s.repair_clean_up()
docker_add_on.dev_setup_docker(DockerClient, compose_path, ver_os_info, containers, use_gui, sg, client, ver_info, layout, client_openai, discord_id, subsystem_file_name)
docker_add_on.dev_setup_docker(docker, compose_path, ver_os_info, containers, use_gui, sg, ver_info, layout, client_openai, discord_id, subsystem_file_name)
s.data_helper_python()

if answerstartup == 2:
s.data_helper_python()
subsystem_backend_manager.backend_installer("midori-docker-compose.yaml", client, client_openai, ver_os_info, discord_id) # type: ignore
subsystem_backend_manager.backend_installer("midori-docker-compose.yaml", docker, client_openai, ver_os_info, discord_id) # type: ignore
s.data_helper_python()

if answerstartup == 3:
s.data_helper_python()
subsystem_backend_manager.backend_updater("midori-docker-compose.yaml", client, ver_os_info) # type: ignore
subsystem_backend_manager.backend_updater("midori-docker-compose.yaml", docker, ver_os_info) # type: ignore
input("Hit enter to go back to the main menu: ")
s.data_helper_python()

if answerstartup == 4:
s.data_helper_python()
subsystem_backend_manager.backend_uninstaller("midori-docker-compose.yaml", client, ver_os_info) # type: ignore
subsystem_backend_manager.backend_uninstaller("midori-docker-compose.yaml", docker, ver_os_info) # type: ignore
s.data_helper_python()

if answerstartup == 5:
Expand All @@ -253,13 +249,13 @@

if answerstartup == 10:
s.data_helper_python()
s.os_support_command_line(client, Fore)
s.os_support_command_line(docker, Fore)
input("Hit enter to go back to the main menu: ")
s.data_helper_python()

if answerstartup == 11:
s.data_helper_python()
s.os_support_command_line(client, Fore)
s.os_support_command_line(docker, Fore)
input("Hit enter to go back to the main menu: ")
s.data_helper_python()

Expand Down
6 changes: 4 additions & 2 deletions other_files/model_installer/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

from cryptography.fernet import Fernet

from python_on_whales import DockerClient

now = datetime.datetime.now()
timestamp = now.strftime("%m%d%Y")

Expand Down Expand Up @@ -152,7 +154,7 @@ def check_for_update(ver_os_info, ver_info, client):
log("Please run ``./subsystem_manager`` to restart the Subsystem Manager")
exit(0)

def check_for_subsystem_update(ver_os_info, ver_info, DockerClient, compose_path, containers, use_gui, sg, client, localai_ver_number, layout, client_openai, discord_id, subsystem_file_name):
def check_for_subsystem_update(ver_os_info, ver_info, docker, compose_path, containers, use_gui, sg, localai_ver_number, layout, client_openai, discord_id, subsystem_file_name):
"""
Sends a request to the server to check for a installer update.
"""
Expand All @@ -177,7 +179,7 @@ def check_for_subsystem_update(ver_os_info, ver_info, DockerClient, compose_path
log(f"-----------------------------------------------------------------------------------------------")
log(f"A subsystem update is available. Auto updating...")
log(f"-----------------------------------------------------------------------------------------------")
docker_add_on.dev_setup_docker(DockerClient, compose_path, ver_os_info, containers, use_gui, sg, client, localai_ver_number, layout, client_openai, discord_id, subsystem_file_name)
docker_add_on.dev_setup_docker(docker, compose_path, ver_os_info, containers, use_gui, sg, localai_ver_number, layout, client_openai, discord_id, subsystem_file_name)

def get_os_info():
# Get the operating system.
Expand Down
5 changes: 5 additions & 0 deletions other_files/model_installer/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def news(blank_line, Fore):
print(blank_line)
print(Fore.GREEN + "News" + Fore.WHITE)
print(blank_line)
print(Fore.LIGHTRED_EX + "Midori AI - As of Ver ->| 24.6.23.0 |<-")
print(Fore.GREEN + 'A full rework of how we fork into DOCKER API is underway' + Fore.WHITE)
print(Fore.GREEN + 'This change is to let our AMD / Intel friends enjoy using GPU' + Fore.WHITE)
print(Fore.GREEN + 'for ai workloads locally! Sorry for the delay!' + Fore.WHITE)
print(blank_line)
print(Fore.LIGHTRED_EX + "Midori AI - As of Ver ->| 24.6.13.0 |<-")
print(Fore.GREEN + 'We are working on our new cluster os for running' + Fore.WHITE)
print(Fore.GREEN + 'AI workloads, thank you for your time!' + Fore.WHITE)
Expand Down

0 comments on commit 6fec051

Please sign in to comment.