diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 474d825..923ea4e 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -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/.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..f27d490 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,14 @@ if(OPENMP_FOUND) message(STATUS "OpenMP runtime used: ${OMP_RUNTIME}") 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 -add_subdirectory(external/pybind11) add_library(cuslines_kernels) target_sources(cuslines_kernels PRIVATE diff --git a/docker/Dockerfile b/Dockerfile similarity index 89% rename from docker/Dockerfile rename to Dockerfile index 4f2fbbb..06e9de9 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -30,11 +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 -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/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/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 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"