Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
bee25e9
integrated with new SDK
shuning-auki Mar 13, 2025
1b2a06a
disable cache and add concurrency
shuning-auki Mar 13, 2025
0a05d62
upload to ECR
shuning-auki Mar 13, 2025
aa29ba5
free up space
shuning-auki Mar 14, 2025
5777a02
get larger disk space
shuning-auki Mar 14, 2025
a084d92
no one picks up the job
shuning-auki Mar 14, 2025
5b2708e
no one picks up
shuning-auki Mar 14, 2025
8e9bcea
add heartbeat
shuning-auki Mar 14, 2025
13073f8
fix Dockerfile and terminate the program gracefully
shuning-auki Mar 14, 2025
703bed4
pass in port
shuning-auki Mar 14, 2025
431204d
pull the latest posemesh
shuning-auki Mar 14, 2025
7175244
fix missing dependency
shuning-auki Mar 14, 2025
20e40bf
update tags
shuning-auki Mar 14, 2025
ccb921e
update image
shuning-auki Mar 17, 2025
7f16972
update domain package
shuning-auki Mar 18, 2025
06618c7
fix empty scans parameter
shuning-auki Mar 18, 2025
e2df524
fix rust
shuning-auki Mar 18, 2025
92a0bcf
flush log and print to stdout by default
shuning-auki Mar 19, 2025
9ac1c17
update Dockerfile
shuning-auki Mar 20, 2025
ad56ff6
fix dockerfile
shuning-auki Mar 20, 2025
4114143
fix stuck docker
shuning-auki Mar 20, 2025
de500c2
fix dockerfile
shuning-auki Mar 21, 2025
b6e6636
ha?
shuning-auki Mar 21, 2025
9558bc8
debug save_portal_csv
shuning-auki Mar 21, 2025
6a6262f
failed to save portal csv
shuning-auki Mar 21, 2025
3065675
raise
shuning-auki Mar 21, 2025
97a55eb
add debugger
shuning-auki Mar 21, 2025
0953e81
fix indent
shuning-auki Mar 24, 2025
d652d8f
fix indent
shuning-auki Mar 24, 2025
72f2264
add more debuggers
shuning-auki Mar 24, 2025
32fbf8b
maybe portal_sizes is empty
shuning-auki Mar 24, 2025
4c641b6
add missing portal sizes
shuning-auki Mar 25, 2025
5b661fd
fix Manifest location
shuning-auki Mar 25, 2025
1c9110f
fix paths
shuning-auki Mar 25, 2025
4efd8d9
uncomment local refinement
shuning-auki Mar 25, 2025
c02ab1a
fix import
shuning-auki Mar 25, 2025
ee43975
resolve handshake timeout
shuning-auki Mar 26, 2025
f87de8f
update lock
shuning-auki Mar 26, 2025
2112e07
fix rust
shuning-auki Mar 26, 2025
912195f
use self hosted machine to leverage docker build cache
shuning-auki Mar 26, 2025
6fae60f
remove space saver
shuning-auki Mar 26, 2025
b4ea0c2
update dockerfile
shuning-auki Mar 26, 2025
0633658
call python in unbuffered mode
shuning-auki Mar 26, 2025
262602e
remove platform
shuning-auki Mar 26, 2025
0fe8aaf
even scans parameter is ignored, it is still required
shuning-auki Mar 26, 2025
eef3e86
self hosted runner doesn't work
shuning-auki Mar 27, 2025
f52aac5
free up space
shuning-auki Mar 27, 2025
17bf077
only upload some files
shuning-auki Mar 27, 2025
46d9259
catch error
shuning-auki Mar 27, 2025
821651c
make everything async
shuning-auki Mar 28, 2025
7e89ce9
terminate global
shuning-auki Mar 28, 2025
789b038
remove results after uploading
shuning-auki Mar 28, 2025
7b255b9
fix rust
shuning-auki Mar 28, 2025
7be4df3
upgrade domain
shuning-auki Mar 28, 2025
a0d7065
try self hosted machine
shuning-auki Mar 28, 2025
8e158df
revert to ubuntu latest
shuning-auki Mar 28, 2025
07ec373
use self hosted runner
shuning-auki Mar 28, 2025
bf2d8a9
upgrade domain module so it handles backpressure
shuning-auki Mar 31, 2025
bfa1fcf
disable space freeing up
shuning-auki Mar 31, 2025
8ec355b
update domain module
shuning-auki Apr 1, 2025
b752d0c
extract file name properly
shuning-auki Apr 1, 2025
40872eb
self hosted stops working again
shuning-auki Apr 1, 2025
2de622c
fix file name
shuning-auki Apr 1, 2025
3765cd5
try self hosted linux again
shuning-auki Apr 1, 2025
d2d0431
use github runner
shuning-auki Apr 1, 2025
4606c48
use scans parameter to fix issue with parallel refinements
robinlindh Apr 2, 2025
b316079
catch error to remove task folder
robinlindh Apr 2, 2025
c62037b
no image timestamps in global refinement
robinlindh Apr 2, 2025
2a1cecb
use same dockerfile for dev container
robinlindh Apr 2, 2025
465def8
update domain module
shuning-auki Apr 3, 2025
224ff40
Merge branch 'develop' into feature/sdk-integration
robinlindh Apr 4, 2025
e9c1fd2
use feature/data-node branch
shuning-auki Apr 8, 2025
82e03b6
remove unused imports
shuning-auki Apr 10, 2025
4be8c98
update domain
shuning-auki Apr 16, 2025
c80440e
cancel networking and use auki pc for building
shuning-auki Apr 16, 2025
8085732
fix networking
shuning-auki Apr 17, 2025
64d4a5e
update domain
shuning-auki Apr 24, 2025
12edd2c
update Cargo.lock
shuning-auki Apr 24, 2025
af653df
update domain
shuning-auki Apr 25, 2025
8a9be85
fixes
robinlindh Apr 29, 2025
7da3976
load public key
shuning-auki May 5, 2025
e22d176
upgrade authentication
shuning-auki May 5, 2025
7199c1c
each domain should have its own key
shuning-auki May 8, 2025
0baeb3a
skip local refinement if the scan has already been refined
shuning-auki May 13, 2025
50cdc26
wip
robinlindh May 14, 2025
d26fe0a
download data in chunks and write them to file system as stream
shuning-auki May 29, 2025
e1144e0
upgrade to more memory efficient downloading domain module
shuning-auki Jun 3, 2025
1e155a9
- upgraded to new domain module so it joins a domain cluster
shuning-auki Jun 9, 2025
01d06c6
added suffix to global refined results
shuning-auki Jun 9, 2025
6c5015b
update domain module
shuning-auki Jun 9, 2025
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
5 changes: 0 additions & 5 deletions .devcontainer/build_golang_server.sh

