Rigorous and Reliable (RAR)
Service management of Sage - D - Printable Version

+- Rigorous and Reliable (RAR) (http://rar.shufangkeji.com:60380)
+-- Forum: Forum Help and Management (/forumdisplay.php?fid=448)
+--- Forum: Black Hole (/forumdisplay.php?fid=603)
+--- Thread: Service management of Sage - D (/showthread.php?tid=4389)


Service management of Sage - D - YU_Xinjie - 07-12-2016 05:54 PM

The src of the sage program is cod://sage/src/service/bin/sage

goal

1. the script can be used on sage_user@sage_portal to start/stop/status sage.
2. the script should not couple GLAD.

The script would replace the current start.sh/stop.sh/status.sh.

sage main logiccommon var import
Code:
modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips
set timeout to be half of the number of lines in $ips or 3 if $ips does not exist

parse options
run command
  start
  status
  ps
  tasks
  help

sage start

Start a sage_screen to run script start_sage.
start_sage script looks like this:
Code:
trap ctrl_c

if type ctrl_c; then
    echo "You type ctrl_c to terminate program"
    kill DT
    clean all object files and exit

do_start() {
    ./detect_listen.sh &
    make run, which would calls `dt run sage-svc $sage_base/config.pcf`
}

if the 1st parameter  == 'nohup'; then
    nohup do_start() > $sage_stdout 2>&1 &
else
    do_start() 2>&1

Use auntie/ps to check whether sage is started correctly.
If start successfully, wake_sage script is executed in a screen. wake_sage would periodically output the tasks graph info into $sage_base/stdout/tasks_graph.tmp.<timestamp>.

sage stop

Use 'dt slay' to stop DT.
Kill the sage_screen.
Use ps to check whether sage is stopped correctly.

sage status

"dexer auntie" to check the status of sage.

sage ps

Use "screen -ls" to get the sage_service screens info.
Use "dexer 'ps aux' | grep -E 'vpc|nrc|scheduler|mem_home|atpd|ncat|xfer|sgl|: ps aux'" to get the processes info.


sage tasks
sage tasks invokes function tasks_sage():
Code:
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
  while True {
    cnt = count ${tasks_graph_file}*;
    sleep 5 if cnt>1 || cnt==0;
    otherwise break;
  }
  call auntie ##To wake up sage to collect info in all nodes.
  check timestamp;
  cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
  update timestamp;
}

---------
20191123/lingu: move tasks out.
20190511/cwt: Add auntie call.
20190510/lingu: timeout default 3.
20190509/cwt: Add common var import. Add timeout, IP count etc.
20190508/lingu: add src location.
20160927/yxj: decouple sage service script with glad.


RE: Service management of Sage - YU_Xinjie - 09-07-2016 02:00 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  This thread is the design of service management of Sage

The usage of service management is in
http://tab.d-thinker.org/showthread.php?tid=6164
http://tab.d-thinker.org/showthread.php?tid=6197

Format PPM

./format.sh
Code:
dt format -n NVPC k

Load metadata

./load.sh
Code:
set $cfgfile, $nodefile,  search file prefix($prefix).
echo 'Greppy system is starting.....'
tr '\n' from the $nodefile

function get_basic_info:
    get vpcs,space,ip,slot,filename, nf(how many parts one line divided by space) info from $nodefile, all vars are array var.

function make_link:
parameter: $file need to search
    if [ ! -f $file on $ip ] :
          echo '$file not on $ip" and exit
    else:
          make links with $file into  thinker stdin dir.

function gain_config() :
printf $space, $filesize, $dejavusize into $cfgfile

totalline = len of $nodefile

function gen_config()
mv vpc.$num and nrcs.$num to thinker runtime dir.

for i in range(0,totalline):
    get_basic_info()
    $host[i] = $ip
    if [ $nf -eq 2 ]  ##means file need to search
      make_link
      gain_config
   else
      print $space, 0, 0, 'n' to $cfgfile
      
gen_config()
call make datacfg to run size prog
call make read to run read prog

Start service

./start.sh
Code:
trap ctrl_c

if type ctrl_c; then
    echo "You type ctrl_c to terminate program"
    kill DT
    clean all object files and exit

if the 1st parameter  == 'nohup'; then
    nohup do_start &
else
    do_start

function do_start() {
    make run
}

Stop service

./stop.sh
Code:
dt slay -n NVPC k

Show status

./status.h
Code:
dexer --ips=$ips "ps aux" | grep -E 'vpc|nrc|scheduler|mem_home|atpd|auntie|ncat' | grep 'sage' | grep -v 'dexer' | grep -v 'grep'

Saved a copy before change.


RE: Service management of Sage - YU_Xinjie - 09-07-2016 02:47 PM

@lingu

Please review the design, so that I can implement it.


RE: Service management of Sage - lingu - 09-07-2016 03:53 PM

It seems to be quite complex. Do we need to really pay that complexity? If so, please let me know and I'll review the design in detail.

Here is what I think we can do:

1. Start/stop sage using the current way (start.sh and kill).

2. An operative user may not be able to run start.sh and kill as the user 'sage'. Hence, there should be some mechanism. For example, can we create a user 'gladsage' whose login shell is a command that uses a key file to login as sage and run start.sh or kill.


RE: Service management of Sage - lingu - 09-07-2016 03:55 PM

We still need to handle race condition for running multiple sage thinkers. But I think thinkers already have such conflict reporting capability. We just need to track the return status of start.sh and report an error as well as stop glad when errors occur.

If start.sh does not report the return status correctly, we need to perhaps improve start.sh.


RE: Service management of Sage - lingu - 09-07-2016 03:58 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  The brief idea is to use auntie to send a file to glad_portal. Then check the file content.

Directly running auntie without argumets can already check if sage is present.

Quote:1.
require sage_user can password-less login sage_user@sage_portal
copy private key of sage_user@sage_portal into $gb/conf/sage_key

Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

This is a key design part. I agree with your design as a quick implementation.

But it has a security hazard -- if an op user can access the key, he/she can run anything as sage. Hence, please consider the 'gladsage' solution I wrote about when you have time to refine the solution.


RE: Service management of Sage - YU_Xinjie - 09-07-2016 04:11 PM

(09-07-2016 03:53 PM)lingu Wrote:  It seems to be quite complex. Do we need to really pay that complexity? If so, please let me know and I'll review the design in detail.

The code I post is actually the script I develop for shbio. It works well for more than one week.
It is complex but robust.

I hope you can check it, so that I can put it into our glad/sage code tree.
You do not need to check every options of every command, because they work. But you'd better check the brief method. In brief, they are just a remote cmd wrapper for the start.sh/stop.sh/status.sh, except the function wait_sage_start, which uses auntie to check sage.

(09-07-2016 03:55 PM)lingu Wrote:  We still need to handle race condition for running multiple sage thinkers. But I think thinkers already have such conflict reporting capability. We just need to track the return status of start.sh and report an error as well as stop glad when errors occur.

If start.sh does not report the return status correctly, we need to perhaps improve start.sh.

Good point. I will check it.

(09-07-2016 03:58 PM)lingu Wrote:  
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  The brief idea is to use auntie to send a file to glad_portal. Then check the file content.

Directly running auntie without argumets can already check if sage is present.

It does not work. I already use the latest auntie. I report it in this thread: http://tab.d-thinker.org/showthread.php?tid=6506


RE: Service management of Sage - lingu - 09-07-2016 05:06 PM

(09-07-2016 04:11 PM)YU_Xinjie Wrote:  
(09-07-2016 03:53 PM)lingu Wrote:  It seems to be quite complex. Do we need to really pay that complexity? If so, please let me know and I'll review the design in detail.

The code I post is actually the script I develop for shbio. It works well for more than one week.
It is complex but robust.

I hope you can check it, so that I can put it into our glad/sage code tree.
You do not need to check every options of every command, because they work. But you'd better check the brief method. In brief, they are just a remote cmd wrapper for the start.sh/stop.sh/status.sh, except the function wait_sage_start, which uses auntie to check sage.

I will review. But this is TERRIBLE practice. Please make sure to get endorsement from another engineer before starting to implement an important function. If you ask me to review but I don't respond, please remind me for an important review.

If you need to spend half a day to implement some code, you should be prudent in writing the code directly. Instead, invite reviews. We may find a way to solve the problem in 2 hours.

If there is no response after reminders, you may decide to go ahead with implementing an important piece of code.

If it takes only 30min to implement something, you can go ahead and implement it without endorsement if you don't want to wait. If the change is insignificant, you may also skip the review.

It is generally not practical to define what is "important" or "significant". We rely on engineers' judgement.

This one -- how to start/stop sage and make it work with glad -- is certainly an important piece of design.


RE: Service management of Sage - YU_Xinjie - 09-07-2016 05:18 PM

(09-07-2016 05:06 PM)lingu Wrote:  I will review. But this is TERRIBLE practice. Please make sure to get endorsement from another engineer before starting to implement an important function. If you ask me to review but I don't respond, please remind me for an important review.

If you need to spend half a day to implement some code, you should be prudent in writing the code directly. Instead, invite reviews. We may find a way to solve the problem in 2 hours.

If there is no response after reminders, you may decide to go ahead with implementing an important piece of code.

If it takes only 30min to implement something, you can go ahead and implement it without endorsement if you don't want to wait. If the change is insignificant, you may also skip the review.

It is generally not practical to define what is "important" or "significant". We rely on engineers' judgement.

This one -- how to start/stop sage and make it work with glad -- is certainly an important piece of design.

Okay. I agree these rules. Will follow them.


RE: Service management of Sage - lingu - 09-07-2016 05:35 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  goal

1. the script can be used in both sage_portal & glad_portal to start/stop/status sage.
2. user can start sage before glad, and stop sage after glad.

Sage needs to be started automatically by glad for a batch of samples (dataflows).

It is okay to have a user manually start it at present. But this is not the way we want for the future. It adds a human operation. An extra human operation makes the software a bit less easy to use, and a whole lot easier to make a mistake.

So, when designing, you can make compromises now, but keep in mind what we want in the long run.

Quote:The script would replace the current start.sh/stop.sh/status.sh in the future.
The script may inspire us about how to set up regression tests for sage.

This is good thinking -- using one way, not two ways, to do one task.

Quote:[quote]
For shbio's project, I have already written a script /thinker/dstore/run/sage to support a part of the goal. I would try to generalize it.

config design

The brief idea is to use auntie to send a file to glad_portal. Then check the file content.

This is too heavyweight -- it may even disrupt Sage if it is busy.

Sending a file takes 2-3s. This is considered long/heavyweight.

OK to keep the current design if it has worked. But please be aware of latency in a pathetic way -- otherwise our software would be as slow as Hadoop in 2 years.

Quote:1.
require sage_user can password-less login sage_user@sage_portal

This is fine if all are sage_user.

Quote:copy private key of sage_user@sage_portal into $gb/conf/sage_key

$gb is owned by glad_user and all operative users can access it. So this is a security vulnerability. OK now. But make a TODO to fix it later.

Quote:Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

2. The glad_portal IP can be get from $gb/conf/config.sh

How (a convar like glad_portal?) Have we made sure such a varaible must exist in $gb/conf/config.sh. If not, please add a note there "need implement" so that we know to create a TODO item and implement this later after this design is endorsed.

Quote:3.
create a config file $gb/conf/sage_portal_ip to record the IP of sage_portal. Or we can also write it into $gb/conf/config.sh.

I prefer to create a convar like glad_sage_user and store it in $gb/conf/config.sh

Quote:4. let sage_user@sage_portal can password-less login glad_user@glad_portal.

That's fine -- we assume sage_user is no a human operator and can be a powerful guy.

Quote:start sage

Code:
remote_cmd () {
ssh -q -o StrictHostKeyChecking=no -i $gb/conf/sage_key $sage_user@$sage_portal "$1"
}
[/quote]

Don't have to specify this -- everybody can find a way to run a remote program without being tremendously wrong. So it's not a key design detail.

We require engineers use psudocode to write down the design if it involves some logic. But code is not appropriate psudocode.

