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-22-2020 02:40 PM)zhihao Wrote: [ -> ]coolauntie代码内有flog相关代码,但是对应的coolauntie.log没有生成,说明命令没有执行,但是coolauntie确实位于$PATH路径内,不明白为什么不能执行
Code:
[zhihao@g1b-2 bin]$ pwd
/home/sage2/sage/bin
[zhihao@g1b-2 bin]$ head -n 20 /thinker/bin/coolauntie
#!/bin/bash

# Copyright since 2018, Ningbo Shufang Information Technology Co., Ltd.
# Copyright since 2018, Hututa Technologies Limited
# All rights reserved.
#
# A tool to help use auntie
# Refer to http://tab.d-thinker.org/showthread.php?tid=10679 for more details
#
# Authors: Xinjie Yu

progname=coolauntie

source /thinker/local/forest/util/utilib/bash.inc
flog ""
flog "[$(date)] coolauntie $*"
AUNTIE=/thinker/globe/.think/run/auntie
## set -o errexit


[zhihao@g1b-2 bin]$

Code:
[zhihao@g1b-2 root]$ pwd
/thinker/local/today/users/root
[zhihao@g1b-2 root]$ ls | grep "cool"
[zhihao@g1b-2 root]$

将sage_clear内出错语句单独拿到终端执行,会一直卡住,无任何输出
Code:
function Action () {
  # Generate command file
  todaypfn=$(todaydir)/$progname
  local turbots=${todaypfn}.ts

  echo '@-1 (-1 -1 -1 -1 -1 -1) (-1 1 1) erase' > $turbots
  flog "  erase with $turbots log to $log_pfn"
  coolauntie register $turbots >> $log_pfn
}

flog " "
flog "sage_clear run by $USER"

Action

Code:
[zhihao@g1b-2 ~]$ pwd
/home/zhihao
[zhihao@g1b-2 ~]$ echo '@-1 (-1 -1 -1 -1 -1 -1) (-1 1 1) erase' > turbots
[zhihao@g1b-2 ~]$ cat turbots
@-1 (-1 -1 -1 -1 -1 -1) (-1 1 1) erase
[zhihao@g1b-2 ~]$ coolauntie register turbots >> log_pfn
^C
[zhihao@g1b-2 ~]$ cat log_pfn
[zhihao@g1b-2 ~]$
(09-22-2020 03:01 PM)zhihao Wrote: [ -> ]因为不用sudo的话会提示类似 “/thinker/storage/udata/lingu/testy/procuratorate/tests/typical/” permission deny的问题,但是现在无法复现。使用bash simpleserv.sh一样会卡住

还是用你的用户,不要用root

把permission问题记录下来,我们找100年解法。你不记录,肯定是没法正确工作的。
(09-22-2020 05:45 PM)zhihao Wrote: [ -> ]
(09-22-2020 02:40 PM)zhihao Wrote: [ -> ]coolauntie代码内有flog相关代码,但是对应的coolauntie.log没有生成,说明命令没有执行,但是coolauntie确实位于$PATH路径内,不明白为什么不能执行
Code:
[zhihao@g1b-2 bin]$ pwd
/home/sage2/sage/bin
[zhihao@g1b-2 bin]$ head -n 20 /thinker/bin/coolauntie
#!/bin/bash

# Copyright since 2018, Ningbo Shufang Information Technology Co., Ltd.
# Copyright since 2018, Hututa Technologies Limited
# All rights reserved.
#
# A tool to help use auntie
# Refer to http://tab.d-thinker.org/showthread.php?tid=10679 for more details
#
# Authors: Xinjie Yu

progname=coolauntie

source /thinker/local/forest/util/utilib/bash.inc
flog ""
flog "[$(date)] coolauntie $*"
AUNTIE=/thinker/globe/.think/run/auntie
## set -o errexit


[zhihao@g1b-2 bin]$

Code:
[zhihao@g1b-2 root]$ pwd
/thinker/local/today/users/root
[zhihao@g1b-2 root]$ ls | grep "cool"
[zhihao@g1b-2 root]$

将sage_clear内出错语句单独拿到终端执行,会一直卡住,无任何输出

那就debug "sage clear"。这是一条比较独立的命令,容易调试。

你是否用了screen? screen名称是什么?我进该screen查看。

