Skip to content

Commit 86d1ee4

Browse files
committed
Rework the implementation of sandboxes.
Includes allowing each cmsWorker to use up to 1000 isolate boxes, and removing a few insecure or surprising special cases. Also updates the box range to reflect the new default in isolate.
1 parent 520ab66 commit 86d1ee4

13 files changed

Lines changed: 413 additions & 912 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ RUN <<EOF
6363
#!/bin/bash -ex
6464
# Need to set user ID manually: otherwise it'd be 1000 on debian
6565
# and 1001 on ubuntu.
66-
useradd -ms /bin/bash -u 1001 cmsuser
66+
# 1001 is taken by `isolate`.
67+
useradd -ms /bin/bash -u 2000 cmsuser
6768
usermod -aG sudo cmsuser
6869
usermod -aG isolate cmsuser
6970
# Disable sudo password
@@ -79,12 +80,12 @@ COPY --chown=cmsuser:cmsuser install.py constraints.txt /home/cmsuser/src/
7980

8081
WORKDIR /home/cmsuser/src
8182

82-
RUN --mount=type=cache,target=/home/cmsuser/.cache/pip,uid=1001 ./install.py venv
83+
RUN --mount=type=cache,target=/home/cmsuser/.cache/pip,uid=1002 ./install.py venv
8384
ENV PATH="/home/cmsuser/cms/bin:$PATH"
8485

8586
COPY --chown=cmsuser:cmsuser . /home/cmsuser/src
8687

87-
RUN --mount=type=cache,target=/home/cmsuser/.cache/pip,uid=1001 ./install.py cms --devel
88+
RUN --mount=type=cache,target=/home/cmsuser/.cache/pip,uid=1002 ./install.py cms --devel
8889

8990
RUN <<EOF
9091
#!/bin/bash -ex

cms/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ class Config:
184184
services: dict[ServiceCoord, Address] = dataclasses.field(init=False)
185185

186186
def __post_init__(self):
187+
if self.sandbox.sandbox_implementation != "isolate":
188+
logger.warning("The 'sandbox_implementation' configuration option "
189+
"is deprecated and only 'isolate' is supported. "
190+
"Ignoring provided value '%s'.",
191+
self.sandbox.sandbox_implementation)
192+
187193
self.services = {}
188194
for service_name, instances in self.services_.items():
189195
for shard_number, shard in enumerate(instances):

0 commit comments

Comments
 (0)