[quote]
wait_sage_start () {
content="This is test content."
echo $content > $curdir/${USER}_sage_testfile
test_file=/thinker/bin/ephemeral/667.sagetest

# two minutes timeout
try_cnt=40
while [[ ("$try_cnt" -gt "0") && ((! -f "$test_file") || ("$(cat $test_file)" != "$content")) ]]; do
  timeout -s SIGINT 1 bash -c "sage_user=$sage_user $curdir/auntie ^$curdir/${USER}_sage_testfile $glad_portal 667 sagetest" || echo -n ''
  echo "Trying to start Sage..."
  sleep 2
  try_cnt=$((try_cnt-1))
done
rm -f $test_file
}
[/quote]

Too long wait. If it does not work in 30 sec, report an error and stop.

[quote]
start_sage () {
# check whether sage is really stopped.
local tmp="$(status_sage)"
if [[ "$tmp" != "Sage is stopped." ]]; then
  echo "Sage is already started."
  echo ""
  echo "Status: "
  echo "$tmp"
  return 0
fi

remote_cmd "screen -dmS sage_service bash -c 'cd ~/sage; ./start.sh'"
wait_sage_start
echo "Sage is started."
}

What if the wait_sage_start fails?

We need a way to check Sage has started. I thought this is what I thought you were doing. But it looks like here if auntie continues to fail the wait still completes without an error halt.

Quote:stop sage

Code:
stop_sage () {
# stop sage
remote_cmd "cd ~/sage; ./stop.sh" > /dev/null

# kill all sage_service screens
remote_cmd "
for session in \$(screen -ls | grep 'sage_service' | grep -o '[0-9]\+\.' | grep -o '[0-9]\+')
do
    screen -S \${session} -p 0 -X quit
done
"
[/quote]

Looks good.

[quote]
# check whether sage is really stopped.
local tmp="$(status_sage)"
if [[ "$tmp" == "Sage is stopped." ]]; then
  echo "Sage is stopped."
else
  echo "Sage failed to stop."
  echo ""
  echo "Status: "
  echo "$tmp"
fi
}

OK.

Quote:status sage

Code:
status_sage () {
local output="$(remote_cmd "cd ~/sage; ./status.sh")"
if [[ "$output" == "Sage is stopped." ]]; then
  echo "Sage is stopped."
else
  echo "$output"
fi
}

OK. In the future, we should consider using autnie to directly query Sage to get the status.


RE: Service management of Sage - YU_Xinjie - 09-07-2016 05:53 PM

(09-07-2016 05:35 PM)lingu Wrote:  This is too heavyweight -- it may even disrupt Sage if it is busy.

Sending a file takes 2-3s. This is considered long/heavyweight.

I ever tested to send a small file from s188 to s188. It only costs 0m0.009s. I think it is good enough.

Quote:
Quote:Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

2. The glad_portal IP can be get from $gb/conf/config.sh

How (a convar like glad_portal?) Have we made sure such a varaible must exist in $gb/conf/config.sh. If not, please add a note there "need implement" so that we know to create a TODO item and implement this later after this design is endorsed.

We already have a $glad_portal that can be used directly. It is set by util/install.sh during installing.

Quote:What if the wait_sage_start fails?

We need a way to check Sage has started. I thought this is what I thought you were doing. But it looks like here if auntie continues to fail the wait still completes without an error halt.

This is a bug. I will fix it.


RE: Service management of Sage - lingu - 09-07-2016 06:18 PM

(09-07-2016 05:53 PM)YU_Xinjie Wrote:  
(09-07-2016 05:35 PM)lingu Wrote:  This is too heavyweight -- it may even disrupt Sage if it is busy.

Sending a file takes 2-3s. This is considered long/heavyweight.

I ever tested to send a small file from s188 to s188. It only costs 0m0.009s. I think it is good enough.

The auntie command may complete in 0.009s, but the transfer should take longer because I added a 1s wait somewhere. Maybe it is not in the critical path...

Anyway, it is okay to keep it this way for a while.

Quote:We already have a $glad_portal that can be used directly. It is set by util/install.sh during installing.

OK. Then it's fine.

Quote:
Quote:What if the wait_sage_start fails?

We need a way to check Sage has started. I thought this is what I thought you were doing. But it looks like here if auntie continues to fail the wait still completes without an error halt.

This is a bug. I will fix it.

Please revise the design of this part first as a reply then I can reply to endorse the overall design.

The real "fix" should be after the design is endorsed.


RE: Service management of Sage - YU_Xinjie - 09-07-2016 06:37 PM

(09-07-2016 06:18 PM)lingu Wrote:  Please revise the design of this part first as a reply then I can reply to endorse the overall design.

The real "fix" should be after the design is endorsed.

Updated the code of "start sage" in the headpost.

Please take a look again.


RE: Service management of Sage - lingu - 09-07-2016 06:52 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  goal

1. the script can be used in both sage_portal & glad_portal to start/stop/status sage.
2. user can start sage before glad, and stop sage after glad.

The script would replace the current start.sh/stop.sh/status.sh in the future.
The script may inspire us about how to set up regression tests for sage.

For shbio's project, I have already written a script /thinker/dstore/run/sage to support a part of the goal. I would try to generalize it.

config design

The brief idea is to use auntie to send a file to glad_portal. Then check the file content.

1.
require sage_user can password-less login sage_user@sage_portal
copy private key of sage_user@sage_portal into $gb/conf/sage_key

Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

2. The glad_portal IP can be get from $gb/conf/config.sh

3.
create a config file $gb/conf/sage_portal_ip to record the IP of sage_portal. Or we can also write it into $gb/conf/config.sh.

4. let sage_user@sage_portal can password-less login glad_user@glad_portal.

start sage

Code:
wait_sage_start () {
content="This is test content."
echo $content > $curdir/${USER}_sage_testfile
test_file=/thinker/bin/ephemeral/667.sagetest

# 30 seconds timeout
try_cnt=10
while [[ ("$try_cnt" -gt "0") && ((! -f "$test_file") || ("$(cat $test_file)" != "$content")) ]]; do
  timeout -s SIGINT 1 bash -c "sage_user=$sage_user $curdir/auntie ^$curdir/${USER}_sage_testfile $glad_portal 667 sagetest" || echo -n ''
  echo "Trying to start Sage..."
  sleep 2
  try_cnt=$((try_cnt-1))
done
rm -f $test_file

if [[ "$try_cnt" == "0" ]];then
  # timeout
  return 1
else
  return 0
fi
}

