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

Pyinstaller Github Actions #2197

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
77b2d23
updated to Miniforge from Mambaforge
MikeSullivan7 May 8, 2024
e8530ca
use nsis to make installer
MikeSullivan7 May 8, 2024
5e134c7
update Jimver cuda-toolkit
MikeSullivan7 May 8, 2024
6706dd0
quick yml fix
MikeSullivan7 May 8, 2024
2e83d80
set CUDA_PATH to reflect local
MikeSullivan7 May 8, 2024
e8aee62
quick yml fix
MikeSullivan7 May 8, 2024
e6ca057
test cupy installed
MikeSullivan7 May 8, 2024
2779a31
list installed packages
MikeSullivan7 May 8, 2024
4c4e1df
archive spec file
MikeSullivan7 May 8, 2024
b0fb2d7
archive spec file
MikeSullivan7 May 9, 2024
7ba80b8
printing pyinstaller run options
MikeSullivan7 May 9, 2024
d0a8ecb
test
MikeSullivan7 May 9, 2024
fb0fabd
remove CUDA toolkit install
MikeSullivan7 May 9, 2024
1372aab
remove CUDA toolkit install
MikeSullivan7 May 9, 2024
d76e7c6
remove CUDA toolkit install
MikeSullivan7 May 9, 2024
9dba507
spec artifact
MikeSullivan7 May 9, 2024
e7fe662
use cupy-cuda102 whl
MikeSullivan7 May 9, 2024
bf04d0c
add cudatoolkit in meta.yml
MikeSullivan7 May 10, 2024
2245c3f
look at GH environment variables
MikeSullivan7 May 10, 2024
841975a
add CONDA_CUPY_CUDA_PATH
MikeSullivan7 May 10, 2024
8e386b4
add CONDA_CUPY_CUDA_PATH
MikeSullivan7 May 10, 2024
02c11b4
add CONDA_CUPY_CUDA_PATH
MikeSullivan7 May 10, 2024
551830b
change env back to main
MikeSullivan7 May 10, 2024
5dc7f7c
install CUDA before MI env
MikeSullivan7 May 10, 2024
c21fd0c
add use-only-tar-bz2: true to pip & miniforge caching
MikeSullivan7 May 10, 2024
e75f5a1
update cupy to v13 and cudatoolkit to v11.2
MikeSullivan7 May 13, 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
98 changes: 98 additions & 0 deletions .github/workflows/pyinstaller_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: PyInstaller Windows Build

on:
pull_request:
branches:
- 'main'
- 'release-*'
release:

jobs:
test:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
# Needed to get tags so that git describe works during package build
fetch-depth: "0"

- name: cuda-toolkit
uses: Jimver/cuda-toolkit@v0.2.15
with:
cuda: '10.2.89'

- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Miniforge and Pip packages
uses: actions/cache@v4
env:
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}
use-only-tar-bz2: true

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: false

- name: Cache Miniforge environment
uses: actions/cache@v4
id: cache-miniforge-environment
env:
CACHE_NUMBER: 0
with:
path: ${{env.CONDA}}/envs/mantidimaging-dev
key:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}
use-only-tar-bz2: true

- name: Mantid Imaging developer dependencies
if: steps.cache-miniforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
python ./setup.py create_dev_env

- name: List versions
shell: bash -l {0}
run: |
conda env list
python --version; conda list ; pip list

- name: PyInstaller Build
shell: bash -l {0}
env:
CONDA_CUPY_CUDA_PATH: ${{env.CUDA_PATH}}
run: |
conda activate mantidimaging-dev
set
echo "Cuda path: $CUDA_PATH"
echo "path: $PATH"
echo "dev env path: '${{env.CONDA}}/envs/mantidimaging-dev'"
cd packaging
python PackageWithPyInstaller.py

- name: Archive PyInstalled File
uses: actions/upload-artifact@v3
with:
name: MantidImagingSpec
path: packaging/MantidImaging.spec

- name: Archive PyInstalled File
uses: actions/upload-artifact@v3
with:
name: MantidImaging
path: packaging/dist
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ requirements:
- numexpr=2.8.*
- algotom=1.0.*
- tomopy=1.12.*
- cudatoolkit=10.2*
- cupy=10.2.*
- cudatoolkit=11.2.*
- cupy=13.0.*
- astra-toolbox=2.0.*
- requests=2.27.*
- h5py=3.6.*
Expand Down
3 changes: 1 addition & 2 deletions packaging/PackageWithPyInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def create_run_options():
run_options = [
'../mantidimaging/__main__.py', '--name=MantidImaging', '--additional-hooks-dir=hooks', '--onedir',
'../mantidimaging/__main__.py', '--name=MantidImaging', '--additional-hooks-dir=hooks',
'--icon=../images/mantid_imaging_unstable_64px.ico'
]

Expand Down Expand Up @@ -95,5 +95,4 @@ def add_exclude_modules(run_options):
# The default limit is 1000, meaning a recursion error would occur at around 115 nested imports.
# A limit of 5000 means the error should occur at about 660 nested imports.
sys.setrecursionlimit(sys.getrecursionlimit() * 5)

PyInstaller.__main__.run(create_run_options())
Loading