-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update vscode CMake config to install into /odin Add publish of build container. This is used as a base for detector developer containers on where they have the full dev environment but also have odin-data installed in /odin to build against. Add python3.11 install Add hdf5filters install for compression libs
- Loading branch information
Showing
8 changed files
with
134 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode-remote.remote-containers", | ||
"twxs.cmake", | ||
"ms-vscode.cpptools", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
] | ||
} | ||
} |
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,20 +1,18 @@ | ||
{ | ||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", | ||
"cmake.generator": "Unix Makefiles", | ||
"cmake.sourceDirectory": "${workspaceFolder}/cpp", | ||
"cmake.buildDirectory": "${workspaceFolder}/vscode_build", | ||
"cmake.installPrefix": "${workspaceFolder}/vscode_prefix", | ||
"cmake.configureArgs": [ | ||
// all dependencies from system inside the container | ||
], | ||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", | ||
"editor.formatOnSave": true, | ||
"cmake.installPrefix": "/odin", | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit" | ||
}, | ||
"files.insertFinalNewline": true, | ||
"[python]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit" | ||
}, | ||
"editor.defaultFormatter": "ms-python.python", | ||
"editor.rulers": [ | ||
88 | ||
] | ||
} | ||
} | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true, | ||
"editor.rulers": [88] | ||
}, | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
} |
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,25 +1,25 @@ | ||
# shared setup stage ########################################################### | ||
# Shared setup stage ########################################################### | ||
FROM ubuntu:24.04 AS common | ||
|
||
ENV PATH=/odin/bin:/venv/bin:$PATH | ||
|
||
# get fundamental packages | ||
# Get fundamental packages | ||
RUN apt-get update -y && \ | ||
apt-get install --no-install-recommends -y curl \ | ||
tar ca-certificates software-properties-common && \ | ||
apt-get -y clean all | ||
# get zellij | ||
|
||
# Get zellij | ||
RUN curl -L https://github.com/zellij-org/zellij/releases/download/v0.40.1/zellij-x86_64-unknown-linux-musl.tar.gz -o zellij.tar.gz && \ | ||
tar -xvf zellij.tar.gz -C /usr/bin && \ | ||
rm zellij.tar.gz | ||
# setup zellij | ||
RUN mkdir -p ~/.config/zellij && \ | ||
zellij setup --dump-config > ~/.config/zellij/config.kdl | ||
|
||
# developer stage for devcontainer ############################################# | ||
# Developer stage for devcontainer ############################################# | ||
FROM common AS developer | ||
|
||
# system depenedencies | ||
# System dependencies | ||
RUN add-apt-repository -y ppa:deadsnakes/ppa && \ | ||
apt-get update -y && apt-get install -y --no-install-recommends \ | ||
# General build | ||
|
@@ -31,40 +31,51 @@ RUN add-apt-repository -y ppa:deadsnakes/ppa && \ | |
# tidy up | ||
apt-get -y clean all | ||
|
||
# python dependencies | ||
# Python dependencies | ||
RUN python3.11 -m ensurepip && \ | ||
python3.11 -m venv /venv && \ | ||
python -m pip install --upgrade pip && \ | ||
python -m pip install git+https://github.com/odin-detector/[email protected] | ||
python -m pip install git+https://github.com/odin-detector/odin-control | ||
|
||
# Install hdf5filters from source | ||
RUN git clone https://github.com/DiamondLightSource/hdf5filters.git && cd hdf5filters && \ | ||
mkdir -p cmake-build && cd cmake-build && \ | ||
cmake -DCMAKE_INSTALL_PREFIX=/odin -DCMAKE_BUILD_TYPE=Release -DUSE_AVX2=ON .. && \ | ||
make install && \ | ||
rm -rf hdf5filters | ||
|
||
# build stage - throwaway stage for runtime assets ############################# | ||
# Build stage - throwaway stage for runtime assets ############################# | ||
FROM developer AS build | ||
|
||
# fetch the source | ||
WORKDIR /tmp/odin-data | ||
# Copy in project | ||
WORKDIR /odin/odin-data | ||
COPY . . | ||
|
||
# C++ | ||
RUN mkdir /odin && \ | ||
mkdir -p build && cd build && \ | ||
RUN mkdir -p build && cd build && \ | ||
cmake -DCMAKE_INSTALL_PREFIX=/odin ../cpp && \ | ||
make -j8 VERBOSE=1 && \ | ||
make install | ||
|
||
# Python | ||
RUN python -m pip install /tmp/odin-data/python[meta_writer] | ||
RUN python -m pip install /odin/odin-data/python[meta_writer] | ||
|
||
# Runtime stage ################################################################ | ||
FROM common as runtime | ||
FROM common AS runtime | ||
|
||
# runtime system dependencies | ||
RUN apt-get update -y && apt-get install -y --no-install-recommends \ | ||
# odin-data C++ dependencies | ||
libblosc-dev libboost-all-dev libhdf5-dev liblog4cxx-dev libpcap-dev libczmq-dev && \ | ||
# tidy up | ||
# Runtime system dependencies | ||
RUN add-apt-repository -y ppa:deadsnakes/ppa && \ | ||
apt-get update -y && apt-get install -y --no-install-recommends \ | ||
# C++ dependencies | ||
libblosc-dev libboost-all-dev libhdf5-dev liblog4cxx-dev libpcap-dev libczmq-dev \ | ||
# Python dependencies | ||
python3.11 && \ | ||
# Tidy up | ||
apt-get -y clean all | ||
|
||
COPY --from=build /odin /odin | ||
COPY --from=build /venv /venv | ||
|
||
RUN rm -rf /odin/odin-data /odin/odin-control | ||
|
||
WORKDIR /odin |
Oops, something went wrong.