[how] before: execute "./install-tiny", locally deploy compass-ci, can submit job, run containers services, run qemu test. after: execute "./install-tiny server reboot", locally deploy compass-ci server, just run containers servers.
[why] some user who locally deploy compass-ci, the host which just run containers can only access intranet, so skip some steps that need to access internet when deploy, can submit job and run qemu test will in other machine, use $LKP_SRC/setup/simply-ci to deploy.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- sparrow/install-tiny | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/sparrow/install-tiny b/sparrow/install-tiny index cb47cf5..414c5bc 100755 --- a/sparrow/install-tiny +++ b/sparrow/install-tiny @@ -4,10 +4,19 @@ # For your reference only. # It's better to run the below scripts step by step.
+export server=$1 +export action=$2 + +server_skip() +{ + local deploy_script=$1 + [ "$server" != "server" ] && ${deploy_script} +} + [[ $CCI_SRC ]] || export CCI_SRC=$(cd $(dirname $(realpath $0)); git rev-parse --show-toplevel) cd $CCI_SRC/sparrow || exit
-0-package/install +server_skip 0-package/install 0-package/common 1-storage/tiny 1-storage/permission @@ -15,9 +24,9 @@ cd $CCI_SRC/sparrow || exit 2-network/iptables 2-network/nfs 2-network/cifs -3-code/git +server_skip 3-code/git 3-code/dev-env . /etc/profile.d/compass.sh -4-docker/buildall -5-build/ipxe +4-docker/buildall $action +server_skip 5-build/ipxe 7-systemd/systemd-setup
On Fri, Jan 29, 2021 at 09:27:30AM +0800, Liu Yinsi wrote:
[how] before: execute "./install-tiny", locally deploy compass-ci, can submit job, run containers services, run qemu test. after: execute "./install-tiny server reboot", locally deploy compass-ci server, just run containers servers.
[why] some user who locally deploy compass-ci, the host which just run containers can only access intranet,
intranet => internet
Do you mean the host can't connect to the internet, so containers which need internet can't run successfully?
Thanks, Yuanchao
On Fri, Jan 29, 2021 at 09:58:08AM +0800, Li Yuanchao wrote:
On Fri, Jan 29, 2021 at 09:27:30AM +0800, Liu Yinsi wrote:
[how] before: execute "./install-tiny", locally deploy compass-ci, can submit job, run containers services, run qemu test. after: execute "./install-tiny server reboot", locally deploy compass-ci server, just run containers servers.
[why] some user who locally deploy compass-ci, the host which just run containers can only access intranet,
intranet => internet
the host can only access intranet, can't access internet.
Do you mean the host can't connect to the internet,
yes
so containers which need internet can't run successfully?
we will providers docker images cgz file to users, so run containers no need internet, they can successfully deploy containers.
but for other scripts like 0-package/install, 3-code/git, need to execute gem install, git clone, yum install will not successfully, so the host just run containers.
Thanks, Yinsi
Thanks, Yuanchao
On Fri, Jan 29, 2021 at 09:27:30AM +0800, Liu Yinsi wrote:
[how] before: execute "./install-tiny", locally deploy compass-ci, can submit job, run containers services, run qemu test. after: execute "./install-tiny server reboot", locally deploy compass-ci server, just run containers servers.
[why] some user who locally deploy compass-ci, the host which just run containers can only access intranet, so skip some steps that need to access internet when deploy, can submit job and run qemu test will in other machine, use $LKP_SRC/setup/simply-ci to deploy.
Signed-off-by: Liu Yinsi liuyinsi@163.com
sparrow/install-tiny | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/sparrow/install-tiny b/sparrow/install-tiny index cb47cf5..414c5bc 100755 --- a/sparrow/install-tiny +++ b/sparrow/install-tiny @@ -4,10 +4,19 @@ # For your reference only. # It's better to run the below scripts step by step.
+export server=$1 +export action=$2
+server_skip() +{
- local deploy_script=$1
- [ "$server" != "server" ] && ${deploy_script}
+}
[[ $CCI_SRC ]] || export CCI_SRC=$(cd $(dirname $(realpath $0)); git rev-parse --show-toplevel) cd $CCI_SRC/sparrow || exit
-0-package/install +server_skip 0-package/install
The better style is to make server_skip a test function, and call it this way
Even better, can we split this script into two smaller ones?
Thanks, Fengguang
0-package/common 1-storage/tiny 1-storage/permission @@ -15,9 +24,9 @@ cd $CCI_SRC/sparrow || exit 2-network/iptables 2-network/nfs 2-network/cifs -3-code/git +server_skip 3-code/git 3-code/dev-env . /etc/profile.d/compass.sh -4-docker/buildall -5-build/ipxe +4-docker/buildall $action +server_skip 5-build/ipxe 7-systemd/systemd-setup -- 2.23.0
# It's better to run the below scripts step by step.
+export server=$1 +export action=$2
+server_skip() +{
- local deploy_script=$1
- [ "$server" != "server" ] && ${deploy_script}
+}
[[ $CCI_SRC ]] || export CCI_SRC=$(cd $(dirname $(realpath $0)); git rev-parse --show-toplevel) cd $CCI_SRC/sparrow || exit
-0-package/install +server_skip 0-package/install
The better style is to make server_skip a test function, and call it this way
directly use like this? [ $1 != 'server'] && 0-package/install
Even better, can we split this script into two smaller ones?
我应该根据什么来拆分呢, 把需要网络的放一块,不需要的放在一个脚本里面吗?
Thanks, Yinsi
Thanks, Fengguang
0-package/common 1-storage/tiny 1-storage/permission @@ -15,9 +24,9 @@ cd $CCI_SRC/sparrow || exit 2-network/iptables 2-network/nfs 2-network/cifs -3-code/git
+server_skip 3-code/git 3-code/dev-env . /etc/profile.d/compass.sh -4-docker/buildall -5-build/ipxe +4-docker/buildall $action
+server_skip 5-build/ipxe 7-systemd/systemd-setup -- 2.23.0
On Fri, Jan 29, 2021 at 05:14:02PM +0800, Liu Yinsi wrote:
# It's better to run the below scripts step by step.
+export server=$1 +export action=$2
+server_skip() +{
- local deploy_script=$1
- [ "$server" != "server" ] && ${deploy_script}
+}
[[ $CCI_SRC ]] || export CCI_SRC=$(cd $(dirname $(realpath $0)); git rev-parse --show-toplevel) cd $CCI_SRC/sparrow || exit
-0-package/install +server_skip 0-package/install
The better style is to make server_skip a test function, and call it this way
directly use like this? [ $1 != 'server'] && 0-package/install
Yes.
Even better, can we split this script into two smaller ones?
我应该根据什么来拆分呢, 把需要网络的放一块,不需要的放在一个脚本里面吗?
把加了server_skip的这些行抽离出去变成一个新脚本?
Thanks, Fengguang
On Fri, Jan 29, 2021 at 09:27:30AM +0800, Liu Yinsi wrote:
[how] before: execute "./install-tiny", locally deploy compass-ci, can submit job, run containers services, run qemu test. after: execute "./install-tiny server reboot", locally deploy compass-ci server, just run containers servers.
+4-docker/buildall $action
"buildall reboot" can be run standalone, rather than injecting into this script and make it complex?
Thanks, Fengguang
On Fri, Jan 29, 2021 at 10:36:03AM +0800, Wu Fengguang wrote:
On Fri, Jan 29, 2021 at 09:27:30AM +0800, Liu Yinsi wrote:
[how] before: execute "./install-tiny", locally deploy compass-ci, can submit job, run containers services, run qemu test. after: execute "./install-tiny server reboot", locally deploy compass-ci server, just run containers servers.
+4-docker/buildall $action
"buildall reboot" can be run standalone, rather than injecting into this script and make it complex?
那再写一个类似install-tiny的脚本去单独调用buildall把。
Thanks, Yinsi
Thanks, Fengguang