start_sage () {
# check whether sage is really stopped.
local tmp="$(status_sage)"
if [[ "$tmp" != "Sage is stopped." ]]; then
  echo "Sage is already started."
  echo ""
  echo "Status: "
  echo "$tmp"
  return 0
fi

remote_cmd "screen -dmS sage_service bash -c 'cd ~/sage; ./start.sh'"

local rt="succ"
wait_sage_start || rt="fail"
if [[ "$rt" == "succ" ]]; then
  echo "Sage is started."
else
  echo "Sage fails to start."
fi
}

stop sage

Code:
stop_sage () {
# stop sage
remote_cmd "cd ~/sage; ./stop.sh" > /dev/null

# kill all sage_service screens
remote_cmd "
for session in \$(screen -ls | grep 'sage_service' | grep -o '[0-9]\+\.' | grep -o '[0-9]\+')
do
    screen -S \${session} -p 0 -X quit
done
"

# check whether sage is really stopped.
local tmp="$(status_sage)"
if [[ "$tmp" == "Sage is stopped." ]]; then
  echo "Sage is stopped."
else
  echo "Sage failed to stop."
  echo ""
  echo "Status: "
  echo "$tmp"
fi
}

status sage

Code:
status_sage () {
local output="$(remote_cmd "cd ~/sage; ./status.sh")"
if [[ "$output" == "Sage is stopped." ]]; then
  echo "Sage is stopped."
else
  echo "$output"
fi
}

OK.


RE: Service management of Sage - lingu - 09-07-2016 06:53 PM

(09-07-2016 06:37 PM)YU_Xinjie Wrote:  
(09-07-2016 06:18 PM)lingu Wrote:  Please revise the design of this part first as a reply then I can reply to endorse the overall design.

The real "fix" should be after the design is endorsed.

Updated the code of "start sage" in the headpost.

Please take a look again.

Okayed the design.

But you ignored my word "as a reply". Pls make sure to execute precisely.


RE: Service management of Sage - YU_Xinjie - 09-08-2016 04:28 PM

(09-07-2016 05:35 PM)lingu Wrote:  
Quote:wait_sage_start () {
content="This is test content."
echo $content > $curdir/${USER}_sage_testfile
test_file=/thinker/bin/ephemeral/667.sagetest

# two minutes timeout
try_cnt=40
while [[ ("$try_cnt" -gt "0") && ((! -f "$test_file") || ("$(cat $test_file)" != "$content")) ]]; do
timeout -s SIGINT 1 bash -c "sage_user=$sage_user $curdir/auntie ^$curdir/${USER}_sage_testfile $glad_portal 667 sagetest" || echo -n ''
echo "Trying to start Sage..."
sleep 2
try_cnt=$((try_cnt-1))
done
rm -f $test_file
}

Too long wait. If it does not work in 30 sec, report an error and stop.

1. While implementing, I find "sage start" cost 21 seconds on average in my dev cluster. The perf of my dev cluster is not well since they are VMs.
Sometimes it would cost more than 30 seconds. Then the sage is actually started but my script reports failed.

Therefore I suggest we still use 2 minutes timeout here.

2. The sleep time is 2 seconds after each trial fails.
But I find even though auntie command is finish quickly if it succeeds, the received file content will exist after 2~3 seconds. So even though auntie sends file successfully, another auntie trial would be triggered. If it is triggered, script would print a ERROR info to confuse user but finally the Sage & service scripts would still succeed.

Therefore I suggest we use "sleep 4" after each trial fails. Then the confusing ERROR info would not appear frequently.

I will implement above change before your review, since I think they are minor change.


RE: Service management of Sage - YU_Xinjie - 09-08-2016 04:48 PM

For the private key, I encounter an issue:

SSH command would check the premission of private key. If the key can readable by others, SSH would just ignore the key. One method to skip the check is to set the owner of key to be a user that would never use the key. For example:
Code:
[0][15:40:42] xinjie@devmac0e0:/thinker/dstore/gene/glad/conf
$ ll sage_key
-rw-r--r--. 1 dstore dstore 1679 Sep  8 14:57 sage_key
I set the owner to be dstore. Then user gene, sage, xinjie can use the key to access sage_portal. Only user dstore can not do that.


RE: Service management of Sage - YU_Xinjie - 09-08-2016 06:41 PM

Committed in df99edcb4f9ae617c098714f8036393fbdf8e413 .


RE: Service management of Sage - lingu - 09-15-2016 12:34 AM

(09-08-2016 04:48 PM)YU_Xinjie Wrote:  For the private key, I encounter an issue:

SSH command would check the premission of private key. If the key can readable by others, SSH would just ignore the key. One method to skip the check is to set the owner of key to be a user that would never use the key. For example:
Code:
[0][15:40:42] xinjie@devmac0e0:/thinker/dstore/gene/glad/conf
$ ll sage_key
-rw-r--r--. 1 dstore dstore 1679 Sep  8 14:57 sage_key
I set the owner to be dstore. Then user gene, sage, xinjie can use the key to access sage_portal. Only user dstore can not do that.

If the user is not the owner but can read the file and other users can read the key file, too, why does SSH allow the user to use the key? This seems to be a bug in SSH.

Is the behavior dependable? If the current behavior is not well defined, we may not want to rely on it although it works now. In the future, if the behavior changes, our programs will break.

Can we use multiple key files of the same content, i.e., key-sage, key-xinjie, ..., so that the key file's access can be restricted to that particular user?

In general, avoid hacks unless there is no other way out. Keep things simple stupid. Hacks are fun, but it's not dependable. It's like sleeping a drunk girl -- if anything lasted after the fun through the next sunrise it would be some mess of drying sperm mixed with vomits. That's not beauty of life.


RE: Service management of Sage - lingu - 09-15-2016 12:49 AM

(09-07-2016 05:35 PM)lingu Wrote:  
Quote:1.
require sage_user can password-less login sage_user@sage_portal

