forked from AUTOMATIC1111/stable-diffusion-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
137 additions
and
0 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,57 @@ | ||
name: Deploy Images to GHCR | ||
|
||
|
||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
jobs: | ||
cancel_outstanding: | ||
name: Detect and cancel outstanding runs of this workflow | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Cancel Previous Runs | ||
if: ${{ (github.event.label.name == 'release') && !contains(github.event.pull_request.labels.*.name, 'skip-cancel') }} | ||
uses: styfle/cancel-workflow-action@0.11.0 | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
push-store-image: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
if: ${{ (github.event.label.name == 'release' ) && !contains(github.event.pull_request.labels.*.name, 'skip-cancel') }} | ||
steps: | ||
- name: 'Checkout GitHub Action' | ||
uses: actions/checkout@main | ||
- name: envvars | ||
run: | | ||
echo "RELEASE=$(cat build/vars/BUILD_TAG)" >> $GITHUB_ENV | ||
echo "REGISTRY=$(cat build/vars/REGISTRY)" >> $GITHUB_ENV | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
- name: free space | ||
run: | | ||
bash .github/workflows/freespace.sh | ||
##https://github.com/orgs/community/discussions/25678 | ||
- name: 'free up space' | ||
|
||
run: | | ||
rm -rf /opt/hostedtoolcache | ||
- name: 'Build sd-web-ui image' | ||
run: | | ||
cd build && \ | ||
RELEASE=${{ env.RELEASE }} \ | ||
REGISTRY=${{ env.REGISTRY }} \ | ||
docker buildx bake sd-web-ui -f docker-bake.hcl --push |
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,24 @@ | ||
|
||
variable "RELEASE" { | ||
default = "v1.0.0" | ||
} | ||
|
||
variable "REGISTRY" { | ||
default = "" | ||
} | ||
|
||
group "default" { | ||
targets = ["sd-web-ui"] | ||
} | ||
|
||
target "sd-web-ui" { | ||
dockerfile = "sd.Dockerfile" | ||
tags = ["${REGISTRY}${target.sd-web-ui.name}:${RELEASE}"] | ||
context = "." | ||
labels = { | ||
"org.opencontainers.image.source" = "https://github.com/webcoderz/stable-diffusion-webui" | ||
} | ||
} | ||
|
||
|
||
#RELEASE=$(cat build/vars/BUILD_TAG) REGISTRY=$(cat build/vars/REGISTRY) docker buildx bake --print |
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,54 @@ | ||
FROM nvidia/cuda:12.2.0-base-ubuntu22.04 | ||
ENV DEBIAN_FRONTEND noninteractive | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update -y \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y --no-install-recommends \ | ||
curl \ | ||
git \ | ||
git-lfs \ | ||
python3.10 \ | ||
python3.10-venv \ | ||
python3-pip \ | ||
libgl1 \ | ||
libglib2.0-0 | ||
RUN apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# user and workdir | ||
RUN useradd -m user | ||
RUN mkdir /work && chown -R user:user /work | ||
USER user | ||
WORKDIR /work | ||
|
||
|
||
################################ | ||
# setup | ||
################################ | ||
|
||
RUN git clone https://github.com/webcoderz/stable-diffusion-webui.git | ||
WORKDIR /work/stable-diffusion-webui | ||
|
||
|
||
|
||
# setup | ||
RUN python3 -mvenv venv && /work/stable-diffusion-webui/venv/bin/python -c "from launch import *; prepare_environment()" --skip-torch-cuda-test --no-download-sd-model | ||
|
||
|
||
|
||
################################ | ||
# entrypoint | ||
################################ | ||
|
||
|
||
|
||
|
||
EXPOSE 7860 | ||
EXPOSE 8000 | ||
EXPOSE 8265 | ||
EXPOSE 6388 | ||
EXPOSE 10001 | ||
|
||
CMD ["./webui.sh", "--xformers --cors-allow-origins=* --api"] |
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 @@ | ||
v0.0.1 |
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 @@ | ||
ghcr.io/webcoderz/stable-diffusion-webui/ |