This file was deleted.

4 changes: 4 additions & 0 deletions .devcontainer/build_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cd server && cargo build --release
cp target/release/server ../reconstruction
11 changes: 8 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "Reconstruction Server Devcontainer",
"remoteUser": "reconstruction-server",
"build": {
"dockerfile": "../docker/Dockerfile.dev"
"dockerfile": "../docker/Dockerfile",
"context": "../",
"args": {
"IS_DEVELOPMENT": "true"
}
},
"workspaceFolder": "/app",
"workspaceMount": "source=${localWorkspaceFolder},target=/app,type=bind",
Expand All @@ -11,7 +15,8 @@
"extensions":[
"golang.Go",
"ms-python.python",
"ms-python.debugpy"
"ms-python.debugpy",
"rust-lang.rust-analyzer"
]
}
},
Expand All @@ -32,5 +37,5 @@
// Uncomment if you want display forward
// "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached"
],
"postCreateCommand": "chown -R reconstruction-server:reconstruction-server /app && .devcontainer/build_golang_server.sh"
"postCreateCommand": "sudo .devcontainer/build_server.sh && sudo chown -R reconstruction-server:reconstruction-server /app"
}
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target/
.git/
.gitignore
.env
*.log
.DS_Store
README.md
Dockerfile
.dockerignore
55 changes: 55 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Docker Image

on:
push:
branches:
- feature/sdk-integration

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

jobs:
build:
runs-on: [self-hosted, Linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4

# - name: Free up space
# run: |
# sudo sudo rm -rf /usr/share/dotnet # ~20GB
# sudo rm -rf /opt/ghc # ~4GB
# sudo rm -rf /usr/local/lib/android # ~10GB

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.GLOBAL_COMMON_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.GLOBAL_COMMON_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.GLOBAL_COMMON_AWS_REGION }}

