Skip to content
Merged
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
45 changes: 20 additions & 25 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
# DevContainer image
FROM ubuntu:24.04
FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu24.04

RUN \
# install docker
apt-get update && \
apt-get install ca-certificates curl -y && \
apt-get install ca-certificates curl gnupg lsb-release -y && \
mkdir -m 0755 -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
chmod a+r /etc/apt/keyrings/docker.asc && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y && \
usermod -aG docker ubuntu && \
apt-get clean
usermod -aG docker root

RUN apt-get install software-properties-common -y && \
apt-add-repository ppa:git-core/ppa && \
apt-get install git -y

RUN \
# dev setup
apt update && \
apt-get install sudo jq bash-completion graphviz rsync software-properties-common gcc -y && \
add-apt-repository ppa:git-core/ppa && \
apt update && \
apt-get install git -y && \
usermod -aG sudo ubuntu && \
apt-get install build-essential sudo jq bash-completion graphviz rsync software-properties-common -y && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
echo '. /etc/bash_completion' >> /home/ubuntu/.bashrc && \
echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/ubuntu/.bashrc && \
chown ubuntu:nogroup /home/ubuntu/.bashrc && \
echo '. /etc/bash_completion' >> /root/.bashrc && \
echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /root/.bashrc && \
apt-get clean

USER ubuntu
ENV CARGO_HOME=/home/ubuntu/.cargo \
PATH=/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:$PATH
RUN \
# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.87.0 -y && \
ENV PATH="/root/.cargo/bin:${PATH}"
RUN apt-get update && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && \
# rust auto formatting
rustup component add rustfmt && \
# rust style linter
Expand All @@ -45,7 +37,10 @@ RUN \
# rust crate structure diagram
cargo install cargo-modules && \
# expand rust macros (useful in debugging)
cargo install cargo-expand
cargo install cargo-expand && \
apt-get clean

ENV PATH=${PATH}:/root/.local/bin
RUN \
# install python manager
curl -LsSf https://astral.sh/uv/install.sh | sh && \
Expand All @@ -55,5 +50,5 @@ RUN \
# useful in examples
uv pip install ipykernel eclipse-zenoh -p ~/.local/share/base && \
echo '. ~/.local/share/base/bin/activate' >> ~/.bashrc
ENV VIRTUAL_ENV=/home/ubuntu/.local/share/base
ENV VIRTUAL_ENV=/root/.local/share/base
CMD ["bash", "-c", "sudo rm /var/run/docker.pid; sudo dockerd"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Development",
"dockerComposeFile": "docker-compose.yaml",
"name": "Development-CPU-ONLY",
"dockerComposeFile": "./docker-compose.yaml",
"service": "ide",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"initializeCommand": ".devcontainer/make_env_file.py ${localWorkspaceFolder}",
"initializeCommand": ".devcontainer/make_env_file.py ${localWorkspaceFolder} ./cpu/",
"postStartCommand": "mkdir -p tests/.tmp && docker system prune -fa && docker volume prune -f",
"hostRequirements": {
"cpus": 2,
Expand All @@ -26,5 +26,8 @@
"ms-python.black-formatter" // Python code formatter
]
}
},
"features": {
"ghcr.io/meaningful-ooo/devcontainer-features/fish:2": {} // Fish shell
}
}
15 changes: 15 additions & 0 deletions .devcontainer/cpu/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
ide:
build:
context: ..
dockerfile: ./Dockerfile
privileged: true # Docker-in-Docker needs this
cgroup: host # Allow setting resource constraints (e.g. memory, cpu) for containers
environment:
- RUST_BACKTRACE=1 # Display error trace on errors/panics
volumes:
- ${LOCAL_WORKSPACE_PATH}:${ENV_WORKSPACE_PATH} # source
- docker_data:/var/lib/docker # Docker image cache
- ${LOCAL_GIT_PATH}:${ENV_GIT_PATH} # Base Git worktree history
volumes:
docker_data:
15 changes: 0 additions & 15 deletions .devcontainer/docker-compose.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions .devcontainer/gpu/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/gpu/devcontainer.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually why do we need GPU-enabled container for development for Orcapod? Do we have something we specifically test GPU features?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, but soon. I could also add the GPU feature and a the test for it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't currently need GPU-based containers, I'd be in favor of removing it? How did you plan on using the GPU image?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway I'll go ahead and merge but we will follow up in a separate issue to discuss and simplify the devcontainer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to add a test to check if the Pod requires a gpu that it launches with one. The issue I ran into is that github action doesn't have GPU's by default so those GPU tests would fail. Since a lot of people will use this for machine learning, testing if orca pod handle GPU Pods correctly is needed.

@Synicix Synicix Oct 25, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.github.com/en/actions/concepts/runners/larger-runners

I did find this a while ago but I am not sure if it would cost us more to get access to a GPU Github Action Runner.

The other option is to write a test as a switching code, where it will just return success if there is no GPU, and if there is a GPU available, then actually test it.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dockerComposeFile": "./docker-compose.yaml",
"service": "ide",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"initializeCommand": ".devcontainer/gpu/make_env_file.py ${localWorkspaceFolder}",
"initializeCommand": ".devcontainer/make_env_file.py ${localWorkspaceFolder} ./gpu/",
"postStartCommand": "mkdir -p tests/.tmp && docker system prune -fa && docker volume prune -f",
"hostRequirements": {
"cpus": 2,
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/gpu/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ services:
ide:
build:
context: ..
dockerfile: ./gpu/Dockerfile
privileged: true # Docker-in-Docker needs this
cgroup: host # Allow setting resource constraints (e.g. memory, cpu) for containers
dockerfile: ./Dockerfile
privileged: true # Docker-in-Docker needs this
cgroup: host # Allow setting resource constraints (e.g. memory, cpu) for containers
environment:
- RUST_BACKTRACE=1 # Display error trace on errors/panics
- RUST_BACKTRACE=1 # Display error trace on errors/panics
volumes:
- ${LOCAL_WORKSPACE_PATH}:${ENV_WORKSPACE_PATH} # source
- docker_data:/var/lib/docker # Docker image cache
- ${LOCAL_GIT_PATH}:${ENV_GIT_PATH} # Base Git worktree history
- ${LOCAL_WORKSPACE_PATH}:${ENV_WORKSPACE_PATH} # source
- docker_data:/var/lib/docker # Docker image cache
- ${LOCAL_GIT_PATH}:${ENV_GIT_PATH} # Base Git worktree history
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
capabilities: [ gpu ]
volumes:
docker_data:
45 changes: 0 additions & 45 deletions .devcontainer/gpu/make_env_file.py

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/make_env_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ def make_config(local_workspace_path: Path):
if __name__ == "__main__":
local_workspace_path = Path(sys.argv[1])

with open(Path(__file__).absolute().parent / ".env", "w") as f:
with open(Path(__file__).absolute().parent / f"{sys.argv[2]}.env", "w") as f:
f.write(make_config(local_workspace_path))