- This document is about Method 2 on https://github.com/Kattis/problemtools
- Replace
REPO
with the path to your local clone of the GitHub repository. - Assume the
REPO
contains theproblems
directory.
- Install and start Docker Desktop
- Download image:
docker pull problemtools/icpc
- Download PyPy 7.3.9 for Python 3.8: https://downloads.python.org/pypy/
- Check the latest version on Kattis: https://open.kattis.com/help/python3
- Download on your host machine as the
problemtools/icpc
image does not includecurl
orwget
.
- Move the downloaded file (
pypy3.8-v7.3.9-linux64.tar.bz2
) to theREPO/problems
directory - Run container in the
REPO
directory:docker run --rm -it -v ${PWD}/problems:/kattis_work_dir problemtools/icpc
- Run the following commands inside the container (do not terminate until you save as image):
# mv -i /kattis_work_dir/pypy3.8-v7.3.9-linux64.tar.bz2 /tmp
# cd /tmp
# tar xf pypy3.8-v7.3.9-linux64.tar.bz2
# mv -i pypy3.8-v7.3.9-linux64 /usr/share
# ln -s /usr/share/pypy3.8-v7.3.9-linux64/bin/pypy3.8 /usr/bin/pypy3
# rm -i pypy3.8-v7.3.9-linux64.tar.bz2
# pypy3 --version
Warning: cannot find your CPU L2 cache size in /proc/cpuinfo
Python 3.8.13 (4b1398fe9d76ad762155d03684c2a153d230b2ef, Mar 29 2022, 07:08:24)
[PyPy 7.3.9 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]
- Continue to work inside the container:
# mkdir -p /etc/kattis/problemtools
# cat >> /etc/kattis/problemtools/languages.yaml
python3:
name: 'Python 3 w/PyPy'
run: '/usr/bin/pypy3 "{mainfile}"'
(press Ctrl-D)
(The image does not include an editor.)
- Save the updated container as an image:
docker ps
: check for CONTAINER_IDdocker commit <CONTAINER_ID> problemtools/icpc
- The first line of your Python submission code should be:
#!/usr/bin/env python3
- In the container, run:
verifyproblem <PROBLEM_NAME>
- You should see:
Checking submissions ... Running <PROBLEM_NAME>.py (Python 3 w/PyPy) on test case...
- Check only submissions:
verifyproblem <PROBLEM_NAME> -p submissions
- See
verifyproblem --help
- You should see: