Rigorous and Reliable (RAR)

Full Version: BIBO -- O
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9

zhihao

(09-23-2020 06:27 PM)lingu Wrote: [ -> ]
(09-23-2020 06:20 PM)zhihao Wrote: [ -> ]
Code:
[zhihao@g1b-2 zhihao]$ pwd
/thinker/local/today/users/zhihao

need go to /thinker/local/today/users/sage2 because sage runs the individual tasks and sage runs using user sage2.

I suggest you split D info to anthoher thread and split the BIBO system on g1b as another thread. This is the overview thread for BIBO and we do not want it to be too crowded.

可否实现删除功能后再移动。D info准备移动到 Technology and Beyond (TaB) / Research / D-team / Customers下,但是里面还没有检察院的板块。

zhihao

我在 zhihao@g1b screen procurat内修改了talk2thinker.sh line136为flog " ===============received new case in $newcasepfn",并在screen simpleservn内重启simpleserv服务。
在screen log内查看到talk2thinker.sh对应的日志在simpleserv.log内,但是simpleserv.log内并没有看到“=====”。
(09-23-2020 07:05 PM)zhihao Wrote: [ -> ]talk2thinker.sh 中,我加入了 flog "casetype is: $casetype",并重启simpleserv服务
Code:
casecnt=$(pcf --pcf $biboext --get bibo_doc_cnt)
  /bin/cp $reqpfn $newcasepfn
  flog_enable_timestamp=True flog "    received new case in $newcasepfn"

  # if "type":"insert"
  casetype=`jq '.type' $newcasepfn | tr -d '"'`
  flog "casetype is: $casetype"
  if [[ $casetype == 'insert' ]]; then
    newdir=/thinker/globe/udata/lingu/testy/procuratorate/tests/typical/$((++casecnt))
    mkdir $newdir
在simpleserv.log里找到了talk2thinker日志。从下面输出上没有看到 received new case 后有上面添加的 flog "casetype is: $casetype"的输出。

计算机永远是对的,肯定是我们的程序有什么问题。

首先要确定是否你修改的talk2thinker.sh运行了。我查看simpleserv代码ncat语句如下:

Code:
ncat --listen 62818 --sh-exec /home/lingu/forest/prada/prada/procuratorate/ta\
lk2thinker.sh

你修改的应该不是/home/lingu/forest/prada/prada/procuratorate/talk2thinker.sh 那么就没有运行你修改的代码。此处应该修改路径,把simpleserv和talk2thinker.sh都放到一个类似于$bibo_base的地方去。

要学会看着代码分析和排查。

zhihao

(09-23-2020 07:31 PM)lingu Wrote: [ -> ]
(09-23-2020 07:05 PM)zhihao Wrote: [ -> ]talk2thinker.sh 中,我加入了 flog "casetype is: $casetype",并重启simpleserv服务
Code:
casecnt=$(pcf --pcf $biboext --get bibo_doc_cnt)
  /bin/cp $reqpfn $newcasepfn
  flog_enable_timestamp=True flog "    received new case in $newcasepfn"

  # if "type":"insert"
  casetype=`jq '.type' $newcasepfn | tr -d '"'`
  flog "casetype is: $casetype"
  if [[ $casetype == 'insert' ]]; then
    newdir=/thinker/globe/udata/lingu/testy/procuratorate/tests/typical/$((++casecnt))
    mkdir $newdir
在simpleserv.log里找到了talk2thinker日志。从下面输出上没有看到 received new case 后有上面添加的 flog "casetype is: $casetype"的输出。

计算机永远是对的,肯定是我们的程序有什么问题。

首先要确定是否你修改的talk2thinker.sh运行了。我查看simpleserv代码ncat语句如下:

Code:
ncat --listen 62818 --sh-exec /home/lingu/forest/prada/prada/procuratorate/ta\
lk2thinker.sh

你修改的应该不是/home/lingu/forest/prada/prada/procuratorate/talk2thinker.sh 那么就没有运行你修改的代码。此处应该修改路径,把simpleserv和talk2thinker.sh都放到一个类似于$bibo_base的地方去。

要学会看着代码分析和排查。

已将procone.py, simpleserv.sh, talk2thinker.sh, thinkres.py放到$bibo_base: /thinker/globe/soft/bibo 并更新首文
(09-23-2020 07:11 PM)zhihao Wrote: [ -> ]可否实现删除功能后再移动。

OK.

Quote:D info准备移动到 Technology and Beyond (TaB) / Research / D-team / Customers下,但是里面还没有检察院的板块。

就放本版块即可。

zhihao

tmux session ncat内执行ncat返回404
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 404,
"msg": "not found",
"children": [
]
}