Quote:[quote]
Code:
function Action () {
  # Generate command file
  todaypfn=$(todaydir)/$progname
  local turbots=${todaypfn}.ts

  echo '@-1 (-1 -1 -1 -1 -1 -1) (-1 1 1) erase' > $turbots
  flog "  erase with $turbots log to $log_pfn"
  coolauntie register $turbots >> $log_pfn
}

flog " "
flog "sage_clear run by $USER"

Action

Code:
[zhihao@g1b-2 ~]$ pwd
/home/zhihao
[zhihao@g1b-2 ~]$ echo '@-1 (-1 -1 -1 -1 -1 -1) (-1 1 1) erase' > turbots
[zhihao@g1b-2 ~]$ cat turbots
@-1 (-1 -1 -1 -1 -1 -1) (-1 1 1) erase
[zhihao@g1b-2 ~]$ coolauntie register turbots >> log_pfn
^C
[zhihao@g1b-2 ~]$ cat log_pfn
[zhihao@g1b-2 ~]$

coolauntie阻塞了。可能是用户zhihao的设置未能配合sage工作。

zhihao

(09-22-2020 01:37 PM)lingu Wrote: [ -> ]
(09-19-2020 08:29 PM)zhihao Wrote: [ -> ]
(09-19-2020 02:53 PM)lingu Wrote: [ -> ]zhihao - it looks like there is no progress in this project. You should document the logic of simpleserv, then propose a change for the insert function.


simpleserv.sh
监听62818端口,执行talk2thinker.sh

talk2thinker.sh
读取一个案例请求,保存到$toneroot/newreeq文件,执行tellThinker, getresults函数

tellThinker()
将"@$spc (-1 -1 -1 -1 -1 -1) > (0 $reqno $j) $toneroot/procone.py --tycano $j"写入$toneroot/manytasks.ts作为sage执行的任务。

procone.py
在某一案例内容中搜索key{1,2,3},构建"keys": []。

getresults()
执行thinkres.py,返回procone.py查询到的结果,构建返回的json。

Why do you just write it here without generating any results?

Ask for review, then update the headpost.

Use [ code ] to wrap pseudocode.

现已在首文添加设计信息。并将代码放入代码块

zhihao

(09-22-2020 05:55 PM)lingu Wrote: [ -> ]
(09-22-2020 05:45 PM)zhihao Wrote: [ -> ]
(09-22-2020 02:40 PM)zhihao Wrote: [ -> ]coolauntie代码内有flog相关代码,但是对应的coolauntie.log没有生成,说明命令没有执行,但是coolauntie确实位于$PATH路径内,不明白为什么不能执行
Code:
[zhihao@g1b-2 bin]$ pwd
/home/sage2/sage/bin
[zhihao@g1b-2 bin]$ head -n 20 /thinker/bin/coolauntie
#!/bin/bash

# Copyright since 2018, Ningbo Shufang Information Technology Co., Ltd.
# Copyright since 2018, Hututa Technologies Limited
# All rights reserved.
#
# A tool to help use auntie
# Refer to http://tab.d-thinker.org/showthread.php?tid=10679 for more details
#
# Authors: Xinjie Yu

progname=coolauntie

source /thinker/local/forest/util/utilib/bash.inc
flog ""
flog "[$(date)] coolauntie $*"
AUNTIE=/thinker/globe/.think/run/auntie
## set -o errexit


[zhihao@g1b-2 bin]$

Code:
[zhihao@g1b-2 root]$ pwd
/thinker/local/today/users/root
[zhihao@g1b-2 root]$ ls | grep "cool"
[zhihao@g1b-2 root]$

将sage_clear内出错语句单独拿到终端执行,会一直卡住,无任何输出

那就debug "sage clear"。这是一条比较独立的命令,容易调试。

你是否用了screen? screen名称是什么?我进该screen查看。

没有使用screen操作。现在创建了一个screen
Code:
[zhihao@g1b-2 ~]$ screen -r zh-scr
[detached from 90643.zh-scr]

zhihao

(09-22-2020 05:50 PM)lingu Wrote: [ -> ]
(09-22-2020 03:01 PM)zhihao Wrote: [ -> ]因为不用sudo的话会提示类似 “/thinker/storage/udata/lingu/testy/procuratorate/tests/typical/” permission deny的问题,但是现在无法复现。使用bash simpleserv.sh一样会卡住

