support memory_limit_check_only

update Java version to 8
This commit is contained in:
virusdefender 2018-03-23 18:32:54 +08:00
parent 67f16b92f5
commit cee8831690
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@ COPY build/java_policy /etc
RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \
apt-get update && apt-get install -y python python3.5 python-pkg-resources python3-pkg-resources gcc g++ $buildDeps && \
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-7-jdk && \
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && \
pip3 install --no-cache-dir psutil gunicorn flask requests && \
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 && \

View File

@ -62,9 +62,10 @@ java_lang_config = {
"compile_command": "/usr/bin/javac {src_path} -d {exe_dir} -encoding UTF8"
},
"run": {
"command": "/usr/bin/java -cp {exe_dir} -Xss1M -XX:MaxPermSize=16M -XX:PermSize=8M -Xms16M -Xmx{max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main",
"command": "/usr/bin/java -cp {exe_dir} -XX:MaxRAM={max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main",
"seccomp_rule": None,
"env": ["MALLOC_ARENA_MAX=1"] + default_env
"env": default_env,
"memory_limit_check_only": 1
}
}

View File

@ -114,7 +114,8 @@ class JudgeClient(object):
log_path=JUDGER_RUN_LOG_PATH,
seccomp_rule_name=self._run_config["seccomp_rule"],
uid=RUN_USER_UID,
gid=RUN_GROUP_GID)
gid=RUN_GROUP_GID,
memory_limit_check_only=self._run_config.get("memory_limit_check_only", 0))
run_result["test_case"] = test_case_file_id
# if progress exited normally, then we should check output result