This is fine if all are sage_user.

Quote:copy private key of sage_user@sage_portal into $gb/conf/sage_key

$gb is owned by glad_user and all operative users can access it. So this is a security vulnerability. OK now. But make a TODO to fix it later.

I think I may not have really understood what we are doing here. Are we trying to let glad_user ssh to sage_user@sage_portal? Or are we trying to let sage_user ssh back to sage_user@sage_portal?

For the latter, we can perhaps let all sage_user have the same key on all nodes? But the keys may not be stored in $gb.

For the former, we should perhaps add glad_user's pub key to sage_user@portal's authorized_keys during the installation of glad?


RE: Service management of Sage - YU_Xinjie - 09-18-2016 03:59 PM

(09-15-2016 12:34 AM)lingu Wrote:  
(09-08-2016 04:48 PM)YU_Xinjie Wrote:  For the private key, I encounter an issue:

SSH command would check the premission of private key. If the key can readable by others, SSH would just ignore the key. One method to skip the check is to set the owner of key to be a user that would never use the key. For example:
Code:
[0][15:40:42] xinjie@devmac0e0:/thinker/dstore/gene/glad/conf
$ ll sage_key
-rw-r--r--. 1 dstore dstore 1679 Sep  8 14:57 sage_key
I set the owner to be dstore. Then user gene, sage, xinjie can use the key to access sage_portal. Only user dstore can not do that.

If the user is not the owner but can read the file and other users can read the key file, too, why does SSH allow the user to use the key? This seems to be a bug in SSH.

Is the behavior dependable? If the current behavior is not well defined, we may not want to rely on it although it works now. In the future, if the behavior changes, our programs will break.

Can we use multiple key files of the same content, i.e., key-sage, key-xinjie, ..., so that the key file's access can be restricted to that particular user?

In general, avoid hacks unless there is no other way out. Keep things simple stupid. Hacks are fun, but it's not dependable. It's like sleeping a drunk girl -- if anything lasted after the fun through the next sunrise it would be some mess of drying sperm mixed with vomits. That's not beauty of life.

Looks good to me. I replied in http://rar.shufangkeji.com:60380/showthread.php?tid=4652&pid=12582#pid12582

(09-15-2016 12:49 AM)lingu Wrote:  
(09-07-2016 05:35 PM)lingu Wrote:  
Quote:1.
require sage_user can password-less login sage_user@sage_portal

This is fine if all are sage_user.

Quote:copy private key of sage_user@sage_portal into $gb/conf/sage_key

$gb is owned by glad_user and all operative users can access it. So this is a security vulnerability. OK now. But make a TODO to fix it later.

I think I may not have really understood what we are doing here. Are we trying to let glad_user ssh to sage_user@sage_portal? Or are we trying to let sage_user ssh back to sage_user@sage_portal?

For the latter, we can perhaps let all sage_user have the same key on all nodes? But the keys may not be stored in $gb.

For the former, we should perhaps add glad_user's pub key to sage_user@portal's authorized_keys during the installation of glad?

Neither.

The glad operative users & sage_user need to ssh to sage_user@portal, in "sage" script.


RE: Service management of Sage - lingu - 09-23-2016 10:41 PM

(09-18-2016 03:59 PM)YU_Xinjie Wrote:  Neither.

The glad operative users & sage_user need to ssh to sage_user@portal, in "sage" script.

What function needs this? Where is the designer's info? We should review it.

sage_user is an advanced user with quite some high access rights.


RE: Service management of Sage - YU_Xinjie - 09-27-2016 11:33 AM

(09-23-2016 10:41 PM)lingu Wrote:  What function needs this? Where is the designer's info? We should review it.

It is the original design in the headpost, which you already endorse it.

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

It is needed by the goal:

Quote:1. the script can be used in both sage_portal & glad_portal to start/stop/status sage.
2. user can start sage before glad, and stop sage after glad.



RE: Service management of Sage - lingu - 09-27-2016 12:35 PM

(09-27-2016 11:33 AM)YU_Xinjie Wrote:  
(09-23-2016 10:41 PM)lingu Wrote:  What function needs this? Where is the designer's info? We should review it.

It is the original design in the headpost, which you already endorse it.

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

It is needed by the goal:

Quote:1. the script can be used in both sage_portal & glad_portal to start/stop/status sage.
2. user can start sage before glad, and stop sage after glad.

The headpost does not say that the operative user (opuser) needs keys to impersonate sage_user@sage_portal to start/stop Sage. There is a logical glitch that prevents me from linking them together in a hurry reading.

Typically I tend to endorse matters if I see no obvious issues :-) Sometimes I miss some points.

Here it is okay to let opuser or glad_user impersonate sage_user as a temporary solution.


RE: Service management of Sage - YU_Xinjie - 09-27-2016 05:16 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  goal

1. the script can be used in both sage_portal & glad_portal to start/stop/status sage.
2. user can start sage before glad, and stop sage after glad.

The script would replace the current start.sh/stop.sh/status.sh in the future.
The script may inspire us about how to set up regression tests for sage.

For shbio's project, I have already written a script /thinker/dstore/run/sage to support a part of the goal. I would try to generalize it.

config design

The brief idea is to use auntie to send a file to glad_portal. Then check the file content.

1.
require sage_user can password-less login sage_user@sage_portal
copy private key of sage_user@sage_portal into $gb/conf/sage_key

But SSH command would check the premission of private key. If the key can readable by others, SSH would just ignore the key. One method to skip the check is to set the owner of key to be a user that would never use the key. For example:
Code:
[0][15:40:42] xinjie@devmac0e0:/thinker/dstore/gene/glad/conf
$ ll sage_key
-rw-r--r--. 1 dstore dstore 1679 Sep  8 14:57 sage_key
I set the owner to be dstore. Then user gene, sage, xinjie can use the key to access sage_portal. Only user dstore can not do that.

Then glad operative user & sage_user can use sage_key to execute remote command to sage_user@sage_portal.

2. The glad_portal IP can be get from $gb/conf/config.sh

3.
create a config file $gb/conf/sage_portal_ip to record the IP of sage_portal. Or we can also write it into $gb/conf/config.sh.

