aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-22 21:37:47 -0800
committerGravatar MarkKoz <[email protected]>2020-02-22 21:37:47 -0800
commit782c5fc6c2e60e8e460f17d39cfad39cae7f30e0 (patch)
treef8f44bbd9e7115458a2a259668167853ab53fa93 /scripts
parentTest lint only (diff)
parentMerge pull request #62 from python-discord/bug/ci/61/python-symlink-not-resol... (diff)
Merge remote-tracking branch 'origin/master' into research
Diffstat (limited to 'scripts')
-rw-r--r--scripts/.profile15
-rwxr-xr-xscripts/dev.sh11
2 files changed, 8 insertions, 18 deletions
diff --git a/scripts/.profile b/scripts/.profile
index bd46a17..69ad959 100644
--- a/scripts/.profile
+++ b/scripts/.profile
@@ -15,18 +15,7 @@ nsjpy() {
echo "${MEM_MAX}" > /sys/fs/cgroup/memory/NSJAIL/memory.memsw.limit_in_bytes
nsjail \
- -Mo \
- --rlimit_as 700 \
- --chroot / \
- -E LANG=en_US.UTF-8 \
- -R/usr -R/lib -R/lib64 \
- --user 65534 \
- --group 65534 \
- --time_limit 2 \
- --disable_proc \
- --iface_no_lo \
- --cgroup_pids_max=1 \
- --cgroup_mem_max="${MEM_MAX}" \
+ --config "${NSJAIL_CFG:-/snekbox/snekbox.cfg}" \
$nsj_args -- \
- /snekbox/.venv/bin/python3 -Iq -c "$@"
+ /usr/local/bin/python -Iqu -c "$@"
}
diff --git a/scripts/dev.sh b/scripts/dev.sh
index 8f5b24f..0275651 100755
--- a/scripts/dev.sh
+++ b/scripts/dev.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
# Sets up a development environment and runs a shell in a docker container.
-# Usage: dev.sh [--build [--clean]] [ash_args ...]
+# Usage: dev.sh [--build [--clean]] [bash_args ...]
if [ "$1" = "--build" ]; then
shift
@@ -40,17 +40,18 @@ docker run \
--privileged \
--network host \
--hostname pdsnk-dev \
+ --ipc="none" \
-e PYTHONDONTWRITEBYTECODE=1 \
-e PIPENV_PIPFILE="/snekbox/Pipfile" \
- -e ENV="${PWD}/scripts/.profile" \
+ -e BASH_ENV="${PWD}/scripts/.profile" \
--volume "${PWD}":"${PWD}" \
--workdir "${PWD}"\
- --entrypoint /bin/ash \
+ --entrypoint /bin/bash \
pythondiscord/snekbox-venv:dev \
>/dev/null \
# Execute the given command(s)
-docker exec -it snekbox_test /bin/ash "$@"
+docker exec -it snekbox_test /bin/bash --rcfile "${PWD}/scripts/.profile" "$@"
# Fix ownership of coverage file
# BusyBox doesn't support --reference for chown
@@ -58,7 +59,7 @@ docker exec \
-it \
-e CWD="${PWD}" \
snekbox_test \
- /bin/ash \
+ /bin/bash \
-c 'chown "$(stat -c "%u:%g" "${CWD}")" "${CWD}/.coverage"'
docker rm -f snekbox_test >/dev/null # Stop and remove the container