[zhihao@limbo30-1 processed]$
(09-23-2020 09:04 PM)zhihao Wrote: [ -> ]tmux session ncat内执行ncat返回404
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 404,
"msg": "not found",
"children": [
]
}

[zhihao@limbo30-1 processed]$

I restarted sage.
Code:
1024  ~/sage/bin/sage stop
1025  ~/sage/bin/sage start

but it hasn't helped.
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 404,
"msg": "not found",
"children": [
]
}

[zhihao@limbo30-1 processed]$
(09-23-2020 09:22 PM)lingu Wrote: [ -> ]but it hasn't helped.
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 404,
"msg": "not found",
"children": [
]
}

[zhihao@limbo30-1 processed]$

i tested procone and it has some syntax error.
Code:
[sage2@g1b-2 ~]$ /thinker/globe/soft/bibo/procone.py --tycano 10
  File "/thinker/globe/soft/bibo/procone.py", line 27
    os.system(rid --insitu tycajson_pfn)
                                      ^
SyntaxError: invalid syntax
[sage2@g1b-2 ~]$

The param should be a string.

But os.system is not our preferred way to run a command. We use cmdline. So I changed it to
Code:
cmdline.runOrExit("rid --insitu tycajson_pfn")

After this is fixed, there is another error.
Code:
[sage2@g1b-2 ~]$ /thinker/globe/soft/bibo/procone.py --tycano 10
  File "/thinker/globe/soft/bibo/procone.py", line 51
    elif opt == "--reqtype"
                          ^
SyntaxError: invalid syntax
[sage2@g1b-2 ~]$

Added ':'
Next error
Code:
[sage2@g1b-2 ~]$ /thinker/globe/soft/bibo/procone.py --tycano 10
Traceback (most recent call last):
  File "/thinker/globe/soft/bibo/procone.py", line 189, in <module>
    main()
  File "/thinker/globe/soft/bibo/procone.py", line 85, in main
    if reqtype == "delete":
UnboundLocalError: local variable 'reqtype' referenced before assignment
[sage2@g1b-2 ~]$

you need make sure all vars are assigned a value before they are used. I added
Code:
reqtype = None
at the beginning of the code.

Now the query request works in tmux session ncat.
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
...
   ],
   "caseid": "67be23909e6311eabceb005056c00001",
   "caseyear": 2016,
   "casetitle": "马世龙(抢劫)核准追诉案",
   "casetype": "最高人民检察院指导性案例",
   "caserate": "5.00",
   "caseaction": "抢劫罪",
   "score": 100
  }
]
}

delete seems to work as well.
Code:
[zhihao@limbo30-1 processed]$ ( cat del_zengxingliang.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 200,
"msg": "ok",
"children": []
}

I am leaving tmux session ncat. You can proceed to test it and make sure delete works. Then inform the customer to test.

zhihao

screen procurat 内执行procone.py解析错误
Code:
[sage2@g1b-2 bibo]$ ./procone.py --tycano 15 --reqtype delete --reqcaseid 67be261c9e6311eabceb005056c00001
Traceback (most recent call last):
  File "./procone.py", line 191, in <module>
    main()
  File "./procone.py", line 41, in main
    '--reference=',
  File "/usr/lib64/python2.7/getopt.py", line 131, in gnu_getopt
    opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
  File "/usr/lib64/python2.7/getopt.py", line 152, in do_longs
    has_arg, opt = long_has_args(opt, longopts)
  File "/usr/lib64/python2.7/getopt.py", line 169, in long_has_args
    raise GetoptError('option --%s not recognized' % opt, opt)
getopt.GetoptError: option --reqtype not recognized
[sage2@g1b-2 bibo]$
(09-23-2020 11:14 PM)zhihao Wrote: [ -> ]screen procurat 内执行procone.py解析错误
Code:
[sage2@g1b-2 bibo]$ ./procone.py --tycano 15 --reqtype delete --reqcaseid 67be261c9e6311eabceb005056c00001
Traceback (most recent call last):
  File "./procone.py", line 191, in <module>
    main()
  File "./procone.py", line 41, in main
    '--reference=',
  File "/usr/lib64/python2.7/getopt.py", line 131, in gnu_getopt
    opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
  File "/usr/lib64/python2.7/getopt.py", line 152, in do_longs
    has_arg, opt = long_has_args(opt, longopts)
  File "/usr/lib64/python2.7/getopt.py", line 169, in long_has_args
    raise GetoptError('option --%s not recognized' % opt, opt)
getopt.GetoptError: option --reqtype not recognized
[sage2@g1b-2 bibo]$

you need study how gnu_getopt works.

For programming, you can copy the logic for '--tycano'.
Pages: 1 2 3 4 5 6 7 8 9
Reference URL's