4. let sage_user@sage_portal can password-less login glad_user@glad_portal.

start sage

Code:
wait_sage_start () {
content="This is test content."
echo $content > $curdir/${USER}_sage_testfile
test_file=/thinker/bin/ephemeral/667.sagetest

# 30 seconds timeout
try_cnt=10
while [[ ("$try_cnt" -gt "0") && ((! -f "$test_file") || ("$(cat $test_file)" != "$content")) ]]; do
  timeout -s SIGINT 1 bash -c "sage_user=$sage_user $curdir/auntie ^$curdir/${USER}_sage_testfile $glad_portal 667 sagetest" || echo -n ''
  echo "Trying to start Sage..."
  sleep 2
  try_cnt=$((try_cnt-1))
done
rm -f $test_file

if [[ "$try_cnt" == "0" ]];then
  # timeout
  return 1
else
  return 0
fi
}

start_sage () {
# check whether sage is really stopped.
local tmp="$(status_sage)"
if [[ "$tmp" != "Sage is stopped." ]]; then
  echo "Sage is already started."
  echo ""
  echo "Status: "
  echo "$tmp"
  return 0
fi

remote_cmd "screen -dmS sage_service bash -c 'cd ~/sage; ./start.sh'"

local rt="succ"
wait_sage_start || rt="fail"
if [[ "$rt" == "succ" ]]; then
  echo "Sage is started."
else
  echo "Sage fails to start."
fi
}

stop sage

Code:
stop_sage () {
# stop sage
remote_cmd "cd ~/sage; ./stop.sh" > /dev/null

# kill all sage_service screens
remote_cmd "
for session in \$(screen -ls | grep 'sage_service' | grep -o '[0-9]\+\.' | grep -o '[0-9]\+')
do
    screen -S \${session} -p 0 -X quit
done
"

# check whether sage is really stopped.
local tmp="$(status_sage)"
if [[ "$tmp" == "Sage is stopped." ]]; then
  echo "Sage is stopped."
else
  echo "Sage failed to stop."
  echo ""
  echo "Status: "
  echo "$tmp"
fi
}

status sage

Code:
status_sage () {
local output="$(remote_cmd "cd ~/sage; ./status.sh")"
if [[ "$output" == "Sage is stopped." ]]; then
  echo "Sage is stopped."
else
  echo "$output"
fi
}

Save a copy before changing.


RE: Service management of Sage - YU_Xinjie - 09-27-2016 05:34 PM

Updated sage service script, so that it is decoupled with glad.


RE: Service management of Sage - OMUD - YU_Xinjie - 10-19-2016 06:37 PM

Updated the design of "sage status". Added the design of "sage ps".


RE: Service management of Sage - OMUD - lingu - 10-22-2016 10:18 PM

(10-19-2016 06:37 PM)YU_Xinjie Wrote:  Updated the design of "sage status". Added the design of "sage ps".

What is the semantics of 'sage status' or auntie? Please specify. For example, it can be 'exit status 0 meaning success and otherwise failure'. Although simple, it needs to be specified for this info to be professionally engineered.


RE: Service management of Sage - OMUD - YU_Xinjie - 12-06-2016 12:32 PM

I suggest we add a "sage config VAR_NAME" command, so that app of Sage (such as GLAD) can query the config value easily.

It is needed for many situations:
1. We need to use "atp_cnt" to set up glad_size of GLAD.
2. GLAD needs the config.node info.

@lingu

Please endorse.


RE: Service management of Sage - OMUD - lingu - 12-06-2016 01:35 PM

(12-06-2016 12:32 PM)YU_Xinjie Wrote:  I suggest we add a "sage config VAR_NAME" command, so that app of Sage (such as GLAD) can query the config value easily.

We already have a way to let Sage store and report k/vs. Why can't we use the existing way?

Quote:It is needed for many situations:
1. We need to use "atp_cnt" to set up glad_size of GLAD.

Where do we need to use glad_size? I am curious to know.

Quote:2. GLAD needs the config.node info.

In which case?

We should discuss over a concrete example.


RE: Service management of Sage - OMUD - YU_Xinjie - 12-06-2016 03:32 PM

(12-06-2016 01:35 PM)lingu Wrote:  
(12-06-2016 12:32 PM)YU_Xinjie Wrote:  I suggest we add a "sage config VAR_NAME" command, so that app of Sage (such as GLAD) can query the config value easily.

We already have a way to let Sage store and report k/vs. Why can't we use the existing way?

Do you mean "query Sage"? I am okay to use it. But I still do not know how to use it. Let us discuss it here: http://tab.d-thinker.org/showthread.php?tid=6433&pid=30046#pid30046

Quote:
Quote:It is needed for many situations:
1. We need to use "atp_cnt" to set up glad_size of GLAD.

Where do we need to use glad_size? I am curious to know.

I replied in http://tab.d-thinker.org/showthread.php?tid=6433&pid=30046#pid30046

Quote:
Quote:2. GLAD needs the config.node info.

In which case?

It is needed in the shuffle tmp implementation. It is okay to delay the config.node info fetching.


RE: Service management of Sage - OMUD - lingu - 12-26-2016 08:46 PM

(12-06-2016 03:32 PM)YU_Xinjie Wrote:  
(12-06-2016 01:35 PM)lingu Wrote:  
(12-06-2016 12:32 PM)YU_Xinjie Wrote:  I suggest we add a "sage config VAR_NAME" command, so that app of Sage (such as GLAD) can query the config value easily.

We already have a way to let Sage store and report k/vs. Why can't we use the existing way?

Do you mean "query Sage"? I am okay to use it. But I still do not know how to use it. Let us discuss it here: http://tab.d-thinker.org/showthread.php?tid=6433&pid=30046#pid30046

glad can query sage config's values. We can use the same mechanism to let other apps query sage config values.

Or maybe I misunderstood. Did you mean we let an app store the app's config value in sage? That's certainly a good idea. Of course, we need to discuss it more seriously because it is a new mechanism.

Quote:
Quote:
Quote:2. GLAD needs the config.node info.

In which case?

It is needed in the shuffle tmp implementation. It is okay to delay the config.node info fetching.

