1+ FROM fluxrm/flux-core:noble
2+
3+ LABEL maintainer="Vanessasaurus <@vsoch>"
4+
5+ # Match the default user id for a single system so we aren't root
6+ ARG USERNAME=vscode
7+ ARG USER_UID=1000
8+ ARG USER_GID=1000
9+ ENV USERNAME=${USERNAME}
10+ ENV USER_UID=${USER_UID}
11+ ENV USER_GID=${USER_GID}
12+ USER root
13+
14+ # Install extra buildrequires for flux-sched:
15+ RUN sudo apt-get update && \
16+ sudo apt-get -qq install -y --no-install-recommends \
17+ libboost-graph-dev \
18+ libboost-system-dev \
19+ libboost-filesystem-dev \
20+ libboost-regex-dev \
21+ python3-yaml \
22+ libyaml-cpp-dev \
23+ libedit-dev \
24+ ninja-build \
25+ cmake \
26+ curl
27+
28+ # Assuming installing to /usr/local
29+ ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
30+
31+ # Install Go 19 for TBA bindings (if Go bindings desired)
32+ RUN wget https://go.dev/dl/go1.26.0.linux-amd64.tar.gz && tar -xvf go1.26.0.linux-amd64.tar.gz && \
33+ mv go /usr/local && rm go1.26.0.linux-amd64.tar.gz
34+ ENV PATH=$PATH:/usr/local/go/bin:/home/vscode/go/bin
35+
36+ # extra interactive utilities
37+ RUN sudo apt-get update \
38+ && sudo apt-get -qq install -y --no-install-recommends \
39+ fd-find \
40+ less \
41+ bats \
42+ ripgrep \
43+ libczmq-dev
44+
45+
46+ # --- Rust (for building QRMI) --------------------------------------------
47+ # Installed system-wide so it is available regardless of the active user.
48+ # QRMI pins its toolchain via rust-toolchain.toml (currently 1.91); rustup will
49+ # fetch that automatically during the build below.
50+ ENV RUSTUP_HOME=/usr/local/rustup \
51+ CARGO_HOME=/usr/local/cargo \
52+ PATH=/usr/local/cargo/bin:$PATH
53+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
54+ | sh -s -- -y --no-modify-path --profile minimal --default-toolchain 1.91 \
55+ && chmod -R a+rwX /usr/local/rustup /usr/local/cargo
56+
57+ # --- QRMI native library (the bindings' cgo dependency) ------------------
58+ # Pin QRMI_REF to a tag/commit for reproducibility if you like; defaults to main.
59+ ARG QRMI_REPO=https://github.com/qiskit-community/qrmi
60+ ARG QRMI_REF=main
61+ RUN git clone ${QRMI_REPO} /opt/qrmi \
62+ && cd /opt/qrmi \
63+ && git checkout ${QRMI_REF} \
64+ && cargo build --locked --release \
65+ && install -d /usr/local/include /usr/local/lib \
66+ && install -m 0644 qrmi.h /usr/local/include/qrmi.h \
67+ && install -m 0644 target/release/libqrmi.a /usr/local/lib/libqrmi.a \
68+ && install -m 0755 target/release/libqrmi.so /usr/local/lib/libqrmi.so \
69+ && ldconfig
70+
71+ # Add the group and user that match our ids
72+ RUN groupadd -g ${USER_GID} ${USERNAME} && \
73+ adduser --disabled-password --uid ${USER_UID} --gid ${USER_GID} --gecos "" ${USERNAME} && \
74+ echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
75+
76+ # This branch of flux-sched has the bindings we need!
77+ RUN ln -s /usr/local/go/bin/go /usr/bin/go && \
78+ git clone https://github.com/flux-framework/flux-sched /opt/flux-sched && \
79+ cd /opt/flux-sched && \
80+ export WITH_GO=yes && \
81+ ./configure --prefix=/usr && \
82+ mkdir build && \
83+ cd build && \
84+ cmake ../ && \
85+ cd ../ && \
86+ make && make install
87+
88+ ENV LD_LIBRARY_PATH=/usr/lib:/opt/flux-sched/resource:/opt/flux-sched/resource/reapi/bindings:/opt/flux-sched/resource/libjobspec
89+ USER $USERNAME
0 commit comments