-
Couldn't load subscription status.
- Fork 143
Add MacOS build packaging tool #734
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
Draft
OtabekRintaro
wants to merge
7
commits into
Deep-MI:dev
Choose a base branch
from
OtabekRintaro:feature/release-packaging
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f73e360
Add package installer tool for macos
OtabekRintaro 705e27d
Move docker and singularity into tools
OtabekRintaro 051c9ff
Create workflow for MacOS package deployment
OtabekRintaro 9a34ec1
Apply suggestions from code review
dkuegler 5d43d92
Reformat scripts and fix broken paths
OtabekRintaro 450846f
Upload assets instead of artifacts in deploy.yml
OtabekRintaro d06303d
Fix script imports style
OtabekRintaro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,55 +1,94 @@ | ||
| name: MAN deploy-docker | ||
|
|
||
| on: | ||
| # release: | ||
| # types: | ||
| # - published | ||
| release: | ||
| types: | ||
| - published | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| deploy-gpu: | ||
| runs-on: ubuntu-latest | ||
| deploy-mac: | ||
| runs-on: macos-14 | ||
| timeout-minutes: 120 | ||
|
|
||
| env: | ||
| VERSION: 242 | ||
| FREESURFER_URL: https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-macOS-darwin_x86_64-7.4.1.tar.gz | ||
| RELEASE_ASSETS: true | ||
| strategy: | ||
| matrix: | ||
| arch: [intel, arm] | ||
| steps: | ||
| - name: Get repository name. | ||
| run: echo "FASTSURFER_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Login to Docker | ||
| uses: docker/login-action@v2 | ||
| - name: Set up python environment | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
| - name: Build Docker image GPU | ||
| run: python Docker/build.py --device cuda --tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} | ||
| - name: Add additional tags | ||
| python-version: '3.10' | ||
| - name: install dependencies | ||
| run: | | ||
| docker tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-latest | ||
| docker tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:latest | ||
| - name: Push Docker image GPU | ||
| run: docker push --all-tags ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} | ||
| deploy-cpu: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 120 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Login to Docker | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
| - name: Build Docker image CPU | ||
| run: python Docker/build.py --device cpu --tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-${{ github.event.release.tag_name }} | ||
| - name: Add additional tags | ||
| run: | | ||
| docker tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-${{ github.event.release.tag_name }} ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-latest | ||
| - name: Push Docker image CPU | ||
| run: docker push --all-tags ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-${{ github.event.release.tag_name }} | ||
| python -m pip install py2app | ||
|
|
||
| brew update | ||
| brew upgrade || true | ||
| - name: package app for ${{ matrix.arch }} | ||
| run: tools/macos_build/build_release_package.sh ${{ env.VERSION }} ${{ matrix.arch }} ${{ env.FASTSURFER_DIR }} ${{ env.FREESURFER_URL }} | ||
| - name: Move assets. | ||
| if: env.RELEASE_ASSETS == 'true' | ||
| run: | | ||
| mkdir assets | ||
| mv tools/macos_build/installer/* assets/ | ||
| - name: Upload release assets. | ||
| uses: softprops/action-gh-release@v2 | ||
| if: env.RELEASE_ASSETS == 'true' | ||
| with: | ||
| files: ${{ env.FASTSURFER_DIR }}/assets/* | ||
| # deploy-gpu: | ||
| # runs-on: ubuntu-latest | ||
| # timeout-minutes: 120 | ||
| # steps: | ||
| # - name: Checkout repository | ||
| # uses: actions/checkout@v3 | ||
| # with: | ||
| # fetch-depth: 0 | ||
| # - name: Login to Docker | ||
| # uses: docker/login-action@v2 | ||
| # with: | ||
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| # - name: Set up Docker Buildx | ||
| # uses: docker/setup-buildx-action@v2 | ||
| # - name: Build Docker image GPU | ||
| # run: python Docker/build.py --device cuda --tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} | ||
| # - name: Add additional tags | ||
| # run: | | ||
| # docker tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-latest | ||
| # docker tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:latest | ||
| # - name: Push Docker image GPU | ||
| # run: docker push --all-tags ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:gpu-${{ github.event.release.tag_name }} | ||
| # deploy-cpu: | ||
| # runs-on: ubuntu-latest | ||
| # timeout-minutes: 120 | ||
| # steps: | ||
| # - name: Checkout repository | ||
| # uses: actions/checkout@v3 | ||
| # with: | ||
| # fetch-depth: 0 | ||
| # - name: Login to Docker | ||
| # uses: docker/login-action@v2 | ||
| # with: | ||
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| # - name: Set up Docker Buildx | ||
| # uses: docker/setup-buildx-action@v2 | ||
| # - name: Build Docker image CPU | ||
| # run: python Docker/build.py --device cpu --tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-${{ github.event.release.tag_name }} | ||
| # - name: Add additional tags | ||
| # run: | | ||
| # docker tag ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-${{ github.event.release.tag_name }} ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-latest | ||
| # - name: Push Docker image CPU | ||
| # run: docker push --all-tags ${{ secrets.DOCKERHUB_USERNAME }}/fastsurfer:cpu-${{ github.event.release.tag_name }} |
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,10 @@ | ||
| Running FastSurfer | ||
| ================== | ||
|
|
||
| If you want to run only segmentation (replace placeholders starting with "<" and ending with ">", see https://deep-mi.org/FastSurfer/stable): | ||
| `run_fastsurfer.sh --seg_only --sd <path/to/output/dir> --sid <subject_id> --t1 <path/to/subjects/t1/image>` | ||
| To full run fastsurfer: | ||
| `run_fastsurfer.sh --device mps --sd <path/to/output/dir> --sid <subject_id> --t1 <path/to/subjects/t1/image> --fs_license </path/to/freesurfer/license>` | ||
| Some files of **FreeSurfer** binaries require bypassing MacOS security, which is | ||
| significantly easier to do with the following command than manually and one by one. | ||
| ` xattr -dr com.apple.quarantine /Applications/freesurfer/*` |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be renamed to something like
MACOS.md