还是用你的用户,不要用root

把permission问题记录下来,我们找100年解法。你不记录,肯定是没法正确工作的。

现在已经在zhihao用户下的screen ”119609.simpleserv“ 内将simperserv.sh换成zhihao用户执行。
Code:
[zhihao@g1b-2 procuratorate]$ ./simpleserv.sh

之前没有把问题记录下来,现在卡在sage_clear,无法复现permission deny
(09-22-2020 06:11 PM)zhihao Wrote: [ -> ]
(09-22-2020 05:50 PM)lingu Wrote: [ -> ]
(09-22-2020 03:01 PM)zhihao Wrote: [ -> ]因为不用sudo的话会提示类似 “/thinker/storage/udata/lingu/testy/procuratorate/tests/typical/” permission deny的问题,但是现在无法复现。使用bash simpleserv.sh一样会卡住

还是用你的用户,不要用root

把permission问题记录下来,我们找100年解法。你不记录,肯定是没法正确工作的。

现在已经在zhihao用户下的screen ”119609.simpleserv“ 内将simperserv.sh换成zhihao用户执行。
Code:
[zhihao@g1b-2 procuratorate]$ ./simpleserv.sh

执行sage clear即可,这样调试的功能规模比较合适,简化一些。

Quote:之前没有把问题记录下来,现在卡在sage_clear,无法复现permission deny

我现在登录到你的screen。

zhihao

(09-22-2020 01:40 PM)lingu Wrote: [ -> ]
(09-20-2020 01:45 AM)zhihao Wrote: [ -> ]
Quote:加上以下代码,把接收到的案例信息存放到文件夹名最大的目录内

...
...
/bin/cp $reqpfn $newcasepfn
flog_enable_timestamp=True flog " received new case in $newcasepfn"

# if "type":"insert"
casetype=`jq '.type' $newcasepfn`
if [[ $casetype == "\"insert\"" ]]; then
newdir=$(ls /thinker/globe/udata/lingu/testy/procuratorate/tests/typical | wc -l)
mkdir $newdir
casecnt=$((++newdir))
cp $newcasepfn $newdir/insert.json

OK.

[quote]
echo -e "{\n\
"code": 200,\n\
"msg": "ok",\n\
"children": []\n\
}"
exit 0
fi

i dont know whether it is a good idea to generate the response here. But it is okay to design like this now and we can improve later.

Quote:RR lingu

OK.

But don't write code. Write pseudocode. Don't you know this rule?

已更新到首文talk2thinker.sh内
(09-22-2020 06:23 PM)lingu Wrote: [ -> ]
Quote:之前没有把问题记录下来,现在卡在sage_clear,无法复现permission deny

我现在登录到你的screen。

i went to screen simpleserv and stopped the simpleserv program.

sage_clear seems to complete quickly.
Code:
[zhihao@g1b-2 procuratorate]$  sage_user=sage2 /home/sage2/sage/bin/sage_clear
[zhihao@g1b-2 procuratorate]$

Strangely there is no error reported.
Code:
[Tue Sep 22 17:41:24 CST 2020] coolauntie register /thinker/local/today/users/zhihao/.ts
coolauntie register /thinker/local/today/users/zhihao/.ts [Tue Sep 22 17:41:24 CST 2020]
  0: /thinker/globe/.think/run/auntie runs /thinker/globe/.think/run/auntie register /thinker/local/today/users/zhihao/.ts
  to run /thinker/globe/.think/run/auntie register /thinker/local/today/users/zhihao/.ts with timeout 20s
    timeout run completes with 0
  this try exits with 0 [0922-17:41:24]
[Tue Sep 22 17:41:24 CST 2020] coolauntie completes (0)

