-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_autograder
More file actions
executable file
·35 lines (26 loc) · 1.04 KB
/
run_autograder
File metadata and controls
executable file
·35 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/bash
# (c) 2022- Spiros Papadimitriou <spapadim@gmail.com>
#
# This file is released under the MIT License:
# https://opensource.org/licenses/MIT
# This software is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied.
# This file is required by gradescope, and will be copied
# to the abs path /autograder/run_autograder. It's executed
# within a fresh container instance, to grade one submission.
# Fail with error if not running in Docker or a VM (AWS?)..
if ! grep -sq ':/\(docker\|lxc\|ecs\)' /proc/1/cgroup; then
echo "ERROR: Not running in a container or VM!" 1>&2
exit 1
fi
set -x # xtrace on
# All files (incl. this, i.e., setup.sh) will remain
# within abs path /autograder/source on the Docker image
export AUTOGRADER_ROOT=/autograder/source
cd ${AUTOGRADER_ROOT}
. etc/util.sh
. etc/env.sh
pyenv_init # pyenv-installer doesn't modify .bashrc, and neither do we...
export PYTHONPATH=$PYTHONPATH:/autograder/source
${PYTHON} -m pyscope.cli setup && \
${PYTHON} -m pyscope.cli unittest