mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2025-11-04 14:50:01 +08:00
feat: bump python to 3.7
This commit is contained in:
parent
d35d7333fe
commit
6b7d440f35
10
Dockerfile
10
Dockerfile
@ -1,17 +1,17 @@
|
|||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
COPY build/java_policy /etc
|
COPY build/java_policy /etc
|
||||||
RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \
|
RUN buildDeps='software-properties-common git libtool cmake python3.7-dev python-dev python3-pip python-pip libseccomp-dev' && \
|
||||||
apt-get update && apt-get install -y python python3 python-pkg-resources python3-pkg-resources gcc g++ $buildDeps && \
|
apt-get update && apt-get install -y python python3.7 python-pkg-resources python3-pkg-resources gcc g++ $buildDeps && \
|
||||||
add-apt-repository ppa:openjdk-r/ppa && add-apt-repository ppa:longsleep/golang-backports && apt-get update && apt-get install -y golang-go openjdk-8-jdk && \
|
add-apt-repository ppa:openjdk-r/ppa && add-apt-repository ppa:longsleep/golang-backports && apt-get update && apt-get install -y golang-go openjdk-8-jdk && \
|
||||||
pip3 install -I --no-cache-dir psutil gunicorn flask requests idna && \
|
python3.7 -m pip install -I --no-cache-dir psutil gunicorn flask requests idna && \
|
||||||
cd /tmp && git clone -b newnew --depth 1 https://github.com/QingdaoU/Judger && cd Judger && \
|
cd /tmp && git clone -b newnew --depth 1 https://github.com/QingdaoU/Judger && cd Judger && \
|
||||||
mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \
|
mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3.7 setup.py install && \
|
||||||
apt-get purge -y --auto-remove $buildDeps && \
|
apt-get purge -y --auto-remove $buildDeps && \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||||
mkdir -p /code && \
|
mkdir -p /code && \
|
||||||
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
|
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
|
||||||
HEALTHCHECK --interval=5s --retries=3 CMD python3 /code/service.py
|
HEALTHCHECK --interval=5s --retries=3 CMD python3.7 /code/service.py
|
||||||
ADD server /code
|
ADD server /code
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
RUN gcc -shared -fPIC -o unbuffer.so unbuffer.c
|
RUN gcc -shared -fPIC -o unbuffer.so unbuffer.c
|
||||||
|
|||||||
@ -82,14 +82,14 @@ return [
|
|||||||
'py3_lang_config' => [
|
'py3_lang_config' => [
|
||||||
'compile' => [
|
'compile' => [
|
||||||
'src_name' => 'solution.py',
|
'src_name' => 'solution.py',
|
||||||
'exe_name' => '__pycache__/solution.cpython-35.pyc',
|
'exe_name' => '__pycache__/solution.cpython-37.pyc',
|
||||||
'max_cpu_time' => 3000,
|
'max_cpu_time' => 3000,
|
||||||
'max_real_time' => 5000,
|
'max_real_time' => 5000,
|
||||||
'max_memory' => 128 * 1024 * 1024,
|
'max_memory' => 128 * 1024 * 1024,
|
||||||
'compile_command' => '/usr/bin/python3 -m py_compile {src_path}',
|
'compile_command' => '/usr/bin/python3.7 -m py_compile {src_path}',
|
||||||
],
|
],
|
||||||
'run' => [
|
'run' => [
|
||||||
'command' => '/usr/bin/python3 {exe_path}',
|
'command' => '/usr/bin/python3.7 {exe_path}',
|
||||||
'seccomp_rule' => 'general',
|
'seccomp_rule' => 'general',
|
||||||
'env' => array_merge(['MALLOC_ARENA_MAX=1'], $default_env)
|
'env' => array_merge(['MALLOC_ARENA_MAX=1'], $default_env)
|
||||||
]
|
]
|
||||||
|
|||||||
@ -89,14 +89,14 @@ py2_lang_config = {
|
|||||||
py3_lang_config = {
|
py3_lang_config = {
|
||||||
"compile": {
|
"compile": {
|
||||||
"src_name": "solution.py",
|
"src_name": "solution.py",
|
||||||
"exe_name": "__pycache__/solution.cpython-36.pyc",
|
"exe_name": "__pycache__/solution.cpython-37.pyc",
|
||||||
"max_cpu_time": 3000,
|
"max_cpu_time": 3000,
|
||||||
"max_real_time": 5000,
|
"max_real_time": 5000,
|
||||||
"max_memory": 128 * 1024 * 1024,
|
"max_memory": 128 * 1024 * 1024,
|
||||||
"compile_command": "/usr/bin/python3 -m py_compile {src_path}",
|
"compile_command": "/usr/bin/python3.7 -m py_compile {src_path}",
|
||||||
},
|
},
|
||||||
"run": {
|
"run": {
|
||||||
"command": "/usr/bin/python3 {exe_path}",
|
"command": "/usr/bin/python3.7 {exe_path}",
|
||||||
"seccomp_rule": "general",
|
"seccomp_rule": "general",
|
||||||
"env": ["PYTHONIOENCODING=UTF-8"] + default_env
|
"env": ["PYTHONIOENCODING=UTF-8"] + default_env
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,14 +112,14 @@ var PY2LangConfig = &LangConfig{
|
|||||||
var PY3LangConfig = &LangConfig{
|
var PY3LangConfig = &LangConfig{
|
||||||
CompileConfig: CompileConfig{
|
CompileConfig: CompileConfig{
|
||||||
SrcName: "solution.py",
|
SrcName: "solution.py",
|
||||||
ExeName: "__pycache__/solution.cpython-35.pyc",
|
ExeName: "__pycache__/solution.cpython-37.pyc",
|
||||||
MaxCpuTime: 3000,
|
MaxCpuTime: 3000,
|
||||||
MaxRealTime: 5000,
|
MaxRealTime: 5000,
|
||||||
MaxMemory: 128 * 1024 * 1024,
|
MaxMemory: 128 * 1024 * 1024,
|
||||||
CompileCommand: "/usr/bin/python3 -m py_compile {src_path}",
|
CompileCommand: "/usr/bin/python3.7 -m py_compile {src_path}",
|
||||||
},
|
},
|
||||||
RunConfig: RunConfig{
|
RunConfig: RunConfig{
|
||||||
Command: "/usr/bin/python3 {exe_path}",
|
Command: "/usr/bin/python3.7 {exe_path}",
|
||||||
SeccompRule: "general",
|
SeccompRule: "general",
|
||||||
Env: append(DefaultEnv, "PYTHONIOENCODING=UTF-8"),
|
Env: append(DefaultEnv, "PYTHONIOENCODING=UTF-8"),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
3.6.2
|
3.7.5
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user