Skip to content

Commit

Permalink
Merge branch 'feature/deconvolution' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelly committed Nov 10, 2024
2 parents e767742 + 80c0339 commit 9f1b585
Show file tree
Hide file tree
Showing 21 changed files with 992 additions and 245 deletions.
143 changes: 107 additions & 36 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ env:
ai_s3_bucket_name: ${{ secrets.AI_S3_BUCKET_NAME }}
ai_s3_bge_bucket_name: ${{ secrets.AI_S3_BGE_BUCKET_NAME }}
ai_s3_denoise_bucket_name: ${{ secrets.AI_S3_DENOISE_BUCKET_NAME }}
ai_s3_deconvolution_object_bucket_name: ${{ secrets.AI_S3_DECONVOLUTION_OBJECT_BUCKET_NAME }}
ai_s3_deconvolution_stars_bucket_name: ${{ secrets.AI_S3_DECONVOLUTION_STARS_BUCKET_NAME }}

on:
push:
tags:
- "*.*.*"

jobs:

# build-linux-deb:
# runs-on: ubuntu-20.04
# steps:
# - name: setup python
# uses: actions/setup-python@v2
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
# python-version: '3.11'
# - name: checkout repository
# uses: actions/checkout@v3
# - name: configure ai s3 secrets
Expand All @@ -45,19 +47,19 @@ jobs:
# - name: create GraXpert-linux bundle
# run: python ./setup.py bdist_deb
# - name: store artifacts
# uses: actions/upload-artifact@v2
# uses: actions/upload-artifact@v4
# with:
# name: graxpert_${{github.ref_name}}-1_amd64.deb
# path: ./dist/graxpert_${{github.ref_name}}-1_amd64.deb
# retention-days: 5

