LPOJ icon indicating copy to clipboard operation
LPOJ copied to clipboard

怎么安装评测需要的新的package

Open yangshao opened this issue 5 years ago • 12 comments
trafficstars

假如用python评测的话,我可能需要安装新的package(举个例子,比如numpy), 怎么安装,然后重新部署呢?

yangshao avatar Sep 04 '20 17:09 yangshao

这个要手动部署,可以把安装的内容写在requirements.txt里

Linzecong avatar Sep 06 '20 03:09 Linzecong

能给个简单的instruction么?添加到哪个requirements.txt, 添加完之后如何重新部署?

yangshao avatar Sep 06 '20 14:09 yangshao

加到这里https://github.com/Linzecong/LPOJ/blob/master/Judger/requirements.txt 重新部署在这里https://github.com/Linzecong/LPOJ#%E8%87%AA%E5%AE%9A%E4%B9%89oj

Linzecong avatar Sep 07 '20 02:09 Linzecong

多谢,但是似乎加进去之后依然是runtime error.

yangshao avatar Sep 08 '20 00:09 yangshao

可以进到docker里看看log,看看是报什么错

Linzecong avatar Sep 08 '20 02:09 Linzecong

@Linzecong 你是指用docker logs命令么,似乎没有什么有用的信息。

yangshao avatar Sep 10 '20 01:09 yangshao

进去docker后,查看error信息如下: OpenBLAS blas_thread_init: pthread_create failed for thread 2 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 200 current, 200 max OpenBLAS blas_thread_init: pthread_create failed for thread 3 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 200 current, 200 max OpenBLAS blas_thread_init: pthread_create failed for thread 4 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 200 current, 200 max OpenBLAS blas_thread_init: pthread_create failed for thread 5 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 200 current, 200 max OpenBLAS blas_thread_init: pthread_create failed for thread 6 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 200 current, 200 max OpenBLAS blas_thread_init: pthread_create failed for thread 7 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 200 current, 200 max

yangshao avatar Sep 10 '20 01:09 yangshao

我知道了……因为判题机是运行在沙盒里的,沙盒为了安全有很多限制,不允许调用一些系统函数,numpy用了很多其他的一些系统函数,所以报错了。。。。

Linzecong avatar Sep 10 '20 02:09 Linzecong

@Linzecong 有什么办法可以解决么?

yangshao avatar Sep 10 '20 13:09 yangshao

自己改jugder,去掉沙盒,然后在judger里装numpy就好了。

Linzecong avatar Sep 14 '20 02:09 Linzecong

清问在哪里去掉沙盒? 在judger里装numpy就还是之前直接在requirements.txt加上numpy就行了吧。

yangshao avatar Sep 19 '20 18:09 yangshao

清问在哪里去掉沙盒? 在judger里装numpy就还是之前直接在requirements.txt加上numpy就行了吧。

这个得自己改源码,自己写编译和运行。在我很久之前的代码,是没有用沙盒的……有点难找了

Linzecong avatar Sep 21 '20 02:09 Linzecong