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
25 changes: 25 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Setup

Prerequisites:
- Bazel (Instructions for installing here: https://bazel.build/install)

## Integration Tests

Prerequisites:
- Docker
- Instructions for installing here: https://docs.docker.com/engine/install/
- Note. Running Docker in rootless mode is not yet officially supported but may work. See https://docs.docker.com/engine/security/rootless/ for more information.

## Workarounds

### Linux-Sandbox Ubuntu24.04 Workaround

Ubuntu 24.04 introduced the security framework apparmor. The standard configuration of apparmor which also includes unprivileged user namespaces interferes with the bazel sandboxing mechanism and inhibits the linux-sandbox. This affects all bazel tests and potentially any bazel runnables.

To work around this issue, you can run the following bash script:

```bash
bash actions/unblock_user_namespace_for_linux_sandbox/action_callable.sh
```

Note. This must be rerun whenever the bazel version is updated.
16 changes: 1 addition & 15 deletions actions/unblock_user_namespace_for_linux_sandbox/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,5 @@ runs:
steps:
- name: Allow linux-sandbox to create user namespace
run: |
INSTALL_BASE=$(bazel info install_base)
sudo bash -c "cat >>/etc/apparmor.d/score-linux-sandbox" <<-EOF
abi <abi/4.0>,
include <tunables/global>
profile linux-sandbox ${INSTALL_BASE}/linux-sandbox flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/score-linux-sandbox>
}
EOF
less /etc/apparmor.d/score-linux-sandbox
sudo apparmor_parser -r /etc/apparmor.d/score-linux-sandbox
${INSTALL_BASE}/linux-sandbox "/bin/true"
bash actions/unblock_user_namespace_for_linux_sandbox/action_callable.sh
shell: bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
INSTALL_BASE=$(bazel info install_base)
sudo bash -c "cat >/etc/apparmor.d/score-linux-sandbox" <<-EOF
abi <abi/4.0>,
include <tunables/global>

profile linux-sandbox ${INSTALL_BASE}/linux-sandbox flags=(unconfined) {
userns,

# Site-specific additions and overrides. See local/README for details.
include if exists <local/score-linux-sandbox>
}
EOF
sudo apparmor_parser -r /etc/apparmor.d/score-linux-sandbox

${INSTALL_BASE}/linux-sandbox "/bin/true"
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Warning: '${INSTALL_BASE}/linux-sandbox \"/bin/true\"' failed."
else
echo "Success: '${INSTALL_BASE}/linux-sandbox \"/bin/true\"' succeeded."
fi
exit $EXIT_CODE
Loading