It is a bit surprising to me. I will try to take a look at the shuffle design when there is a chance...


RE: Service management of Sage - OMUD - lingu - 12-26-2016 08:50 PM

Is the users' info officially in http://tab.d-thinker.org/showthread.php?tid=6197 ?

I suggest we remove 'U' in the tag in the title and point to that thread in the overview for the users' info.


RE: Service management of Sage - OMUD - lingu - 01-12-2017 06:55 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  Users' info

http://tab.d-thinker.org/showthread.php?tid=5694

That links to OMUD info... seems strange.


RE: Service management of Sage - OMUD - YU_Xinjie - 01-12-2017 07:05 PM

(01-12-2017 06:55 PM)lingu Wrote:  
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  Users' info

http://tab.d-thinker.org/showthread.php?tid=5694

That links to OMUD info... seems strange.

Yes. The reason is we have 2 types of readers:
1. hututa persons like Zhiqiang.
2. shufangkeji persons like you & me.

So we need to prepare 2 overview threads for them.
Essentially, the overview in Rar is the one have full info.
So I propose not to have 2 overview threads by the method in http://tab.d-thinker.org/showthread.php?tid=5694&pid=31325#pid31325


RE: Service management of Sage - OD - YU_Xinjie - 06-02-2017 06:24 PM

@lingu Please review.

The driving example: http://tab.d-thinker.org/showthread.php?tid=8362&pid=41989#pid41989
We needs to let sage complains to mayday when sage fails.

The design is as follows:
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage start

Start a sage_screen to run script start_sage.
start_sage script looks like this:
Quote:...

do_start() {
./detect_listen.sh &
make run, which would calls `dt run sage-svc $sage_base/config.pcf`
if return non-0 {
.. mayday_msg = "SAGE FATAL EXIT. "
.. check the stdout log of Sage. If it is because one of the task failure {
.... find the container (DT) log of this task
.... mayday_msg += fetch the task command line from the container log
.. }

.. #Do some clean work
.. kill (clean) the screen session of "sage wake"
.. kill (clean) the screen session of "sage start", namely the current session.
}

}
...



RE: Service management of Sage - OD - lingu - 02-02-2018 04:57 PM

(06-02-2017 06:24 PM)YU_Xinjie Wrote:  @lingu Please review.

The driving example: http://tab.d-thinker.org/showthread.php?tid=8362&pid=41989#pid41989
We needs to let sage complains to mayday when sage fails.

The design is as follows:
[quote='YU_Xinjie' pid='11533' dateline='1468313653']
sage start

Start a sage_screen to run script start_sage.
start_sage script looks like this:
Quote:...

do_start() {
./detect_listen.sh &
make run, which would calls `dt run sage-svc $sage_base/config.pcf`
if return non-0 {
.. mayday_msg = "SAGE FATAL EXIT. "

It is okay to write a mayday log message on this case.

[quote]
.. check the stdout log of Sage. If it is because one of the task failure {
.... find the container (DT) log of this task
.... mayday_msg += fetch the task command line from the container log
.. }

But don't parse stdout log. I wonder why we dont have a simpler way.

The idea of mayday log is to simplfy log examination. If a task fails, the task should write something in the mayday log. Then the calling routine's job is to just output mayday log. This avoids parsing think containers' log files.

If think containers dont write mayday log now, we should improve them so that they write mayday log files. If we try to let another program help them write mayday log files, that would be a painful complicated solution.

Quote:.. #Do some clean work
.. kill (clean) the screen session of "sage wake"
.. kill (clean) the screen session of "sage start", namely the current session.
}[/u]
}
...


In many cases, we want to keep those screens for debugging. Pls make the killing of the screens controllable by some options. The default behavior can be to kill the screens, but with some options we should be able to keep the screens upon failure.

Those two screens seem to have the same name. It is very confusing. Pls fix it.


RE: Service management of Sage - D - lingu - 05-08-2019 09:55 PM

The src of the sage program is in cod://sage/src/service/bin/sage


RE: Service management of Sage - D - lingu - 05-08-2019 10:01 PM

The sage program begins with the following logic.

Code:
base=current dir
LearnPcf $base/config.pcf
ips=$base/hosts.ips

I suggest we also learn /thinker/etc/soft/sage/mic.pcf but $base/config.pcf take precedence over /thinker/etc/soft/sage/mic.pcf

RR xwcwt


RE: Service management of Sage - D - xwcwt - 05-09-2019 10:37 AM

(05-08-2019 10:01 PM)lingu Wrote:  The sage program begins with the following logic.

Code:
base=current dir
LearnPcf $base/config.pcf
ips=$base/hosts.ips

I suggest we also learn /thinker/etc/soft/sage/mic.pcf but $base/config.pcf take precedence over /thinker/etc/soft/sage/mic.pcf

RR xwcwt

Good to me.

Also I feel it will be

Code:
modname = sage
LearnPcf /thinker/etc/soft/$modname/mic.pcf before LearnPcf $base/config.pcf

Update into head-post.


RE: Service management of Sage - D - lingu - 05-09-2019 06:39 PM

(05-09-2019 10:37 AM)xwcwt Wrote:  Also I feel it will be

Code:
modname = sage
LearnPcf /thinker/etc/soft/$modname/mic.pcf before LearnPcf $base/config.pcf

Update into head-post.

My impression is that the pcf reading does not override earlier values. Because config.pcf has precedence, we should learn config.pcf first, then mic.pcf.


RE: Service management of Sage - D - lingu - 05-09-2019 06:42 PM

(05-09-2019 10:37 AM)xwcwt Wrote:  
(05-08-2019 10:01 PM)lingu Wrote:  The sage program begins with the following logic.

Code:
base=current dir
LearnPcf $base/config.pcf
ips=$base/hosts.ips

I suggest we also learn /thinker/etc/soft/sage/mic.pcf but $base/config.pcf take precedence over /thinker/etc/soft/sage/mic.pcf

RR xwcwt

Good to me.

Also I feel it will be

Code:
modname = sage
LearnPcf /thinker/etc/soft/$modname/mic.pcf before LearnPcf $base/config.pcf

