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
12 changes: 6 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV USER_UID=${USER_UID}
ENV USER_GID=${USER_GID}
USER root

# Install extra buildrequires for flux-sched:
# Install extra buildrequires for flux-sched.
RUN sudo apt-get update && \
sudo apt-get -qq install -y --no-install-recommends \
libboost-graph-dev \
Expand Down Expand Up @@ -45,7 +45,7 @@ RUN sudo apt-get update \

# --- Rust (for building QRMI) --------------------------------------------
# Installed system-wide so it is available regardless of the active user.
# QRMI pins its toolchain via rust-toolchain.toml (currently 1.91); rustup will
# QRMI pins its toolchain via rust-toolchain.toml (currently 1.91). Rustup will
# fetch that automatically during the build below.
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
Expand All @@ -55,7 +55,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
&& chmod -R a+rwX /usr/local/rustup /usr/local/cargo

# --- QRMI native library (the bindings' cgo dependency) ------------------
# Pin QRMI_REF to a tag/commit for reproducibility if you like; defaults to main.
# Pin QRMI_REF to a tag/commit for reproducibility if you like. Defaults to main.
ARG QRMI_REPO=https://github.com/qiskit-community/qrmi
ARG QRMI_REF=main
RUN git clone ${QRMI_REPO} /opt/qrmi \
Expand All @@ -76,16 +76,16 @@ RUN groupadd -g ${USER_GID} ${USERNAME} && \
# This branch of flux-sched has the bindings we need!
RUN ln -s /usr/local/go/bin/go /usr/bin/go && \
export FLUX_SCHED_VERSION=0.53.0 && \
git clone -b implement-reapi-cli-update-allocate https://github.com/vsoch/flux-sched /opt/flux-sched && \
git clone -b implement-reapi-cli-update-allocate https://github.com/vsoch/flux-sched /opt/flux-sched && \
# git clone -b https://github.com/flux-framework/flux-sched /opt/flux-sched && \
cd /opt/flux-sched && \
export WITH_GO=yes && \
./configure --prefix=/usr && \
mkdir build && \
cd build && \
cmake ../ && \
cmake ../ && \
cd ../ && \
make && make install

ENV LD_LIBRARY_PATH=/usr/lib:/opt/flux-sched/resource:/opt/flux-sched/resource/reapi/bindings:/opt/flux-sched/resource/libjobspec
USER $USERNAME
USER $USERNAME
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile.old
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ RUN git clone -b lib-updates https://github.com/milroy/flux-sched /opt/flux-sche
./configure --prefix=/usr && \
mkdir build && \
cd build && \
cmake ../ && \
cmake ../ && \
cd ../ && \
make && make install

