Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for build #921

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 85 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ubuntu:22.04 as base_image
USER root
ENV TZ=America/Denver
ENV HOME=/app
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get upgrade -y \
Expand All @@ -26,28 +27,74 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get install -y libjpeg-dev \
&& apt-get install -y zlib1g-dev \
&& apt-get install -y libpng-dev \
&& apt-get install patchelf -y \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt update \
&& apt install python3.10 -y \
&& apt install python3.10-distutils -y \
&& apt install python3-pip -y \
&& apt install python3.10-tk -y \
&& apt install -y upx \
&& apt-get install patchelf -y \
&& apt-get install ccache -y \
&& apt-get install -y patchelf \
&& apt-get install -y ccache \
&& apt-get install -y libxcb-xinerama0 \
&& apt-get install qt6-qpa-plugins -y \
&& apt-get install libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev libxcb-xinerama0 -y \
&& apt-get install -y qt6-base-dev \
&& apt-get install -y gstreamer1.0-gl \
&& apt-get install -y cmake \
&& apt-get install -y ninja-build \
&& apt-get install -y python3 \
&& apt-get install -y python3-pip \
&& apt-get install -y python3.10 \
&& apt-get install -y python3.10-distutils \
&& apt-get install -y python3.10-tk \
&& apt-get install -y upx \
&& apt-get install -y libgl1-mesa-glx \
&& apt-get install -y libglib2.0-0 \
&& apt-get install -y libsm6 \
&& apt-get install -y libxext6 \
&& apt-get install -y libxrender-dev \
&& ln -s /usr/share/tcltk/tcl8.6 /usr/share/tcltk/tcl8 \
&& rm -rf /var/lib/apt/lists/ \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 \
&& rm -rf /var/lib/apt/lists/*

FROM base_image as install_requirements
FROM base_image as download_qt
USER root
ENV TZ=America/Denver
ENV HOME=/app
RUN wget https://download.qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz

FROM download_qt as build_qt
USER root
ENV TZ=America/Denver
ENV HOME=/app
RUN tar -xf qt-everywhere-src-6.7.0.tar.xz \
&& cd qt-everywhere-src-6.7.0 \
&& cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local/qt6 \
&& cmake --build build --parallel

FROM build_qt as install_qt
USER root
ENV TZ=America/Denver
ENV HOME=/app
RUN cd qt-everywhere-src-6.7.0/build \
&& if [ -f cmake_install.cmake ]; then cmake --install .; else echo "cmake_install.cmake not found"; exit 1; fi \
&& cd ../.. \
&& rm -rf qt-everywhere-src-6.7.0 qt-everywhere-src-6.7.0.tar.xz

FROM install_qt as create_user
RUN useradd -ms /bin/bash appuser \
&& chown -R appuser:appuser /app \
&& apt-get update \
&& apt-get install -y libxkbcommon-x11-0 \
&& rm -rf /var/lib/apt/lists/*

USER appuser
WORKDIR /app
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local

ENV PATH="/usr/local/qt6/bin:${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/qt6/lib:${LD_LIBRARY_PATH}"

FROM create_user as install_requirements
USER appuser
WORKDIR /app
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local
RUN pip install nvidia-pyindex
WORKDIR /app
RUN pip install --upgrade pip
Expand All @@ -57,34 +104,50 @@ RUN pip install requests aihandler cmake
RUN pip uninstall torch torchvision -y
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade

FROM install_requirements as fix_tcl
USER root
RUN ln -s /usr/share/tcltk/tcl8.6 /usr/share/tcltk/tcl8

FROM fix_tcl as install_apps
FROM install_requirements as install_apps
USER appuser
WORKDIR /app
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local
RUN python3 -c "from accelerate.utils import write_basic_config; write_basic_config(mixed_precision='fp16')"
RUN pip uninstall nvidia-cublas-cu11 nvidia-cublas-cu12 -y
RUN pip uninstall xformers -y

FROM install_apps as more_env
USER appuser
WORKDIR /app
ENV PATH="/usr/local/lib/python3.10:/usr/local/lib/python3.10/bin:${PATH}"
ENV PYTHONPATH="/usr/local/lib/python3.10:/usr/local/lib/python3.10/bin:${PYTHONPATH}"
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local
RUN pip install pyinstaller

FROM more_env as build_files
USER appuser
WORKDIR /app
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local
COPY dobuild.py dobuild.py
COPY build.sh build.sh
COPY setup.py setup.py


FROM build_files as build_airunner
USER appuser
WORKDIR /app
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local
RUN git clone https://github.com/Capsize-Games/airunner.git /app/airunner \
&& cd /app/airunner \
&& git checkout master \
&& git pull \
&& python3 -m pip install .

FROM build_airunner as build_airunner_executable
USER appuser
WORKDIR /app
ENV HOME=/app
ENV PATH="/home/appuser/.local/bin:${PATH}"
ENV PYTHONUSERBASE=/home/appuser/.local
COPY build.airunner.linux.prod.spec build.airunner.linux.prod.spec
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
recursive-include src/airunner/cursors **/*
recursive-include src/airunner/filters **/*
recursive-include src/airunner/icons **/*
recursive-include src/airunner/images **/*
recursive-include src/airunner/styles **/*
recursive-include src/airunner/widgets **/*.ui
recursive-include src/airunner/windows **/*.ui
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="airunner",
version="3.0.13",
version="3.0.14",
author="Capsize LLC",
description="A Stable Diffusion GUI",
long_description=open("README.md", "r", encoding="utf-8").read(),
Expand Down Expand Up @@ -68,8 +68,18 @@
"EbookLib==0.18",
"html2text==2024.2.26"
],
dependency_links=[
],
package_data={
"airunner": [
"cursors/*",
"filters/*",
"icons/*",
"images/*",
"styles/*",
"widgets/**/*.ui",
"windows/**/*.ui",
],
},
include_package_data=True,
entry_points={
'console_scripts': [
'airunner=airunner.main:main',
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added src/airunner/utils/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.