Skip to content

Commit

Permalink
Adding .devcontainer and deploy files to run from inside the container
Browse files Browse the repository at this point in the history
add
  • Loading branch information
LuisFSegalla committed Sep 5, 2024
1 parent 2948c7d commit 1a6e592
Show file tree
Hide file tree
Showing 18 changed files with 1,068 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/ubuntu
{
"name": "xspress-detector devcontainer",
"build":{
"dockerfile": "../Dockerfile",
"context": "..",
"target": "build"
},
"remoteUser": "${localEnv:VSCODE_REMOTE_USER}",
// Add the IDs of extensions you want installed when the container is created.
"customizations": {
"vscode": {
"extensions": [
"ms-python.vscode-pylance",
"tamasfe.even-better-toml",
"redhat.vscode-yaml",
"ryanluker.vscode-coverage-gutters",
"epicsdeb.vscode-epics",
"charliermarsh.ruff",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-azuretools.vscode-docker"
]
}
},

"features": {
// Some default things like git config
"ghcr.io/devcontainers/features/common-utils:2": {
"upgradePackages": false
}
},

"runArgs": [
"--net=host",
"--security-opt=label=disable"
],
// Mount the parent of the project folder so we can access peer projects
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
"mounts": [
"source=/dev/shm,target=/dev/shm,type=bind"
]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"cmake.generator": "Unix Makefiles",
"cmake.sourceDirectory": "${workspaceFolder}/cpp",
"cmake.buildDirectory": "${workspaceFolder}/vscode_build",
"cmake.installPrefix": "/odin",
"cmake.configureArgs": [
"-DODINDATA_ROOT_DIR=/odin",
"-DLIBXSPRESS_ROOT_DIR=/libxspress/prefix"
],
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"editor.formatOnSave": false,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
},
"editor.defaultFormatter": "ms-python.python",
"editor.rulers": [
88
]
},
"python.linting.flake8Args": [
"--max-line-length=88"
],
"python.formatting.provider": "black",
"isort.args": [
"--profile",
"black"
],
}
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
FROM ghcr.io/odin-detector/odin-data-build:latest AS build

# Install numactl for the MetaWriter process
RUN apt-get update
RUN apt-get install numactl

# Copy xspress-detector source in for build
COPY . /tmp/xspress-detector

# In here you should copy your version of libxspress inside the container
# COPY ./libxspress /libxspress

# C++
WORKDIR /tmp/xspress-detector
RUN mkdir -p build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/odin -DODINDATA_ROOT_DIR=/odin -DLIBXSPRESS_ROOT_DIR=/libxspress ../cpp && \
cmake -DCMAKE_INSTALL_PREFIX=/odin -DODINDATA_ROOT_DIR=/odin ../cpp && \
make -j8 VERBOSE=1 && \
make install

Expand All @@ -20,4 +26,4 @@ FROM ghcr.io/odin-detector/odin-data-runtime:latest
COPY --from=build /odin /odin
# COPY --from=build /libxspress /libxspress
ENV PATH=/odin/bin:/odin/venv/bin:$PATH
WORKDIR /odin
WORKDIR /odin
Loading

0 comments on commit 1a6e592

Please sign in to comment.