Skip to content
Open
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
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "ODM",
"build": {
"context": "..",
"dockerfile": "../Dockerfile",
"target": "dev"
},
"features": {
// https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh
// Add `odm` user for consistency with the GPU image
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "odm",
"upgradePackages": "true"
}
},
"remoteUser": "odm",
// Use the `code` directory for compatibility with direct Docker workflows
"workspaceMount": "source=${localWorkspaceFolder},target=/code,type=bind",
"workspaceFolder": "/code",
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/home/odm,type=bind,consistency=cached"
]
}
28 changes: 28 additions & 0 deletions .devcontainer/gpu/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "ODM GPU",
"build": {
"context": "../..",
"dockerfile": "../../gpu.Dockerfile",
"target": "dev"
},
"features": {
// https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh
// Add `odm` user for consistency with the CPU image
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "odm",
"upgradePackages": "true"
}
},
"remoteUser": "odm",
// Use the `code` directory for compatibility with direct Docker workflows
"workspaceMount": "source=${localWorkspaceFolder},target=/code,type=bind",
"workspaceFolder": "/code",
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/home/odm,type=bind,consistency=cached"
],
"hostRequirements": {
"gpu": "true"
}
}
47 changes: 24 additions & 23 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
Dockerfile
SuperBuild/build
SuperBuild/download
SuperBuild/install
SuperBuild/src
build
opensfm
odm_orthophoto
odm_texturing
odm_meshing
odm_georeferencing
images_resize
.git

/contrib
/docs
/hooks
/img
/license
settings.yml
code_of_conduct.md
configure_18_04.sh
index.html
Dockerfile
SuperBuild/build
SuperBuild/download
SuperBuild/install
SuperBuild/src
build
opensfm
odm_orthophoto
odm_texturing
odm_meshing
odm_georeferencing
images_resize
.git
venv

/contrib
/docs
/hooks
/img
/license
settings.yml
code_of_conduct.md
configure_18_04.sh
index.html
4 changes: 3 additions & 1 deletion .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
file: ./portable.Dockerfile
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
build-args: |
PORTABLE=YES
tags: |
${{ steps.docker_meta.outputs.tags }}
opendronemap/odm:latest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-build-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
- name: Build
uses: docker/build-push-action@v2
with:
file: ./portable.Dockerfile
file: ./Dockerfile
platforms: linux/amd64
push: false

build-args: |
PORTABLE=YES

# snapcraft:
# runs-on: ubuntu-latest
# strategy:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ include/
lib/
logs/
share/


src/

!modules/*
Expand Down
44 changes: 25 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
FROM ubuntu:24.04 AS builder
FROM ubuntu:24.04 AS dev

# Env variables
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \
LD_LIBRARY_PATH="/code/SuperBuild/install/lib"
RUN if id "ubuntu" &>/dev/null; then \
echo "Deleting user 'ubuntu'" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user"; \
else \
echo "User 'ubuntu' does not exist"; \
fi

RUN apt-get update -y && apt-get install -y \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Prepare directories
WORKDIR /code

######## Builder ########
FROM dev AS builder

ARG PORTABLE=NO

# Copy everything
COPY . ./

# Run the build
RUN bash configure.sh install
RUN PORTABLE_INSTALL=${PORTABLE} bash configure.sh install

# Run the tests
ENV PATH="/code/venv/bin:$PATH"
RUN bash test.sh

# Clean Superbuild
RUN bash configure.sh clean

### END Builder
######## Runtime ########
FROM ubuntu:24.04 AS runtime

### Use a second image for the final asset to reduce the number and
# size of the layers.
FROM ubuntu:24.04
ARG HARDWARE

# Env variables
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \
PYTHONPATH="/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \
LD_LIBRARY_PATH="/code/SuperBuild/install/lib" \
PDAL_DRIVER_PATH="/code/SuperBuild/install/bin"

Expand All @@ -44,10 +50,10 @@ ENV PATH="/code/venv/bin:$PATH"
# the -dev packages to save space!
# Also run a smoke test on ODM and OpenSfM
RUN bash configure.sh installruntimedepsonly \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& bash run.sh --help \
&& bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'"
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& bash run.sh --help \
&& bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'"

# Entry point
ENTRYPOINT ["python3", "/code/run.py"]
Loading
Loading