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

Improve experience of running CI via a fork repo #1038

Merged
merged 34 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
907158a
Update examples.yml
sh-tsai Jul 24, 2024
1b6e338
fix
sh-tsai Jul 24, 2024
22ac762
fix
sh-tsai Jul 24, 2024
1952e1b
refine
jackalcooper Jul 24, 2024
69c69fc
Merge branch 'main' into patch-1
jackalcooper Jul 25, 2024
0dfc234
fix
jackalcooper Jul 25, 2024
41df83b
try fix
jackalcooper Jul 25, 2024
8df132b
Merge branch 'main' into patch-1
jackalcooper Jul 26, 2024
17f335d
try fix
jackalcooper Jul 26, 2024
0264d45
Merge branch 'patch-1' of https://github.com/sh-tsai/onediff into pat…
jackalcooper Jul 26, 2024
35db6fa
fix
jackalcooper Jul 26, 2024
b84fe50
fix
jackalcooper Jul 26, 2024
2c4022d
fix
jackalcooper Jul 26, 2024
b2635ac
fix
jackalcooper Jul 26, 2024
5605c3e
fix
jackalcooper Jul 26, 2024
e8ac485
fix
jackalcooper Jul 26, 2024
1a4e351
rm git dir
jackalcooper Jul 26, 2024
a32580c
fix
jackalcooper Jul 26, 2024
6030662
fix
jackalcooper Jul 26, 2024
bf217cc
refine
jackalcooper Jul 26, 2024
e75ebb6
add
jackalcooper Jul 26, 2024
30fa8f9
add
jackalcooper Jul 26, 2024
b40439b
needs: [upload_src]
jackalcooper Jul 26, 2024
ff9d5a9
fix
jackalcooper Jul 26, 2024
9d45466
add
jackalcooper Jul 26, 2024
42d95de
Merge branch 'main' into patch-1
strint Jul 26, 2024
f74d620
skip webui
jackalcooper Jul 26, 2024
4bce30c
rm webui
jackalcooper Jul 26, 2024
46675d1
Merge branch 'patch-1' of https://github.com/sh-tsai/onediff into pat…
jackalcooper Jul 26, 2024
773355b
if: github.event.pull_request.head.repo.full_name != github.repository
jackalcooper Jul 26, 2024
1fcb022
Revert "rm webui"
jackalcooper Jul 26, 2024
881b0e9
use
jackalcooper Jul 26, 2024
922531b
Update examples.yml
jackalcooper Jul 26, 2024
6ff24ac
Update examples.yml
jackalcooper Jul 26, 2024
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
73 changes: 41 additions & 32 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ env:
STABLE_DIFFUSION_XL_COMMIT_HASH: 45c443b316737a4ab6e40413d7794a7f5657c19f
K_DIFFUSION_COMMIT_HASH: ab527a9a6d347f364e3d185ba6d714e22d80cb3c
BLIP_COMMIT_HASH: 48211a1594f1321b00f14c9f7a5b4813144b2fb9

OSS_AK_ID_BASE64: TFRBSTV0RmROVlFTQ2VQdG1wdkhQYlQx
OSS_AK_SC_BASE64: MTlrSlFRT1M0WUZvQ05SV1IyTUxDUDBpTlM0UURS
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }}
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}

concurrency:
group: sd-examples-${{ github.ref }}
Expand All @@ -46,18 +49,24 @@ jobs:
python-version: '3.10'
- uses: pre-commit/action@v3.0.1
upload_src:
if: github.repository == 'siliconflow/onediff'
runs-on: [ubuntu-latest]
outputs:
onediff_src_url: ${{ steps.upload_to_oss.outputs.onediff_src_url }}
comfy_src_url: ${{ steps.upload_to_oss.outputs.comfy_src_url }}
webui_src_url: ${{ steps.upload_to_oss.outputs.webui_src_url }}
onediff_src_url: ${{ steps.set_env.outputs.onediff_src_url }}
comfy_src_url: ${{ steps.set_env.outputs.comfy_src_url }}
webui_src_url: ${{ steps.set_env.outputs.webui_src_url }}
steps:
- name: Setup ossutil
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
OSS_ACCESS_KEY_ID=$(echo -n "${{ env.OSS_AK_ID_BASE64 }}" | base64 -d)
OSS_ACCESS_KEY_SECRET=$(echo -n "${{ env.OSS_AK_SC_BASE64 }}" | base64 -d)
echo "OSS_ACCESS_KEY_ID=${OSS_ACCESS_KEY_ID}" >> ${GITHUB_ENV}
echo "OSS_ACCESS_KEY_SECRET=${OSS_ACCESS_KEY_SECRET}" >> ${GITHUB_ENV}
- name: Setup ossutil
run: |
curl http://gosspublic.alicdn.com/ossutil/1.7.15/ossutil64 -o ossutil64
sudo chmod +x ossutil64
./ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${{ secrets.OSS_ACCESS_KEY_ID }} -k ${{ secrets.OSS_ACCESS_KEY_SECRET }} -L EN -c $HOME/.ossutilconfig
./ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${{ env.OSS_ACCESS_KEY_ID }} -k ${{ env.OSS_ACCESS_KEY_SECRET }} -L EN -c $HOME/.ossutilconfig
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -136,18 +145,22 @@ jobs:
git reset --hard
git clean -f
zip -r webui-src.zip .
- name: Upload src
id: upload_to_oss
- name: Set src env
id: set_env
run: |
ONEDIFF_DST="oss://gh-src-cache/onediff/${{ github.sha }}/onediff-src.zip"
COMFY_DST="oss://gh-src-cache/onediff/${{ github.sha }}/comfyui-src.zip"
WEBUI_DST="oss://gh-src-cache/onediff/${{ github.sha }}/webui-src.zip"
./ossutil64 cp --disable-ignore-error --update onediff/onediff-src.zip ${ONEDIFF_DST}
./ossutil64 cp --disable-ignore-error --update ComfyUI/comfyui-src.zip ${COMFY_DST}
./ossutil64 cp --disable-ignore-error --update ${{ env.WEBUI_SRC_DIR }}/webui-src.zip ${WEBUI_DST}
echo "onediff_src_url=${ONEDIFF_DST}" >> $GITHUB_OUTPUT
echo "comfy_src_url=${COMFY_DST}" >> $GITHUB_OUTPUT
echo "webui_src_url=${WEBUI_DST}" >> $GITHUB_OUTPUT
- name: Upload src
id: upload_to_oss
run: |
./ossutil64 cp --disable-ignore-error --update onediff/onediff-src.zip ${{ steps.set_env.outputs.onediff_src_url }}
./ossutil64 cp --disable-ignore-error --update ComfyUI/comfyui-src.zip ${{ steps.set_env.outputs.comfy_src_url }}
./ossutil64 cp --disable-ignore-error --update ${{ env.WEBUI_SRC_DIR }}/webui-src.zip ${{ steps.set_env.outputs.webui_src_url }}

