On Tue, Feb 02, 2021 at 10:01:45AM +0800, Luan Shengde wrote:
executable file for container: submit
it can be run as the real command submit in the container. when you run it, it will calls the command 'submit' in the container. add ln for it to PATH, you can run it at anywhere.
Signed-off-by: Luan Shengde shdluan@163.com
container/submit/submit | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 container/submit/submit
diff --git a/container/submit/submit b/container/submit/submit new file mode 100755 index 0000000..3f9539f --- /dev/null +++ b/container/submit/submit @@ -0,0 +1,23 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+# This is a single-use container. +# The container will run if you run the 'submit' to submit jobs. +# After the command execute over, the container will been removed itself. +# Do not need to delete manually for it has been added option '--rm'. +date_suffix=$(date +%m%d-%H%M)
It's easy to conflict to users, better use random string
+cmd=(
docker run
--rm
Can you listen the submit command and keep the container hang up always? Just like submit always be executed in the container.
Thanks, Xueliang
--name=submit-$USER-$data_suffix
-it
-v /etc/compass-ci:/etc/compass-ci:ro
-v $HOME/.config:/root/.config:ro
-v $HOME/.ssh:/root/.ssh:rw
submit
/root/lkp-tests/sbin/submit "$@"
+)
+"${cmd[@]}"
-- 2.23.0