USER $USERNAME
USER $USERNAME
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
}
},
"postStartCommand": "git config --global --add safe.directory /workspaces/fluence"
}
}
12 changes: 6 additions & 6 deletions .github/workflows/e2e-suite.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Reusable e2e workflow (workflow_call): shared setup (build image, kind, deploy
# fluence base), then run ONE test suite — a directory under test/e2e/. The
# suite's tests are DISCOVERED (every NN-*.sh, run in sorted order); adding a test
# Reusable e2e workflow (workflow_call). Shared setup (build image, kind, deploy
# fluence base), then run ONE test suite, a directory under test/e2e/. The
# suite's tests are DISCOVERED (every NN-*.sh, run in sorted order). Adding a test
# is just dropping a file in the directory, no workflow edit. If the suite needs
# special preparation it provides a setup.sh in its directory, which is run before
# the tests (the gang suite has none; the quantum suite installs the qpu add-on).
# the tests (the gang suite has none. The quantum suite installs the qpu add-on).
name: e2e-suite
on:
workflow_call:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
echo "running $s"
bash "$s"
else
echo "no setup.sh for suite '${{ inputs.suite }}' — skipping"
echo "no setup.sh for suite '${{ inputs.suite }}', skipping"
fi

# Discover and run every NN-*.sh in the suite directory, in sorted order.
Expand All @@ -106,4 +106,4 @@ jobs:
run: |
kubectl get pods -A -o wide
kubectl logs -n kube-system deployment/fluence || true
kubectl logs -n kube-system deployment/fluence-webhook || true
kubectl logs -n kube-system deployment/fluence-webhook || true
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
# Fan out the suites as parallel jobs, each a call into the reusable workflow.
# The shared setup (build, kind, deploy) lives once in e2e-suite.yaml; the
# The shared setup (build, kind, deploy) lives once in e2e-suite.yaml. The
# matrix runs gang and quantum concurrently.
e2e:
strategy:
Expand All @@ -19,4 +19,4 @@ jobs:
suite: [gang, quantum]
uses: ./.github/workflows/e2e-suite.yaml
with:
suite: ${{ matrix.suite }}
suite: ${{ matrix.suite }}
74 changes: 74 additions & 0 deletions .github/workflows/qrmi-workload-build-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: qrmi-workload-build-deploy

# Builds the example QRMI workload image for amd64 and arm64. It is python
# and wheels, so QEMU is fine here.

on:
push:
branches: [main]
tags: ["v*"]
paths:
- "examples/qrmi-workload/**"
- ".github/workflows/qrmi-workload-build-deploy.yaml"
pull_request:
branches: [main]
paths:
- "examples/qrmi-workload/**"
- ".github/workflows/qrmi-workload-build-deploy.yaml"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-qrmi-workload

jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Image metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./examples/qrmi-workload
file: ./examples/qrmi-workload/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=qrmi-workload
cache-to: type=gha,mode=max,scope=qrmi-workload
11 changes: 7 additions & 4 deletions .github/workflows/sidecar-build-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: sidecar-build-deploy

# Builds and tests the single, provider-agnostic Fluence quantum sidecar image.
# The fluence Python package (python/) is baked into the image; the sidecar
# The fluence Python package (python/) is baked into the image. The sidecar
# resolves its vendor provider at runtime, so there is one image, not one per
# vendor. The same image also serves as the init container that stages the
# package into user pods (Model C).
Expand All @@ -28,7 +28,7 @@ env:

jobs:
# Test the fluence package before building the image. These tests need no
# vendor SDK — they cover registration, provider resolution, fail-soft
# vendor SDK, they cover registration, provider resolution, fail-soft
# interceptor behavior, and the staging mechanism end to end.
test:
runs-on: ubuntu-latest
Expand All @@ -47,7 +47,10 @@ jobs:

- name: Run tests
working-directory: python
run: python tests/test_fluence.py
run: |
python tests/test_fluence.py
python tests/test_qrmi.py
python tests/test_hold.py

build-deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,7 +78,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
# One image: ghcr.io/<owner>/fluence-sidecar (matches the SidecarImage
# One image. ghcr.io/<owner>/fluence-sidecar (matches the SidecarImage
# constant the webhook injects).
images: ${{ env.REGISTRY }}/${{ github.repository }}-sidecar
tags: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
test:
runs-on: ubuntu-latest
# fluence-base carries flux-sched 0.52.0 (installed to /usr) + Go, so the
# fluence-base has flux-sched 0.52.0 (installed to /usr) + Go, so the
# cgo matcher (pkg/graph) links and `make test` can build every package.
container:
image: ghcr.io/converged-computing/fluence-base:latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
vendor
bin
__pycache__/
*.pyc
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
exclude: "python/dist|python/fluence_hpc.egg-info"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending

- repo: local
hooks:
- id: black
name: black
language: python
types: [python]
entry: black
args: [--target-version, py311]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY . .
RUN CGO_ENABLED=1 \
CGO_CFLAGS="-I/opt/flux-sched" \
CGO_LDFLAGS="-L/opt/flux-sched/resource -L/opt/flux-sched/resource/libjobspec -L/opt/flux-sched/resource/reapi/bindings -lresource -ljobspec_conv -lreapi_cli -lflux-idset -lstdc++ -lczmq -ljansson -lhwloc -lboost_system -lflux-hostlist -lboost_graph -lyaml-cpp" \
go build -ldflags '-w' -o /bin/fluence ./cmd/fluence
go build -ldflags '-w' -o /bin/fluence ./cmd/fluence
RUN CGO_ENABLED=0 go build -ldflags '-w' -o /bin/fluence-deviceplugin ./cmd/deviceplugin
RUN CGO_ENABLED=0 go build -ldflags '-w' -o /bin/fluence-webhook ./cmd/webhook

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# fluence — Kubernetes scheduler plugin backed by Fluxion (flux-sched), with
# fluence, Kubernetes scheduler plugin backed by Fluxion (flux-sched), with
# optional quantum resources modeled in the resource graph.
#
# The scheduler only schedules. It links flux-sched (the matcher) and does NOT
# depend on QRMI — quantum job submission lives in a separate workload container
# depend on QRMI, quantum job submission lives in a separate workload container
# (github.com/converged-computing/qrmi-sampler), not here.

FLUX_SCHED_ROOT ?= /opt/flux-sched
IMG ?= ghcr.io/converged-computing/fluence:latest
TEST_IMG ?= vanessa/fluence:test

# cgo flags for the scheduler binary: flux-sched only.
# cgo flags for the scheduler binary. flux-sched only.
CGO_CFLAGS = -I$(FLUX_SCHED_ROOT)
CGO_LDFLAGS = -L$(FLUX_SCHED_ROOT)/resource \
-L$(FLUX_SCHED_ROOT)/resource/libjobspec \
Expand Down
Loading
Loading