- name: Log in to AWS ECR
id: ecr-login
uses: aws-actions/amazon-ecr-login@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ steps.ecr-login.outputs.registry }}/reconstruction-server
tags: |
type=ref,event=branch
type=sha,prefix=,format=long

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

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ reconstruction
.venv
/venv
/.idea
target
volume
/src/cost_functions.cpython-38-x86_64-linux-gnu.so
/src/ply_export.cpython-38-x86_64-linux-gnu.so
58 changes: 42 additions & 16 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
ARG IS_DEVELOPMENT="false"

##
## Go build for server
## Rust build for server
##
FROM --platform=$BUILDPLATFORM golang:1.21 AS go-build
RUN mkdir -p /app
WORKDIR /app
ADD server /app
ARG TARGETOS
ARG TARGETARCH
ARG VERSION
RUN CGO_ENABLED=0 GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" go build
FROM rust:1.84-slim-bullseye AS rust-build

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

FROM nvidia/cuda:11.0.3-base-ubuntu20.04
WORKDIR /app
RUN mkdir -p /app/server
COPY server /app/server
RUN cd server && cargo build --release

##
## Runtime image
##
FROM nvidia/cuda:11.0.3-base-ubuntu20.04 AS runtime

ARG USERNAME=reconstruction-server
ARG USER_UID=1000
Expand Down Expand Up @@ -159,15 +165,35 @@ RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf && ldconfig

# Run reconstruction server as separate user, not root
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& chown -R $USERNAME:$USERNAME /app

RUN mkdir -p /app/jobs && chown -R reconstruction-server:reconstruction-server /app/jobs
RUN mkdir -p /app/volume && chown -R reconstruction-server:reconstruction-server /app/volume
# Dev container: Copy rust tools so we can compile inside the dev container
FROM runtime AS reconstruction_dev

# Sudo enabled in dev container only
RUN apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

COPY --from=rust-build /usr/local/rustup /usr/local/rustup
COPY --from=rust-build /usr/local/cargo /usr/local/cargo
ENV PATH="/usr/local/cargo/bin:$PATH"
ENV RUSTUP_HOME="/usr/local/rustup"
ENV CARGO_HOME="/usr/local/cargo"

# Standalone image: Use the compiled server binary
FROM runtime AS reconstruction
COPY --from=rust-build /app/server/target/release/server /app/reconstruction
RUN chmod +x /app/server

# Final stage: Select between dev and prod
FROM reconstruction${IS_DEVELOPMENT:+_dev} AS final

WORKDIR /app
USER $USERNAME
ENTRYPOINT ["/app/reconstruction"]

COPY --from=go-build /app/reconstruction ./reconstruction
ENTRYPOINT ["./reconstruction"]

# Overridable using 'docker run ... image_name -api-key <your-api-key>'
# TODO: we probably don't need api key, or make it optional. Just check domain token.
CMD ["-api-key", "kaffekopp123"]
148 changes: 0 additions & 148 deletions docker/Dockerfile.dev

This file was deleted.

25 changes: 3 additions & 22 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path
import argparse

import sys
from local_main import main as local_main
from global_main import main as global_main
from occlusion_box import main as occlusion_box_main
Expand Down Expand Up @@ -116,21 +116,6 @@ def local_and_global_main_wrapper(args, logger):
#occlusion_box_wrapper(ply_output_path, global_out_folder / "occlusion", logger)


def get_available_scans(datasets_path):
"""Get list of available scans in the datasets directory.

Args:
datasets_path: Path to datasets directory

Returns:
List of scan names
"""
return [
scan.name for scan in datasets_path.iterdir()
if scan.is_dir() or scan.suffix == ".zip"
]


def process_refinement(args, logger):
"""Process refinement based on specified mode.

Expand Down Expand Up @@ -182,15 +167,11 @@ def main(args):
level=args.log_level
)

# TODO: ignoring the scans parameter from go for now since it's incorrect (fix after redeploy)
# Get available scans from datasets directory
args.scans = get_available_scans(args.job_root_path / "datasets")

try:
process_refinement(args, logger)
except Exception as e:
handle_refinement_error(e, args, logger)
raise e
raise sys.exit(1)


def parse_args():
Expand All @@ -204,7 +185,7 @@ def parse_args():
help="Set the logging level (default: INFO)"
)

parser.add_argument("--scans", nargs="+", default=[], help="List of scans to process")
parser.add_argument("--scans", nargs="+", help="List of scans to process")
return parser.parse_args()


Expand Down
Loading
Loading