auntie log seems to be happy, too.
Code:
auntie ::...- /thinker/globe/.think/run/auntie... 0x3 0x0 0x0
2020.09.22 17:41:24 (67):   sage_user sage2
2020.09.22 17:41:24 (67):   arguments starts..- register.. 0x1 0x0 0x0
2020.09.22 17:41:24 (67):   auntie arg:..- register.. 0x3 0x1 0x1
2020.09.22 17:41:24 (67):   vb - 63 0 0 0
2020.09.22 17:41:24 (67): auntie prelude()
2020.09.22 17:41:24 (67):   nDown: - 3 0 0 0
2020.09.22 17:41:24 (67): auntie - opened up channel..- /thinker/local/sage2/atpdup.. 0x4 0x0 0x0
2020.09.22 17:41:24 (67): auntie::RegisterTasks:  /thinker/local/today/users/zhihao/.ts
2020.09.22 17:41:24 (67):   wrote to atpd: ..- TR... 0x5 0x0 0x0
2020.09.22 17:41:24 (67): Talker::sendBuffer: /thinker/local/today/users/zhihao/.ts 37
2020.09.22 17:41:24 (67):   file:: /thinker/local/today/users/zhihao/.ts
2020.09.22 17:41:24 (67):   atpd responds happily: AT.
2020.09.22 17:41:24 (67): WaveBye: Well Done

I think you can proceed to run simpleserve and see if there are any problems.

zhihao

(09-22-2020 06:43 PM)lingu Wrote: [ -> ]
(09-22-2020 06:23 PM)lingu Wrote: [ -> ]
Quote:之前没有把问题记录下来,现在卡在sage_clear,无法复现permission deny

我现在登录到你的screen。

i went to screen simpleserv and stopped the simpleserv program.

sage_clear seems to complete quickly.
Code:
[zhihao@g1b-2 procuratorate]$  sage_user=sage2 /home/sage2/sage/bin/sage_clear
[zhihao@g1b-2 procuratorate]$

Strangely there is no error reported.
Code:
[Tue Sep 22 17:41:24 CST 2020] coolauntie register /thinker/local/today/users/zhihao/.ts
coolauntie register /thinker/local/today/users/zhihao/.ts [Tue Sep 22 17:41:24 CST 2020]
  0: /thinker/globe/.think/run/auntie runs /thinker/globe/.think/run/auntie register /thinker/local/today/users/zhihao/.ts
  to run /thinker/globe/.think/run/auntie register /thinker/local/today/users/zhihao/.ts with timeout 20s
    timeout run completes with 0
  this try exits with 0 [0922-17:41:24]
[Tue Sep 22 17:41:24 CST 2020] coolauntie completes (0)

auntie log seems to be happy, too.
Code:
auntie ::...- /thinker/globe/.think/run/auntie... 0x3 0x0 0x0
2020.09.22 17:41:24 (67):   sage_user sage2
2020.09.22 17:41:24 (67):   arguments starts..- register.. 0x1 0x0 0x0
2020.09.22 17:41:24 (67):   auntie arg:..- register.. 0x3 0x1 0x1
2020.09.22 17:41:24 (67):   vb - 63 0 0 0
2020.09.22 17:41:24 (67): auntie prelude()
2020.09.22 17:41:24 (67):   nDown: - 3 0 0 0
2020.09.22 17:41:24 (67): auntie - opened up channel..- /thinker/local/sage2/atpdup.. 0x4 0x0 0x0
2020.09.22 17:41:24 (67): auntie::RegisterTasks:  /thinker/local/today/users/zhihao/.ts
2020.09.22 17:41:24 (67):   wrote to atpd: ..- TR... 0x5 0x0 0x0
2020.09.22 17:41:24 (67): Talker::sendBuffer: /thinker/local/today/users/zhihao/.ts 37
2020.09.22 17:41:24 (67):   file:: /thinker/local/today/users/zhihao/.ts
2020.09.22 17:41:24 (67):   atpd responds happily: AT.
2020.09.22 17:41:24 (67): WaveBye: Well Done

I think you can proceed to run simpleserve and see if there are any problems.

sage_clear没问题。
Code:
[zhihao@g1b-2 zhihao]$ sage_user=sage2 /home/sage2/sage/bin/sage_clear
[zhihao@g1b-2 zhihao]$

在zhihao 的screen “simmpleserv"内开启服务
Code:
[zhihao@g1b-2 ~]$ cd forest/prada/prada/procuratorate/
[zhihao@g1b-2 procuratorate]$ ./simpleserv.sh

limbo30-1上执行ncat,一段时间后还是没有返回值
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
Pages: 1 2 3 4 5 6 7 8 9
Reference URL's