-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from CBICA/main
Main to ge-dev
- Loading branch information
Showing
33 changed files
with
1,139 additions
and
986 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,28 @@ | ||
name: macos build | ||
|
||
# workflow dispatch has been added for testing purposes | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: ["macos-13"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install spare scores | ||
run: | | ||
python -m pip cache purge | ||
pip install -r requirements.txt | ||
pip install setuptools twine wheel | ||
python -m pip install . | ||
- name: Run unit tests | ||
run: | | ||
cd tests/ && pytest --cov=../ --cov-report=xml | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: CBICA/NiChart_DLMUSE |
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
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,40 @@ | ||
name: Upload Python Package | ||
|
||
on: workflow_dispatch | ||
|
||
permissions: | ||
contents: read | ||
id-token: write # Allow GitHub to mint tokens | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest # Can use macos-latest if needed | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install setuptools | ||
pip install twine | ||
pip install wheel | ||
sudo apt-get install jq | ||
- name: Clean previous builds | ||
run: rm -rf dist | ||
|
||
- name: Build package | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish package to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: twine upload --repository-url https://upload.pypi.org/legacy/ dist/* |
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
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
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,23 @@ | ||
name: ubuntu tests | ||
|
||
# workflow dispatch has been added for testing purposes | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: ["ubuntu-latest"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install spare scores | ||
run: | | ||
python -m pip cache purge | ||
pip install -r requirements.txt | ||
pip install setuptools twine wheel | ||
python -m pip install . | ||
- name: Run unit tests | ||
run: | | ||
cd tests && pytest |
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 |
---|---|---|
@@ -1,30 +1,38 @@ | ||
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime | ||
|
||
LABEL IMAGE="NiChart_DLMUSE" | ||
LABEL VERSION="0.1.7" | ||
LABEL CI_IGNORE="True" | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install gcc \ | ||
mono-mcs \ | ||
gnupg2 \ | ||
git \ | ||
htop \ | ||
zip \ | ||
unzip \ | ||
g++ && \ | ||
apt-key del 3bf863cc && \ | ||
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install --upgrade pip && \ | ||
pip install Cmake | ||
|
||
# RUN mkdir /NiChart_DLMUSE | ||
# COPY ./ /NiChart_DLMUSE/ | ||
# RUN cd /NiChart_DLMUSE && pip install . | ||
|
||
RUN cd / && \ | ||
git clone https://github.com/CBICA/NiChart_DLMUSE && \ | ||
cd /NiChart_DLMUSE && pip install . | ||
|
||
CMD ["NiChart_DLMUSE" ] | ||
|
||
## Suggested pull command (run from anywhere): | ||
## CUDA_VERSION=11.8 docker pull cbica/nichart_dlmuse:1.0.1-cuda${CUDA_VERSION} | ||
## OR | ||
## docker pull cbica/nichart_dlmuse:1.0.1 | ||
|
||
## Suggested automatic inference run time command | ||
## Place input in /path/to/input/on/host. | ||
## Replace -d cuda with -d mps or -d cpu as needed, or don't pass at all to automatically use CUDA. | ||
## Each "/path/to/.../on/host" is a placeholder, use your actual paths! | ||
## docker run -it --name DLMUSE_inference --rm | ||
## --mount type=bind,source=/path/to/input/on/host,target=/input,readonly | ||
## --mount type=bind,source=/path/to/output/on/host,target=/output | ||
## --gpus all cbica/nichart_dlmuse:1.0.1 -d cuda | ||
|
||
## Suggested build command (run from the top-level repo directory): | ||
## CUDA_VERSION=11.8 docker build --build-arg CUDA_VERSION=${CUDA_VERSION} | ||
## -t cbica/nichart_dlmuse:1.0.1-cuda${CUDA_VERSION} . | ||
## OR | ||
## docker build -t cbica/nichart_dlmuse:1.0.1 . | ||
|
||
ARG NICHART_DLMUSE_VERSION="1.0.1" | ||
ARG CUDA_VERSION="11.8" | ||
ARG TORCH_VERSION="2.4.1" | ||
ARG CUDNN_VERSION="9" | ||
|
||
## This base image is generally the smallest with all prereqs. | ||
FROM pytorch/pytorch:${TORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-runtime | ||
|
||
WORKDIR /app | ||
COPY . /app/ | ||
|
||
RUN pip install . | ||
RUN mkdir /dummyinput && mkdir /dummyoutput | ||
## Cache DLMUSE and DLICV models with an empty job so no download is needed later | ||
RUN DLMUSE -i /dummyinput -o /dummyoutput && DLICV -i /dummyinput -o /dummyoutput | ||
ENTRYPOINT ["NiChart_DLMUSE", "-i", "/input", "-o", "/output"] | ||
CMD ["-d", "cuda"] |
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
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
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
Oops, something went wrong.