-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 #289 from Capsize-Games/develop
Develop
- Loading branch information
Showing
110 changed files
with
10,914 additions
and
6,317 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
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,21 @@ | ||
./venv/bin/python -m PyInstaller --log-level=INFO --noconfirm ./build.airunner-socket-server.linux.dev.spec | ||
cp -R ./venv/lib/python3.10/site-packages/timm ./dist/airunner-socket-server/ | ||
cp ./venv/lib/python3.10/site-packages/torch/lib/libtorch_cuda_linalg.so ./dist/airunner-socket-server/ | ||
cp -R ./venv/lib/python3.10/site-packages/Pillow-9.5.0.dist-info ./dist/airunner-socket-server/ | ||
|
||
# remove redundant files | ||
rm -rf ./dist/airunner-socket-server/nvfuser | ||
rm -rf ./dist/airunner-socket-server/functorch | ||
rm -rf ./dist/airunner-socket-server/pydantic | ||
rm -rf ./dist/airunner-socket-server/tensorflow/python/data/experimental | ||
rm -f ./dist/airunner-socket-server/matplotlib/_qhull.cpython-310-x86_64-linux-gnu.so | ||
rm -f ./dist/airunner-socket-server/JIT/_C.so | ||
rm -f ./dist/airunner-socket-server/libtorch_cuda_linalg.so | ||
rm -f ./dist/airunner-socket-server/libtorch.so | ||
rm -f ./dist/airunner-socket-server/libtorch_cuda.so | ||
rm -f ./dist/airunner-socket-server/libnvfuser_codegen.so | ||
rm -f ./dist/airunner-socket-server/libc10_cuda.so | ||
rm -f ./dist/airunner-socket-server/libtorch_python.so | ||
rm -f ./dist/airunner-socket-server/libtorch_cpu.so | ||
rm -f ./dist/airunner-socket-server/libc10.so | ||
rm -f ./dist/airunner-socket-server/libshm.so |
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,173 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
import os | ||
import shutil | ||
from PyInstaller.utils.hooks import copy_metadata, collect_data_files | ||
import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5) | ||
os.environ["AIRUNNER_ENVIRONMENT"] = "prod" | ||
libraries = [ | ||
"/usr/lib/x86_64-linux-gnu/wine-development/", | ||
"./venv/lib/python3.10/site-packages/h5py.libs/", | ||
"./venv/lib/python3.10/site-packages/scipy.libs/", | ||
"./venv/lib/python3.10/site-packages/tokenizers.libs/", | ||
"./venv/lib/python3.10/site-packages/Pillow.libs/", | ||
"./venv/lib/python3.10/site-packages/opencv_python.libs/", | ||
"./venv/lib/python3.10/site-packages/torchaudio/lib/", | ||
"./venv/lib/python3.10/site-packages/torch/lib/", | ||
"/usr/lib/python3.10", | ||
"/usr/lib/x86_64-linux-gnu/", | ||
"/usr/local/lib/", | ||
"/usr/local/lib/python3.10", | ||
"/usr/local/lib/python3.10/dist-packages" | ||
] | ||
os.environ["LD_LIBRARY_PATH"] = ":".join(libraries) | ||
block_cipher = None | ||
DEBUGGING = True | ||
EXCLUDE_BINARIES = True | ||
EXE_NAME = "airunner-socket-server" # used when creating a binary instead of a folder | ||
EXE_STRIP = False | ||
EXE_UPX = True | ||
EXE_RUNTIME_TMP_DIR = None | ||
COLLECT_NAME = 'airunner-socket-server' | ||
COLLECT_STRIP = False | ||
COLLECT_UPX = True | ||
datas = [] | ||
datas += copy_metadata('tqdm') | ||
datas += copy_metadata('regex') | ||
datas += copy_metadata('requests') | ||
datas += copy_metadata('packaging') | ||
datas += copy_metadata('filelock') | ||
datas += copy_metadata('numpy') | ||
datas += copy_metadata('tokenizers') | ||
datas += copy_metadata('transformers') | ||
datas += copy_metadata('rich') | ||
datas += copy_metadata('sympy') | ||
datas += copy_metadata('opencv-python') | ||
datas += collect_data_files("torch", include_py_files=True) | ||
datas += collect_data_files("torchvision", include_py_files=True) | ||
datas += collect_data_files("JIT", include_py_files=True) | ||
datas += collect_data_files("pytorch_lightning", include_py_files=True) | ||
datas += collect_data_files("lightning_fabric", include_py_files=True) | ||
datas += collect_data_files("transformers", include_py_files=True) | ||
datas += collect_data_files("sympy", include_py_files=True) | ||
datas += collect_data_files("controlnet_aux", include_py_files=True) | ||
a = Analysis( | ||
[ | ||
f'./src/airunner/aihandler/socket_server.py', | ||
], | ||
pathex=[ | ||
"./venv/lib/python3.10/site-packages/", | ||
"./venv/lib/python3.10/site-packages/torch/lib", | ||
"./venv/lib/python3.10/site-packages/tokenizers", | ||
"./venv/lib/python3.10/site-packages/tensorflow", | ||
"/usr/lib/x86_64-linux-gnu/", | ||
], | ||
binaries=[ | ||
('./venv/lib/python3.10/site-packages/nvidia/cudnn/lib/libcudnn_ops_infer.so.8', '.'), | ||
('./venv/lib/python3.10/site-packages/nvidia/cudnn/lib/libcudnn_cnn_infer.so.8', '.'), | ||
('/usr/lib/x86_64-linux-gnu/libgstgl-1.0.so.0', '.'), | ||
], | ||
datas=datas, | ||
hiddenimports=[ | ||
"JIT", | ||
"tqdm", | ||
"diffusers", | ||
"transformers", | ||
"nvidia", | ||
"torch", | ||
"torchvision", | ||
"torchvision.io", | ||
"logging", | ||
"logging.config", | ||
"einops", | ||
"omegaconf", | ||
"contextlib", | ||
"itertools", | ||
"pytorch_lightning", | ||
"huggingface_hub.hf_api", | ||
"huggingface_hub.repository", | ||
"inspect", | ||
"psutil", | ||
"matplotlib", | ||
"numpy", | ||
"PIL._tkinter_finder", | ||
"sympy", | ||
"opencv-python", | ||
], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[ | ||
"tcl", | ||
"tcl8", | ||
"cmake", | ||
"cryptography", | ||
"email-validator", | ||
"google", | ||
"google-auth", | ||
"google-auth-oauthlib", | ||
"google-pasta", | ||
"Jinja2", | ||
"lightning-cloud", | ||
"Markdown", | ||
"markdown-it-py", | ||
"MarkupSafe", | ||
"mdurl", | ||
"ninja", | ||
"nvidia-pyindex", | ||
"pytz", | ||
"tensorboard", | ||
"tensorboard-data-server", | ||
"tensorboard-plugin-wit", | ||
"unattended-upgrades", | ||
"watchfiles", | ||
"wcwidth", | ||
"websocket-client", | ||
"websockets", | ||
], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False, | ||
) | ||
pyz = PYZ( | ||
a.pure, | ||
a.zipped_data, | ||
cipher=block_cipher | ||
) | ||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
[], | ||
exclude_binaries=EXCLUDE_BINARIES, | ||
name=EXE_NAME, | ||
debug=DEBUGGING, | ||
strip=EXE_STRIP, | ||
upx=EXE_UPX, | ||
runtime_tmpdir=EXE_RUNTIME_TMP_DIR, | ||
console=DEBUGGING | ||
) | ||
coll = COLLECT( | ||
exe, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
strip=COLLECT_STRIP, | ||
upx=COLLECT_UPX, | ||
upx_exclude=[], | ||
name=COLLECT_NAME | ||
) | ||
|
||
# copy files for distribution | ||
shutil.copytree('./src/airunner/data', './dist/airunner-socket-server/data') | ||
|
||
# copy sd config files | ||
os.makedirs('./dist/airunner/diffusers/pipelines/stable_diffusion', exist_ok=True) | ||
shutil.copyfile('./src/airunner/v1.yaml', './dist/airunner-socket-server/v1.yaml') | ||
shutil.copyfile('./src/airunner/v2.yaml', './dist/airunner-socket-server/v2.yaml') | ||
shutil.copyfile('./src/airunner/sd_xl_base.yaml', './dist/airunner-socket-server/sd_xl_base.yaml') | ||
shutil.copyfile('./src/airunner/sd_xl_refiner.yaml', './dist/airunner-socket-server/sd_xl_refiner.yaml') | ||
|
||
shutil.copyfile( | ||
f'./venv/lib/python3.10/site-packages/JIT/__pycache__/random.cpython-310.pyc', | ||
f'./dist/airunner-socket-server/random.pyc' | ||
) |
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
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
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
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
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
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
Oops, something went wrong.