| 
									
										
										
										
											2024-02-28 15:01:12 +08:00
										 |  |  | #!/bin/bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-12 15:56:53 +01:00
										 |  |  | # replace env variables in the service_conf.yaml file | 
					
						
							|  |  |  | rm -rf /ragflow/conf/service_conf.yaml | 
					
						
							|  |  |  | while IFS= read -r line || [[ -n "$line" ]]; do | 
					
						
							|  |  |  |     # Use eval to interpret the variable with default values | 
					
						
							|  |  |  |     eval "echo \"$line\"" >> /ragflow/conf/service_conf.yaml | 
					
						
							|  |  |  | done < /ragflow/conf/service_conf.yaml.template | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-06 16:02:44 +08:00
										 |  |  | # unset http proxy which maybe set by docker daemon | 
					
						
							|  |  |  | export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY="" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-28 18:57:43 +08:00
										 |  |  | /usr/sbin/nginx | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-17 09:00:24 +08:00
										 |  |  | PY=python3 | 
					
						
							| 
									
										
										
										
											2024-05-20 18:32:24 +08:00
										 |  |  | if [[ -z "$WS" || $WS -lt 1 ]]; then | 
					
						
							|  |  |  |   WS=1 | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											2024-02-28 18:57:43 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-28 15:01:12 +08:00
										 |  |  | function task_exe(){ | 
					
						
							| 
									
										
										
										
											2024-03-06 19:16:31 +08:00
										 |  |  |     while [ 1 -eq 1 ];do | 
					
						
							| 
									
										
										
										
											2024-08-28 14:06:27 +08:00
										 |  |  |       $PY rag/svr/task_executor.py $1; | 
					
						
							| 
									
										
										
										
											2024-03-06 19:16:31 +08:00
										 |  |  |     done | 
					
						
							| 
									
										
										
										
											2024-02-28 15:01:12 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 19:16:31 +08:00
										 |  |  | for ((i=0;i<WS;i++)) | 
					
						
							|  |  |  | do | 
					
						
							| 
									
										
										
										
											2024-08-28 14:06:27 +08:00
										 |  |  |   task_exe  $i & | 
					
						
							| 
									
										
										
										
											2024-03-06 19:16:31 +08:00
										 |  |  | done | 
					
						
							| 
									
										
										
										
											2024-02-28 15:01:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 13:16:12 +08:00
										 |  |  | while [ 1 -eq 1 ];do | 
					
						
							| 
									
										
										
										
											2024-05-07 11:43:33 +08:00
										 |  |  |     $PY api/ragflow_server.py | 
					
						
							| 
									
										
										
										
											2024-04-29 15:45:08 +08:00
										 |  |  | done | 
					
						
							| 
									
										
										
										
											2024-05-07 11:43:33 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | wait; |