Only sshr need this, why put it to every job?
On Mon, Oct 19, 2020 at 03:53:18PM +0800, Wu Zhende wrote:
[Why] Network users need to use sshd to login testbox. So testbox should set sshd. And testbox get sshd info from job content. Scheduler needs to add ssh info to job content
Signed-off-by: Wu Zhende wuzhende666@163.com
container/scheduler/start | 4 ++++ src/lib/job.cr | 6 ++++++ 2 files changed, 10 insertions(+)
diff --git a/container/scheduler/start b/container/scheduler/start index 81e7139..1183cde 100755 --- a/container/scheduler/start +++ b/container/scheduler/start @@ -24,10 +24,14 @@ names = Set.new %w[ GIT_SERVER FLUENTD_SERVER_HOST FLUENTD_SERVER_PORT
- SSH_PORT_BASE
- SSH_PORT_LEN lab
]
defaults = relevant_defaults(names) +defaults["SSH_PORT_BASE"] = 50000 unless defaults["SSH_PORT_BASE"] +defaults["SSH_PORT_LEN"]= 2000 unless defaults["SSH_PORT_LEN"] env = docker_env(defaults)
CCI_REPOS = ENV['CCI_REPOS'] || '/c' diff --git a/src/lib/job.cr b/src/lib/job.cr index 20afa65..fcc1711 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -139,6 +139,7 @@ class Job set_kernel_append_root() set_kernel_params() set_lkp_server()
set_ssh_port() end
private def append_init_field
@@ -168,6 +169,11 @@ class Job end end
- private def set_ssh_port
- self["ssh_port_base"] = ENV["SSH_PORT_BASE"]
- self["ssh_port_len"] = ENV["SSH_PORT_LEN"]
- end
- private def set_os_dir self["os_dir"] = "#{os}/#{os_arch}/#{os_version}" end
-- 2.23.0