From bda2ea0ef7eba93dd7a5a980dc069fab206e6527 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 25 Mar 2025 12:37:46 -0700 Subject: [PATCH 1/5] Change dockerfile setup --- .github/workflows/dockerbuild.yml | 17 ++++++++++------- docker/Dockerfile => Dockerfile | 5 +---- docker/dockerbuild.sh | 13 ------------- 3 files changed, 11 insertions(+), 24 deletions(-) rename docker/Dockerfile => Dockerfile (89%) delete mode 100644 docker/dockerbuild.sh diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 474d825..576626d 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -5,8 +5,8 @@ on: branches: - 'master' pull_request: - branches: - - 'master' + # branches: + # - 'master' jobs: build: @@ -27,8 +27,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push docker image - run: sh ./docker/dockerbuild.sh \ - "${{github.sha}}" \ - "dipy" - + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/dipy/gpustreamlines:${{ github.sha }} + ghcr.io/dipy/gpustreamlines:latest diff --git a/docker/Dockerfile b/Dockerfile similarity index 89% rename from docker/Dockerfile rename to Dockerfile index 4f2fbbb..6b81161 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -31,10 +31,7 @@ RUN conda install -c conda-forge git RUN pip install numpy>=2.0.0 RUN pip install scipy>=1.13.0 cython nibabel dipy tqdm -RUN git clone --recurse-submodules \ - https://github.com/dipy/GPUStreamlines.git \ - /opt/GPUStreamlines -RUN cd /opt/GPUStreamlines && git reset --hard ${COMMIT} +COPY . /opt/GPUStreamlines # compile RUN cd /opt/GPUStreamlines && mkdir build && cd build \ diff --git a/docker/dockerbuild.sh b/docker/dockerbuild.sh deleted file mode 100644 index 334c0d6..0000000 --- a/docker/dockerbuild.sh +++ /dev/null @@ -1,13 +0,0 @@ -COMMIT=${1} -COMMIT="$(echo "${COMMIT}" | tr -d '[:space:]')" -export COMMIT -NO_TAG="ghcr.io/${2}/gpustreamlines" -TAG="${NO_TAG}:${COMMIT}" -TAG2="${NO_TAG}:latest" -TAG="$(echo "${TAG}" | tr -d '[:space:]')" -TAG2="$(echo "${TAG2}" | tr -d '[:space:]')" -NO_TAG="$(echo "${NO_TAG}" | tr -d '[:space:]')" - -echo $TAG -docker build --no-cache -t $TAG -t $TAG2 --build-arg COMMIT ./docker -docker push --all-tags $NO_TAG From 15f253076f3c14894b57d4af3f7cbf4b2559b235 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 25 Mar 2025 13:47:44 -0700 Subject: [PATCH 2/5] remove vendorized pybind --- Dockerfile | 3 ++- README.md | 2 -- external/pybind11 | 1 - pyproject.toml | 4 ++++ 4 files changed, 6 insertions(+), 4 deletions(-) delete mode 160000 external/pybind11 diff --git a/Dockerfile b/Dockerfile index 6b81161..06e9de9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,9 @@ ENV LD_LIBRARY_PATH /opt/anaconda/lib:${LD_LIBRARY_PATH} RUN conda install -c conda-forge git RUN pip install numpy>=2.0.0 RUN pip install scipy>=1.13.0 cython nibabel dipy tqdm +RUN pip install pybind11 -COPY . /opt/GPUStreamlines +COPY . /opt/GPUStreamlines/ # compile RUN cd /opt/GPUStreamlines && mkdir build && cd build \ diff --git a/README.md b/README.md index 37661cc..5cda7f5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # GPUStreamlines ## Installation -When cloning the repo, please use "git clone --recursive" to pull all the requirements. - To install, simply run `pip install .` in the top-level repository directory. ## Running the examples diff --git a/external/pybind11 b/external/pybind11 deleted file mode 160000 index a2e59f0..0000000 --- a/external/pybind11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a2e59f0e7065404b44dfe92a28aca47ba1378dc4 diff --git a/pyproject.toml b/pyproject.toml index f358962..7ad8645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,10 @@ version = "1.0.0" description="GPU-accelerated tractography package" readme = "README.md" requires-python = ">=3.7" +dependencies = [ + "numpy", + "pybind11" +] [tool.scikit-build] cmake.build-type = "Release" From 7e12b7500b459fce82d49fd820621c3e9feab6e0 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 25 Mar 2025 13:57:29 -0700 Subject: [PATCH 3/5] remove gimodules, update cmakelists --- .gitmodules | 3 --- CMakeLists.txt | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 7676f39..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "external/pybind11"] - path = external/pybind11 - url = https://github.com/pybind/pybind11.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 2263bf1..7a6feed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,10 @@ if(OPENMP_FOUND) message(STATUS "OpenMP runtime used: ${OMP_RUNTIME}") endif() +# Find pybind11 +find_package(pybind11 REQUIRED) + # Build library and pybind11 module -add_subdirectory(external/pybind11) add_library(cuslines_kernels) target_sources(cuslines_kernels PRIVATE From fd4666229981ebc2ce6de3ec447605227f95d5f3 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 25 Mar 2025 14:01:37 -0700 Subject: [PATCH 4/5] try this to find pybind11 generally --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a6feed..f27d490 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,10 @@ if(OPENMP_FOUND) endif() # Find pybind11 +execute_process(COMMAND python -c "import pybind11; print(pybind11.get_cmake_dir())" + OUTPUT_VARIABLE pybind11_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) +list(APPEND CMAKE_PREFIX_PATH ${pybind11_DIR}) find_package(pybind11 REQUIRED) # Build library and pybind11 module From fcc9fb96094e417faff34009cacd1e8a3007b9cb Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 25 Mar 2025 14:12:01 -0700 Subject: [PATCH 5/5] put this back --- .github/workflows/dockerbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 576626d..923ea4e 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -5,8 +5,8 @@ on: branches: - 'master' pull_request: - # branches: - # - 'master' + branches: + - 'master' jobs: build: