-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now adding act runtimes for local CI testing
- Loading branch information
1 parent
a009bce
commit f127d36
Showing
14 changed files
with
156 additions
and
157 deletions.
There are no files selected for viewing
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
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,37 @@ | ||
# Use an official Rust image | ||
FROM rust:1.83-slim | ||
|
||
# Install necessary tools | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
build-essential \ | ||
libssl-dev \ | ||
pkg-config \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the project files into the container | ||
COPY . . | ||
|
||
# Download ONNX Runtime 1.20.0 | ||
RUN wget https://github.com/microsoft/onnxruntime/releases/download/v1.20.0/onnxruntime-linux-x64-1.20.0.tgz \ | ||
&& tar -xvf onnxruntime-linux-x64-1.20.0.tgz \ | ||
&& mv onnxruntime-linux-x64-1.20.0 /onnxruntime | ||
|
||
# # Download ONNX Runtime 1.16.0 | ||
# RUN wget https://github.com/microsoft/onnxruntime/releases/download/v1.16.0/onnxruntime-linux-x64-1.16.0.tgz \ | ||
# && tar -xvf onnxruntime-linux-x64-1.16.0.tgz \ | ||
# && mv onnxruntime-linux-x64-1.16.0 /onnxruntime | ||
|
||
# Set the ONNX Runtime library path | ||
ENV ORT_LIB_LOCATION=/onnxruntime/lib | ||
ENV LD_LIBRARY_PATH=$ORT_LIB_LOCATION:$LD_LIBRARY_PATH | ||
|
||
# Clean and build the Rust project | ||
RUN cargo clean | ||
RUN cargo build --features tensorflow-tests | ||
|
||
# Run the tests | ||
CMD ["cargo", "test", "--features", "tensorflow-tests"] |
Binary file not shown.
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,69 @@ | ||
#!/bin/bash | ||
|
||
# Variables | ||
ONNX_VERSION="1.20.0" | ||
ONNX_DOWNLOAD_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-x64-${ONNX_VERSION}.tgz" | ||
ONNX_RUNTIME_DIR="/home/maxwellflitton/Documents/github/surreal/surrealml/modules/core/target/debug/build/ort-680c63907dcb00d8/out/onnxruntime" | ||
ONNX_TARGET_DIR="${ONNX_RUNTIME_DIR}/onnxruntime-linux-x64-${ONNX_VERSION}" | ||
LD_LIBRARY_PATH_UPDATE="${ONNX_TARGET_DIR}/lib" | ||
|
||
# Step 1: Download and Extract ONNX Runtime | ||
echo "Downloading ONNX Runtime version ${ONNX_VERSION}..." | ||
wget -q --show-progress "${ONNX_DOWNLOAD_URL}" -O "onnxruntime-linux-x64-${ONNX_VERSION}.tgz" | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to download ONNX Runtime. Exiting." | ||
exit 1 | ||
fi | ||
|
||
echo "Extracting ONNX Runtime..." | ||
tar -xvf "onnxruntime-linux-x64-${ONNX_VERSION}.tgz" | ||
|
||
if [ ! -d "onnxruntime-linux-x64-${ONNX_VERSION}" ]; then | ||
echo "Extraction failed. Directory not found. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Step 2: Replace Old ONNX Runtime | ||
echo "Replacing old ONNX Runtime..." | ||
mkdir -p "${ONNX_RUNTIME_DIR}" | ||
mv "onnxruntime-linux-x64-${ONNX_VERSION}" "${ONNX_TARGET_DIR}" | ||
|
||
if [ ! -d "${ONNX_TARGET_DIR}" ]; then | ||
echo "Failed to move ONNX Runtime to target directory. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Step 3: Update LD_LIBRARY_PATH | ||
echo "Updating LD_LIBRARY_PATH..." | ||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH_UPDATE}:$LD_LIBRARY_PATH" | ||
|
||
# Step 4: Verify Library Version | ||
echo "Verifying ONNX Runtime version..." | ||
strings "${LD_LIBRARY_PATH_UPDATE}/libonnxruntime.so" | grep "VERS_${ONNX_VERSION}" > /dev/null | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "ONNX Runtime version ${ONNX_VERSION} not found in library. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Step 5: Install Library Globally (Optional) | ||
echo "Installing ONNX Runtime globally..." | ||
sudo cp "${LD_LIBRARY_PATH_UPDATE}/libonnxruntime.so" /usr/local/lib/ | ||
sudo ldconfig | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to install ONNX Runtime globally. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Step 6: Clean and Rebuild Project | ||
echo "Cleaning and rebuilding project..." | ||
cargo clean | ||
cargo test --features tensorflow-tests | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "ONNX Runtime updated successfully, and tests passed." | ||
else | ||
echo "ONNX Runtime updated, but tests failed. Check the logs for details." | ||
fi |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
onnxruntime==1.17.3 | ||
numpy==1.26.3 | ||
onnxruntime==1.20.0 | ||
numpy==2.2.1 |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# navigate to directory | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
cd ../.. | ||
|
||
|
||
act -W .github/workflows/surrealml_core_onnx_test.yml pull_request |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# navigate to directory | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
cd ../.. | ||
|
||
|
||
act -W .github/workflows/surrealml_core_test.yml pull_request |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# navigate to directory | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
cd ../.. | ||
|
||
|
||
act -W .github/workflows/surrealml_core_tensorflow_test.yml pull_request |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# navigate to directory | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
cd ../.. | ||
|
||
|
||
act -W .github/workflows/surrealml_core_torch_test.yml pull_request |
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