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
85 changes: 82 additions & 3 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,50 @@ jobs:
mkdir -p openviking/bin
cp target/${{ matrix.arch == 'aarch64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu' }}/release/ov openviking/bin/
chmod +x openviking/bin/ov

- name: Build ragfs-python and extract into openviking/lib/ (Linux)
shell: bash
run: |
uv pip install maturin
TMPDIR=$(mktemp -d)
cd crates/ragfs-python
maturin build --release \
--target ${{ matrix.arch == 'aarch64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu' }} \
--out "$TMPDIR"
cd ../..
mkdir -p openviking/lib
python3 -c "
import zipfile, glob, os, sys
whls = glob.glob(os.path.join('$TMPDIR', 'ragfs_python-*.whl'))
assert whls, 'maturin produced no wheel'
with zipfile.ZipFile(whls[0]) as zf:
for name in zf.namelist():
bn = os.path.basename(name)
if bn.startswith('ragfs_python') and (bn.endswith('.so') or bn.endswith('.pyd')):
dst = os.path.join('openviking', 'lib', bn)
with zf.open(name) as src, open(dst, 'wb') as f:
f.write(src.read())
os.chmod(dst, 0o755)
print(f'Extracted {bn} -> {dst}')
sys.exit(0)
print('ERROR: No ragfs_python .so/.pyd found in wheel')
sys.exit(1)
"
rm -rf "$TMPDIR"
echo "Contents of openviking/lib/:"
ls -la openviking/lib/
- name: Clean workspace (force ignore dirty)
shell: bash
run: |
# Back up pre-built artifacts before cleaning
cp -a openviking/bin /tmp/_ov_bin || true
cp -a openviking/lib /tmp/_ov_lib || true
git reset --hard HEAD
git clean -fd
rm -rf openviking/_version.py openviking.egg-info
# Restore pre-built artifacts
cp -a /tmp/_ov_bin openviking/bin || true
cp -a /tmp/_ov_lib openviking/lib || true
# Ignore uv.lock changes to avoid dirty state in setuptools_scm
git update-index --assume-unchanged uv.lock || true

Expand All @@ -257,6 +295,8 @@ jobs:
git status --ignored
echo "=== Check openviking/_version.py ==="
if [ -f openviking/_version.py ]; then cat openviking/_version.py; else echo "Not found"; fi
echo "=== Verify pre-built artifacts survived clean ==="
ls -la openviking/bin/ openviking/lib/ || true

- name: Build package (Wheel Only)
run: uv build --wheel
Expand All @@ -276,11 +316,8 @@ jobs:
- name: Repair wheels (Linux)
run: |
uv pip install auditwheel
# Repair wheels and output to a temporary directory
uv run auditwheel repair dist/*.whl -w dist_fixed
# Remove original non-compliant wheels
rm dist/*.whl
# Move repaired wheels back to dist
mv dist_fixed/*.whl dist/
rmdir dist_fixed

Expand Down Expand Up @@ -405,12 +442,52 @@ jobs:
cp target/release/ov openviking/bin/
chmod +x openviking/bin/ov
fi

- name: Build ragfs-python and extract into openviking/lib/ (macOS/Windows)
shell: bash
run: |
uv pip install maturin
TMPDIR=$(mktemp -d)
cd crates/ragfs-python
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
maturin build --release --target x86_64-pc-windows-msvc --out "$TMPDIR"
else
maturin build --release --out "$TMPDIR"
fi
cd ../..
mkdir -p openviking/lib
python3 -c "
import zipfile, glob, os, sys
whls = glob.glob(os.path.join('$TMPDIR', 'ragfs_python-*.whl'))
assert whls, 'maturin produced no wheel'
with zipfile.ZipFile(whls[0]) as zf:
for name in zf.namelist():
bn = os.path.basename(name)
if bn.startswith('ragfs_python') and (bn.endswith('.so') or bn.endswith('.pyd')):
dst = os.path.join('openviking', 'lib', bn)
with zf.open(name) as src, open(dst, 'wb') as f:
f.write(src.read())
os.chmod(dst, 0o755)
print(f'Extracted {bn} -> {dst}')
sys.exit(0)
print('ERROR: No ragfs_python .so/.pyd found in wheel')
sys.exit(1)
"
rm -rf "$TMPDIR"
echo "Contents of openviking/lib/:"
ls -la openviking/lib/
- name: Clean workspace (force ignore dirty)
shell: bash
run: |
# Back up pre-built artifacts before cleaning
cp -a openviking/bin /tmp/_ov_bin || true
cp -a openviking/lib /tmp/_ov_lib || true
git reset --hard HEAD
git clean -fd
rm -rf openviking/_version.py openviking.egg-info
# Restore pre-built artifacts
cp -a /tmp/_ov_bin openviking/bin || true
cp -a /tmp/_ov_lib openviking/lib || true
# Ignore uv.lock changes to avoid dirty state in setuptools_scm
git update-index --assume-unchanged uv.lock || true

Expand All @@ -425,6 +502,8 @@ jobs:
git status --ignored
echo "=== Check openviking/_version.py ==="
if [ -f openviking/_version.py ]; then cat openviking/_version.py; else echo "Not found"; fi
echo "=== Verify pre-built artifacts survived clean ==="
ls -la openviking/bin/ openviking/lib/ || true

- name: Build package (Wheel Only)
run: uv build --wheel
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/api_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,13 @@ jobs:

- name: Cache Go modules
uses: actions/cache@v5
continue-on-error: true
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('third_party/agfs/**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Cache C++ extensions
uses: actions/cache@v5
with:
path: openviking/pyagfs
key: ${{ runner.os }}-cpp-${{ hashFiles('**/CMakeLists.txt', '**/*.cpp', '**/*.h') }}
restore-keys: |
${{ runner.os }}-cpp-

- name: Cache Python dependencies (Unix)
if: runner.os != 'Windows'
uses: actions/cache@v5
Expand All @@ -94,7 +87,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.22'
go-version: '1.25.1'

- name: Install system dependencies (Ubuntu)
if: runner.os == 'Linux'
Expand Down
Loading
Loading