mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-02 07:34:45 +08:00
* feat(sandbox): default to official Alpine sandbox image default_sandbox_image() now returns docker.io/library/alpine:3.22, a generic version-qualified official image, so a fresh install no longer depends on the community sandbox image catalog. All compute drivers (docker, podman, kubernetes, vm) inherit this fallback. Part of #3116. Signed-off-by: Akram Signed-off-by: Akram <akram.benaissi@gmail.com> * feat(deploy): default deployment configs to the official Alpine sandbox image Update the shared gateway default_image, Helm chart values, the standalone Kubernetes manifest, and the dev gateway task scripts to use docker.io/library/alpine:3.22 instead of the community base image, consistent with default_sandbox_image(). GPU e2e image-build base is left unchanged (CUDA needs a glibc base). Part of #3116. Signed-off-by: Akram Signed-off-by: Akram <akram.benaissi@gmail.com> * feat(driver): default to numeric non-root identity for USER-less images With the default sandbox image now Alpine, images that declare no OCI USER must start instead of being rejected. When the image declares no USER and the policy requests none, the Podman and Docker drivers now supply a numeric non-root identity (DEFAULT_SANDBOX_UID/GID = 1000) instead of rejecting, matching the numeric-identity behavior of the Kubernetes and VM drivers. The supervisor's resolved-identity path runs the sandbox as a synthesized non-root account without the account existing in the image. Images that declare a USER keep the OCI resolution path unchanged. Part of #3116. Signed-off-by: Akram <akram.benaissi@gmail.com> Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(conformance): use Alpine workload image Signed-off-by: Evan Lezar <elezar@nvidia.com> * refactor(policy): drop community image /app path from default policy The restrictive default policy granted read-only access to /app, a directory that only existed in the community base image. A generic Alpine default has no /app, so remove it. Landlock best-effort already ignores absent paths; this just stops advertising a community-specific layout in the default. Part of #3116. Signed-off-by: Akram Signed-off-by: Akram <akram.benaissi@gmail.com> * docs(config): document Alpine default images Signed-off-by: Evan Lezar <elezar@nvidia.com> * fix(podman): report early sandbox termination Signed-off-by: Evan Lezar <elezar@nvidia.com> * fix(podman): initialize rootless workspace ownership Signed-off-by: Evan Lezar <elezar@nvidia.com> * fix(sandbox): qualify NVIDIA Ubuntu default Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(podman): initialize rootful default workspace Signed-off-by: Drew Newberry <anewberry@nvidia.com> * feat(sftp): add native sandbox adapter Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(sftp): gate runtime helper support to Linux Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(sftp): support standard OpenSSH file operations Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(sftp): harden rename and special file handling Signed-off-by: Drew Newberry <anewberry@nvidia.com> * refactor(runtime): remove community image dependencies Signed-off-by: Drew Newberry <anewberry@nvidia.com> * test(e2e): build provider readiness tool fixture Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(e2e): use a dedicated Noble fixture for Docker tests Signed-off-by: Evan Lezar <elezar@nvidia.com> --------- Signed-off-by: Akram Signed-off-by: Akram <akram.benaissi@gmail.com> Signed-off-by: Evan Lezar <elezar@nvidia.com> Signed-off-by: Drew Newberry <anewberry@nvidia.com> Co-authored-by: Evan Lezar <elezar@nvidia.com> Co-authored-by: Drew Newberry <anewberry@nvidia.com>
104 lines
3.8 KiB
Docker
104 lines
3.8 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Gator sandbox image.
|
|
#
|
|
# This installs the core system and developer
|
|
# tooling, but keeps the initial agent surface focused on Codex + GitHub tooling
|
|
# for the gator-gate workflow.
|
|
|
|
FROM nvcr.io/nvidia/base/ubuntu:noble-20251013 AS system
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /sandbox
|
|
|
|
# Core system dependencies required by the gator workload.
|
|
# iproute2: network namespace management (ip netns, veth pairs)
|
|
# iptables: legacy bypass detection (kept for transition)
|
|
# nftables: bypass detection; log + reject rules for direct connection diagnostics
|
|
# dnsutils: dig, nslookup
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
dnsutils \
|
|
iproute2 \
|
|
iptables \
|
|
nftables \
|
|
iputils-ping \
|
|
net-tools \
|
|
netcat-openbsd \
|
|
openssh-sftp-server \
|
|
procps \
|
|
traceroute \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN groupadd -r supervisor && useradd -r -g supervisor -s /usr/sbin/nologin supervisor && \
|
|
groupadd -r sandbox && useradd -r -g sandbox -d /sandbox -s /bin/bash sandbox
|
|
|
|
FROM system AS devtools
|
|
|
|
# Node.js 22 + build toolchain. Keep the default apt installs aligned with the
|
|
# workload, then add the small CLI tools gator commonly needs.
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
|
apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
git \
|
|
jq \
|
|
less \
|
|
nodejs=22.22.1-1nodesource1 \
|
|
ripgrep \
|
|
vim-tiny \
|
|
nano \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& npm install -g npm@11.11.0
|
|
|
|
# GitHub CLI
|
|
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
|
-o /usr/share/keyrings/githubcli-archive-keyring.gpg && \
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
|
|
> /etc/apt/sources.list.d/github-cli.list && \
|
|
apt-get update && apt-get install -y --no-install-recommends gh && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
ARG CODEX_VERSION=latest
|
|
RUN npm install -g "@openai/codex@${CODEX_VERSION}" && \
|
|
(npm cache clean --force >/dev/null 2>&1 || true) && \
|
|
codex --version
|
|
|
|
# Provider profiles include both /usr/bin and /usr/local/bin variants for common
|
|
# tools. Create the /usr/local/bin aliases in this image so sandbox symlink
|
|
# resolution does not warn about missing alternate paths during policy reloads.
|
|
RUN ln -sf /usr/bin/gh /usr/local/bin/gh && \
|
|
ln -sf /usr/bin/git /usr/local/bin/git && \
|
|
ln -sf /usr/bin/codex /usr/local/bin/codex
|
|
|
|
FROM devtools AS final
|
|
|
|
ENV PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
|
|
|
|
RUN mkdir -p /etc/openshell
|
|
COPY policy.yaml /etc/openshell/policy.yaml
|
|
COPY bin/gh /usr/local/bin/gh-gator
|
|
COPY bin/review-feedback-ledger /usr/local/bin/review-feedback-ledger
|
|
COPY bin/resolve-gator-review-threads /usr/local/bin/resolve-gator-review-threads
|
|
COPY bin/validate-review-findings /usr/local/bin/validate-review-findings
|
|
RUN rm -f /usr/local/bin/gh && \
|
|
cp /usr/local/bin/gh-gator /usr/local/bin/gh && \
|
|
chmod 755 /usr/local/bin/gh /usr/local/bin/review-feedback-ledger \
|
|
/usr/local/bin/resolve-gator-review-threads \
|
|
/usr/local/bin/validate-review-findings
|
|
|
|
RUN printf 'export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"\nexport PS1="\\u@\\h:\\w\\$ "\n' \
|
|
> /sandbox/.bashrc && \
|
|
printf '[ -f ~/.bashrc ] && . ~/.bashrc\n' > /sandbox/.profile && \
|
|
chown -R sandbox:sandbox /sandbox
|
|
|
|
USER sandbox
|
|
|
|
ENTRYPOINT ["/bin/bash"]
|