opencontainers / opencontainers/runc

Run runc container over SSH

Open
#2,970 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/terminal kind/question
Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

I am working on a cluster of runc containers running in AWS EC2 Ubuntu 18.04 x86_64 instances. I intend to have one master node run the containers in all the other nodes via SSH. I am using the following bash script in the master node:

#!/bin/bash
while read node
do
      ssh user@$node "cd ~/mycont; sudo runc run mycont"
done <active

The "active" file contains list of remote IPs for the EC2 instances. Running this results in an error similar to the one below
level=error msg="open /dev/tty: no such device or address"

Running the runc command by directly accessing the remote terminal via SSH works, but not in this inline format. Also, using ssh -t works as inline in the local terminal, but not in the bash script.

I am not sure what I am missing here. I don't have an in-depth knowledge of how SSH issues the commands: in the remote terminal, or by creating a terminal in the local machine. Also, will restoring the container via inline SSH have any issues? Any help would be appreciated.

Edit: Does it have anything to do with terminal: true in config.json?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the bash loop, the active host list, and config.json's terminal setting; reproduce runc run mycont through direct SSH and the scripted command, including ssh -t. Check how the command receives /dev/tty and determine whether restoring the container through inline SSH is supported; document the required invocation or clarify the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, bash, go, ubuntu
Domain
cli, cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.