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
8 changes: 8 additions & 0 deletions .github/workflows/build_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ on:
PYTHON_VER:
required: true
type: string
sha:
description: "sha: full git commit SHA to check out"
required: true
type: string

jobs:
build:
Expand All @@ -52,6 +56,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.sha }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
Expand All @@ -62,6 +67,9 @@ jobs:
cp ./LICENSE ./ci/docker/context/LICENSE
cp ./VERSION ./ci/docker/context/VERSION
cp ./thirdparty/THIRD_PARTY_LICENSES ./ci/docker/context/THIRD_PARTY_LICENSES
- name: Copy Commit SHA
run: |
git rev-parse HEAD > ./ci/docker/context/COMMIT_SHA
- name: Login to NGC
uses: docker/login-action@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_test_publish_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
with:
fetch-depth: 0 # unshallow fetch for setuptools-scm
persist-credentials: false
ref: ${{ inputs.sha }}
Comment thread
rgsl888prabhu marked this conversation as resolved.

- name: Compute matrix
id: compute-matrix
Expand Down Expand Up @@ -128,6 +129,7 @@ jobs:
IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }}
LINUX_VER: ${{ matrix.linux_ver }}
PYTHON_VER: ${{ matrix.python_ver }}
sha: ${{ inputs.sha }}

build-cuopt-multiarch-manifest:
name: Build cuopt multiarch manifest
Expand All @@ -141,6 +143,7 @@ jobs:
- name: Checkout code repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}
fetch-depth: 0
- name: Login to DockerHub
uses: docker/login-action@v3
Expand Down Expand Up @@ -183,3 +186,4 @@ jobs:
CUDA_VER: ${{ matrix.CUDA_VER }}
PYTHON_VER: ${{ matrix.PYTHON_VER }}
IMAGE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.IMAGE_TAG_PREFIX }}
sha: ${{ inputs.sha }}
6 changes: 5 additions & 1 deletion .github/workflows/test_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ on:
IMAGE_TAG_PREFIX:
required: true
type: string

sha:
description: "sha: full git commit SHA to check out"
required: true
type: string

jobs:

Expand Down Expand Up @@ -56,6 +59,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.sha }}
- name: Test cuopt
run: |
bash ./ci/docker/test_image.sh
2 changes: 1 addition & 1 deletion ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ RUN mkdir -p /opt/cuopt && \
WORKDIR /opt/cuopt

# Copy all static files in a single layer
COPY ./LICENSE ./VERSION ./THIRD_PARTY_LICENSES /opt/cuopt/
COPY ./LICENSE ./VERSION ./THIRD_PARTY_LICENSES ./COMMIT_SHA /opt/cuopt/

# Copy CUDA libraries from the cuda-libs stage
COPY --from=cuda-libs /usr/local/cuda/lib64/libnvrtc* /usr/local/cuda/lib64/
Expand Down
4 changes: 1 addition & 3 deletions python/cuopt_server/cuopt_server/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import json
import os

from cuopt_server.utils.job_queue import SolverLPJob, lp_datamodel_compat
from cuopt_server.utils.job_queue import SolverLPJob
from cuopt_server.utils.linear_programming.data_definition import LPData
from cuopt_server.utils.linear_programming.solver import (
create_data_model as lp_create_data_model,
Expand Down Expand Up @@ -73,14 +73,12 @@ def build_lp_datamodel_from_json(data):
"""

if isinstance(data, dict):
lp_datamodel_compat(data)
data = LPData.parse_obj(data)
elif os.path.isfile(data):
with open(data, "r") as f:
data = json.loads(f.read())
# Remove this once we support variable names
data.pop("variable_names")
lp_datamodel_compat(data)
data = LPData.parse_obj(data)
else:
raise ValueError(
Expand Down