run-examples:
name: " ${{ matrix.test-suite }} ${{ matrix.image }}"
runs-on: [self-hosted, cuda]
Expand All @@ -156,62 +169,58 @@ jobs:
fail-fast: false
max-parallel: 5
matrix:
should-run-pro:
- ${{ github.event.pull_request.head.repo.full_name == github.repository }}
image:
- onediff:cu118
- onediff-pro:cu121
test-suite:
- diffusers_examples
- comfy
- webui
exclude:
- should-run-pro: false
image: onediff-pro:cu121
steps:
- name: Login to ACR with the AccessKey pair
if: github.event.pull_request.head.repo.full_name == github.repository
uses: aliyun/acr-login@v1
with:
login-server: https://registry.${{env.REGION_ID}}.aliyuncs.com
username: "${{ secrets.ACR_USERNAME }}"
password: "${{ secrets.ACR_PASSWORD }}"
- name: Setup ossutil
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
OSS_ACCESS_KEY_ID=$(echo -n "${{ env.OSS_AK_ID_BASE64 }}" | base64 -d)
OSS_ACCESS_KEY_SECRET=$(echo -n "${{ env.OSS_AK_SC_BASE64 }}" | base64 -d)
echo "OSS_ACCESS_KEY_ID=${OSS_ACCESS_KEY_ID}" >> ${GITHUB_ENV}
echo "OSS_ACCESS_KEY_SECRET=${OSS_ACCESS_KEY_SECRET}" >> ${GITHUB_ENV}
- name: Fix permissions
run: |
set -x
docker run --rm -v $PWD:$PWD -w $PWD busybox rm -rf *
docker run --rm -v $PWD:$PWD -w $PWD busybox rm -rf .[^.]* *
- name: Setup ossutil
if: github.repository == 'siliconflow/onediff'
run: |
if [ ! -f "$HOME/ossutil64" ]; then
curl http://gosspublic.alicdn.com/ossutil/1.7.15/ossutil64 -o $HOME/ossutil64
chmod +x $HOME/ossutil64
fi
$HOME/ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${{ secrets.OSS_ACCESS_KEY_ID }} -k ${{ secrets.OSS_ACCESS_KEY_SECRET }} -L EN -c $HOME/.ossutilconfig
$HOME/ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${{ env.OSS_ACCESS_KEY_ID }} -k ${{ env.OSS_ACCESS_KEY_SECRET }} -L EN -c $HOME/.ossutilconfig
- name: Checkout vis OSS
if: github.repository == 'siliconflow/onediff'
run: |
$HOME/ossutil64 cp ${{ needs.upload_src.outputs.onediff_src_url }} .
unzip -o $(basename ${{ needs.upload_src.outputs.onediff_src_url }})
- name: Checkout Comfy vis OSS
if: matrix.test-suite == 'comfy' && github.repository == 'siliconflow/onediff'
if: matrix.test-suite == 'comfy'
run: |
$HOME/ossutil64 cp ${{ needs.upload_src.outputs.comfy_src_url }} .
unzip -o $(basename ${{ needs.upload_src.outputs.comfy_src_url }})
- name: Checkout WebUI vis OSS
if: matrix.test-suite == 'webui' && github.repository == 'siliconflow/onediff'
if: matrix.test-suite == 'webui'
run: |
$HOME/ossutil64 cp ${{ needs.upload_src.outputs.webui_src_url }} .
unzip -o $(basename ${{ needs.upload_src.outputs.webui_src_url }}) -d ${{env.WEBUI_SRC_DIR}}
- name: Checkout
if: github.repository != 'siliconflow/onediff'
uses: actions/checkout@v4
- name: Checkout ComfyUI
if: matrix.test-suite == 'comfy' && github.repository != 'siliconflow/onediff'
uses: actions/checkout@v4
with:
repository: comfyanonymous/ComfyUI
path: ${{ env.COMFYUI_SRC_DIR }}
- name: Checkout Stable Diffusion WebUI
if: matrix.test-suite == 'webui' && github.repository != 'siliconflow/onediff'
uses: actions/checkout@v4
with:
repository: AUTOMATIC1111/stable-diffusion-webui
path: ${{ env.WEBUI_SRC_DIR }}
- name: Clean docker containers
run: |
docker rm -f ${{ env.CONTAINER_NAME }} || true
Expand Down
Loading