Update into head-post.

I guess you added 'Common var input' in the headpost. I think it is too narrow and, if we use such narrorw section topics, the info ortanization would have 20 pieces of pseudocode. I am changing it to 'sage main logic' so that we can add the overall logic of the sage program to it.


RE: Service management of Sage - D - lingu - 05-09-2019 06:52 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage main logiccommon var import
Code:
modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips

also, avoid such hard clash of blocks, such as a title followed by a title, a title followed by a code segment, a code segment followed by a code segment, ...
Add text between titles and other blocks of content.

The sage logic also performs the following and I'll add them to the pseudocode.
Code:
set timeout
parse options
run command
  start
  status
  ps
  tasks
  help



RE: Service management of Sage - D - lingu - 05-09-2019 07:09 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage main logiccommon var import

modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips
set timeout to be half of the number of IPs

Driver: The IP counting is based on 'wc -l $ips'. But $ips may not exist on non-portal.

I suggest we use a plain number 3 if $ips does not exist.

RR xwcwt


RE: Service management of Sage - D - xwcwt - 05-09-2019 07:12 PM

(05-09-2019 07:09 PM)lingu Wrote:  
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage main logiccommon var import

modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips
set timeout to be half of the number of IPs

Driver: The IP counting is based on 'wc -l $ips'. But $ips may not exist on non-portal.

I suggest we use a plain number 3 if $ips does not exist.

RR xwcwt

Good to me.


RE: Service management of Sage - D - lingu - 05-10-2019 07:41 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
cat $sage_base/stdout/tasks_graph.tmp.<timestamp>.

The logic is actually more involved than that. I will outline the logic as follows.
Code:
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
  while True {
    cnt = count ${tasks_graph_file}*;
    sleep 5 if cnt>1 || cnt==0;
    otherwise break;
  }
  check timestamp;
  cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
  update timestamp;
}



RE: Service management of Sage - D - lingu - 05-10-2019 07:46 PM

driver: we used to rely on a sage awake screen to collect sage tasks result, but that screen runs only on sage_portal. Now we allow non-sage_portal to interact with sage. So we should run 'auntie' to wake up sage before collecting the sage tasks result.

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
sage tasks invokes function tasks_sage():
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
while True {

Proposal: add 'auntie' here

Quote: cnt = count ${tasks_graph_file}*;
sleep 5 if cnt>1 || cnt==0;
otherwise break;
}
check timestamp;
cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
update timestamp;
}
[/code]

RR xwcwt


RE: Service management of Sage - D - lingu - 05-10-2019 07:56 PM

Driver: Sage configuration can be quite complex. It is often convenient to evaluate a var in Sage either on command line or in a program. GLAD has a command 'gladinfo var' or 'glad info var' to read the value of a variable var. But Sage does not have it.

Proposal: add a command 'info' like the 'info' command in glad, an let 'sage info var' report the value of var.

RR zheny


RE: Service management of Sage - D - xwcwt - 05-11-2019 10:14 AM

(05-10-2019 07:46 PM)lingu Wrote:  driver: we used to rely on a sage awake screen to collect sage tasks result, but that screen runs only on sage_portal. Now we allow non-sage_portal to interact with sage. So we should run 'auntie' to wake up sage before collecting the sage tasks result.

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
sage tasks invokes function tasks_sage():
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
while True {

Proposal: add 'auntie' here

Quote: cnt = count ${tasks_graph_file}*;
sleep 5 if cnt>1 || cnt==0;
otherwise break;
}
check timestamp;
cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
update timestamp;
}
[/code]

RR xwcwt

The idea is Good to me. Also I think the auntie call should add before check timestamp. Update first.


RE: Service management of Sage - D - lingu - 11-23-2019 11:30 PM

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
sage tasks invokes function tasks_sage():
Code:
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
  while True {
    cnt = count ${tasks_graph_file}*;
    sleep 5 if cnt>1 || cnt==0;
    otherwise break;
  }
  call auntie ##To wake up sage to collect info in all nodes.
  check timestamp;
  cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
  update timestamp;
}

I'm splitting this info to be a separate thread.


RE: Service management of Sage - D - lingu - 11-23-2019 11:48 PM

(05-10-2019 07:56 PM)lingu Wrote:  Driver: Sage configuration can be quite complex. It is often convenient to evaluate a var in Sage either on command line or in a program. GLAD has a command 'gladinfo var' or 'glad info var' to read the value of a variable var. But Sage does not have it.

Proposal: add a command 'info' like the 'info' command in glad, an let 'sage info var' report the value of var.

RR zheny

?


RE: Service management of Sage - D - zheny - 11-24-2019 06:09 PM

(11-23-2019 11:48 PM)lingu Wrote:  
(05-10-2019 07:56 PM)lingu Wrote:  Driver: Sage configuration can be quite complex. It is often convenient to evaluate a var in Sage either on command line or in a program. GLAD has a command 'gladinfo var' or 'glad info var' to read the value of a variable var. But Sage does not have it.

Proposal: add a command 'info' like the 'info' command in glad, an let 'sage info var' report the value of var.

RR zheny

?

good to me
I suggest to update these info to head-post
---
sage info
sage info [var]: report the value of a variable $var
supported $var including
ips: nodes managed by sage
apt_cnt: current atp count
---

RR xwcwt
I will implement these a little later


RE: Service management of Sage - D - xwcwt - 11-25-2019 03:17 PM

(11-24-2019 06:09 PM)zheny Wrote:  
(11-23-2019 11:48 PM)lingu Wrote:  
(05-10-2019 07:56 PM)lingu Wrote:  Driver: Sage configuration can be quite complex. It is often convenient to evaluate a var in Sage either on command line or in a program. GLAD has a command 'gladinfo var' or 'glad info var' to read the value of a variable var. But Sage does not have it.

Proposal: add a command 'info' like the 'info' command in glad, an let 'sage info var' report the value of var.

RR zheny

?

good to me
I suggest to update these info to head-post
---
sage info
sage info [var]: report the value of a variable $var
supported $var including
ips: nodes managed by sage
apt_cnt: current atp count
---

RR xwcwt
I will implement these a little later

Good to me.