build-linux-zip:
runs-on: ubuntu-20.04
steps:
- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
Expand All @@ -67,11 +69,13 @@ jobs:
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "bge_bucket_name = \"$ai_s3_bge_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "deconvolution_object_bucket_name = \"$ai_s3_deconvolution_object_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "deconvolution_stars_bucket_name = \"$ai_s3_deconvolution_stars_bucket_name\"" >> ./graxpert/s3_secrets.py
- name: install dependencies
run: |
pip install setuptools wheel cx_freeze && \
pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \
pip install setuptools wheel cx_freeze==7.2.3 && \
pip install onnxruntime-gpu && \
pip install -r requirements.txt
- name: patch version
run: |
Expand All @@ -84,7 +88,7 @@ jobs:
cd ./dist && \
zip -r ./GraXpert-linux.zip ./GraXpert-linux
- name: store artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: GraXpert-linux.zip
path: ./dist/GraXpert-linux.zip
Expand All @@ -94,9 +98,9 @@ jobs:
runs-on: windows-latest
steps:
- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
Expand All @@ -107,25 +111,81 @@ jobs:
"ro_secret_key = `"$env:ai_s3_secret_key`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"bucket_name = `"$env:ai_s3_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"bge_bucket_name = `"$env:ai_s3_bge_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"denoise_bucket_name = `"$env:ai_s3_denoise_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py
"denoise_bucket_name = `"$env:ai_s3_denoise_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"deconvolution_object_bucket_name = `"$env:ai_s3_deconvolution_object_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"deconvolution_stars_bucket_name = `"$env:ai_s3_deconvolution_stars_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py
- name: install dependencies
run: |
pip install setuptools wheel cx_freeze; `
pip install setuptools wheel cx_freeze==7.2.3; `
pip install onnxruntime-directml; `
pip install -r requirements.txt
- name: patch version
run: ./releng/patch_version.ps1
- name: create GraXpert-win64 bundle
run: python ./setup.py bdist_msi
- name: store artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: GraXpert-${{github.ref_name}}-win64.msi
path: ./dist/GraXpert-${{github.ref_name}}-win64.msi
retention-days: 5

build-macos-arm64:
runs-on: macos-14
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
run: |
echo "endpoint = \"$ai_s3_endpoint\"" >> ./graxpert/s3_secrets.py && \
echo "ro_access_key = \"$ai_s3_access_key\"" >> ./graxpert/s3_secrets.py && \
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "bge_bucket_name = \"$ai_s3_bge_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "deconvolution_object_bucket_name = \"$ai_s3_deconvolution_object_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "deconvolution_stars_bucket_name = \"$ai_s3_deconvolution_stars_bucket_name\"" >> ./graxpert/s3_secrets.py
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install dependencies
run: |
brew install python-tk && \
pip3 install setuptools wheel pyinstaller --break-system-packages && \
pip3 install onnxruntime --break-system-packages && \
pip3 install -r requirements.txt --break-system-packages
- name: patch version
run: |
chmod u+x ./releng/patch_version.sh && \
./releng/patch_version.sh
- name: create GraXpert-macos-arm64 bundle
# TODO migrate to cx_freeze
run: |
pyinstaller \
./GraXpert-macos-arm64.spec
- name: install create-dmg
run: brew install create-dmg
- name: create .dmg
run: |
create-dmg \
--volname "GraXpert-macos-arm64" \
--window-pos 50 50 \
--window-size 1920 1080 \
--icon-size 100 \
--icon "GraXpert.app" 200 190 \
--app-drop-link 400 190 \
"dist/GraXpert-macos-arm64.dmg" \
"dist/GraXpert.app/"
- name: store artifacts
uses: actions/upload-artifact@v4
with:
name: GraXpert-macos-arm64.dmg
path: ./dist/GraXpert-macos-arm64.dmg
retention-days: 5

build-macos-x86_64:
runs-on: macos-11
runs-on: macos-13
steps:
- name: checkout repository
uses: actions/checkout@v3
Expand All @@ -136,25 +196,31 @@ jobs:
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "bge_bucket_name = \"$ai_s3_bge_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "deconvolution_object_bucket_name = \"$ai_s3_deconvolution_object_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "deconvolution_stars_bucket_name = \"$ai_s3_deconvolution_stars_bucket_name\"" >> ./graxpert/s3_secrets.py
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
# - name: unbreak python in github actions
# run: |
# find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
# sudo rm -rf /Library/Frameworks/Python.framework/
# brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install dependencies
run: |
brew install python-tk && \
pip3 install setuptools wheel pyinstaller && \
pip3 install onnxruntime && \
pip3 install -r requirements.txt
pip3 install setuptools wheel pyinstaller --break-system-packages && \
pip3 install onnxruntime --break-system-packages && \
pip3 install -r requirements.txt --break-system-packages
- name: patch version
run: |
chmod u+x ./releng/patch_version.sh && \
./releng/patch_version.sh
- name: create GraXpert-macos-x86_64 bundle
# TODO migrato to cx_freeze
# TODO migrate to cx_freeze
run: |
pyinstaller \
./GraXpert-macos-x86_64.spec
Expand All @@ -172,7 +238,7 @@ jobs:
"dist/GraXpert-macos-x86_64.dmg" \
"dist/GraXpert.app/"
- name: store artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: GraXpert-macos-x86_64.dmg
path: ./dist/GraXpert-macos-x86_64.dmg
Expand All @@ -181,29 +247,34 @@ jobs:
release:
runs-on: ubuntu-latest
# needs: [build-linux-deb, build-linux-zip, build-windows, build-macos-x86_64]
needs: [build-linux-zip, build-windows, build-macos-x86_64]
needs: [build-linux-zip, build-windows, build-macos-x86_64, build-macos-arm64]
steps:
# - name: download linux deb
# uses: actions/download-artifact@v2
# uses: actions/download-artifact@v4
# with:
# name: graxpert_${{github.ref_name}}-1_amd64.deb
- name: download linux zip
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: GraXpert-linux.zip
- name: download windows exe
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: GraXpert-${{github.ref_name}}-win64.msi
- name: download macos artifacts
uses: actions/download-artifact@v2
- name: download macos x86_64 artifacts
uses: actions/download-artifact@v4
with:
name: GraXpert-macos-x86_64.dmg
- name: download macos arm artifacts
uses: actions/download-artifact@v4
with:
name: GraXpert-macos-arm64.dmg
- name: create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
GraXpert-linux.zip
GraXpert-${{github.ref_name}}-win64.msi
GraXpert-macos-x86_64.dmg
# graxpert_${{github.ref_name}}-1_amd64.deb
GraXpert-macos-arm64.dmg
# graxpert_${{github.ref_name}}-1_amd64.deb
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*-scaled.png
__pycache__
graxpert/s3_secrets.py
python-venv
build
dist
.idea
.venv
python-venv
env_graxpert/
6 changes: 3 additions & 3 deletions GraXpert-macos-arm64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@


block_cipher = None

from PyInstaller.utils.hooks import copy_metadata

a = Analysis(['./graxpert/main.py'],
pathex=[],
binaries=[],
datas=[('./img/*', './img/'), ('./graxpert-dark-blue.json', './')],
datas=[('./img/*', './img/'), ('./graxpert-dark-blue.json', './')] + copy_metadata('xisf'),
hiddenimports=['PIL._tkinter_finder', 'tkinter'],
hookspath=['./releng'],
hooksconfig={},
Expand All @@ -17,7 +17,7 @@ a = Analysis(['./graxpert/main.py'],
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
Expand Down
Loading

0 comments on commit 9f1b585

Please sign in to comment.