Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 47 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Linux

on:
workflow_dispatch:

jobs:
compose-job:
runs-on: ubuntu-24.04

steps:
- name: 🛸 Checkout code
uses: actions/checkout@v4

- name: 🚀 Set up Docker Buildx (optional, but helpful)
uses: docker/setup-buildx-action@v3

- name: 🐳 Set up Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

- name: 🔥 Build & start containers
run: docker-compose up --build -d

- name: 📥 Copy wheels to host
run: |
docker cp octdata4python:/home/appuser/oct/octdata4python/wheelhouse .

- name: 🧹 Tear down containers
run: docker-compose down

- name: Fetch latest commit hash
id: get_commit_hash
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
wheelhouse/octdata4python-0.1.0-cp310-cp310-manylinux_2_39_x86_64.whl
wheelhouse/octdata4python-0.1.0-cp311-cp311-manylinux_2_39_x86_64.whl
wheelhouse/octdata4python-0.1.0-cp312-cp312-manylinux_2_39_x86_64.whl
body: Release created automatically from workflow.
draft: true
tag_name: ${{ steps.get_commit_hash.outputs.hash }}
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ubuntu:24.04@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233

# Install required dependencies
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
git \
build-essential cmake \
# liboctdata needs boost
libboost-iostreams-dev libboost-locale-dev libboost-log-dev libboost-numpy-dev libboost-program-options-dev libboost-python-dev libboost-serialization-dev \
# opencv is a core lib for libe2e/liboctdata
libopencv-dev libopenjp2-7-dev \
# liboctdata dicom support
libdcmtk-dev \
# for auditwheels
patchelf \
libnsl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN groupadd -r appuser && useradd -r -g appuser appuser

# Set the working directory
WORKDIR /home/appuser
RUN mkdir -p /home/appuser/oct

WORKDIR /home/appuser/oct

RUN git clone https://github.com/kaygdev/oct_cpp_framework.git
RUN git clone https://github.com/fzhem/LibE2E.git
RUN git clone https://github.com/fzhem/LibOctData.git
RUN git clone https://github.com/fzhem/octdata4python.git

RUN echo "🛠 Building oct_cpp_framework..."
RUN mkdir /home/appuser/oct/oct_cpp_framework/build
WORKDIR /home/appuser/oct/oct_cpp_framework/build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
RUN make -j$(nproc)

RUN echo "🛠 Building LibE2E..."
RUN mkdir /home/appuser/oct/LibE2E/build
WORKDIR /home/appuser/oct/LibE2E/build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
RUN make -j$(nproc)

RUN echo "🛠 Building LibOctData..."
RUN mkdir /home/appuser/oct/LibOctData/build
WORKDIR /home/appuser/oct/LibOctData/build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_SUPPORT_DICOM=ON ..
RUN make -j$(nproc)
RUN make install

RUN echo "🛠 Building octdata4python..."
WORKDIR /home/appuser/oct/octdata4python
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN for PYVER in 3.10 3.11 3.12; do \
uv sync --python=$PYVER && \
.venv/bin/python3 -m build --installer=uv && \
CLEANVER=$(echo $PYVER | tr -d '.') && \
.venv/bin/python3 -m auditwheel repair dist/octdata4python-*-cp${CLEANVER}*.whl --plat manylinux_2_39_x86_64; \
done
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
octdata4python:
build:
context: .
dockerfile: Dockerfile
container_name: octdata4python
command: >
sh -c "tail -f /dev/null"