Skip to content

ENH: Added StarCluster sshutils so users can log into AWS EC2 instances.#101

Merged
yarikoptic merged 14 commits intoReproNim:masterfrom
mjtravers:enh_aws_tty
Aug 9, 2017
Merged

ENH: Added StarCluster sshutils so users can log into AWS EC2 instances.#101
yarikoptic merged 14 commits intoReproNim:masterfrom
mjtravers:enh_aws_tty

Conversation

@mjtravers
Copy link
Contributor

Pull request for SSHing into AWS EC2 instance using StarCluster utils.

@codecov-io
Copy link

codecov-io commented Aug 8, 2017

Codecov Report

Merging #101 into master will decrease coverage by 8.55%.
The diff coverage is 34.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #101      +/-   ##
==========================================
- Coverage   80.44%   71.88%   -8.56%     
==========================================
  Files         108      114       +6     
  Lines        6167     7499    +1332     
==========================================
+ Hits         4961     5391     +430     
- Misses       1206     2108     +902
Impacted Files Coverage Δ
niceman/interface/create.py 84.84% <100%> (-4.25%) ⬇️
niceman/resource/aws_ec2.py 65.41% <100%> (-1.26%) ⬇️
niceman/support/starcluster/sshutils.py 16.82% <16.82%> (ø)
niceman/support/starcluster/progressbar.py 26.63% <26.63%> (ø)
niceman/support/starcluster/logger.py 35.82% <35.82%> (ø)
niceman/support/starcluster/__init__.py 46.15% <46.15%> (ø)
niceman/support/starcluster/exception.py 48.44% <48.44%> (ø)
niceman/support/starcluster/static.py 79.38% <79.38%> (ø)
niceman/interface/login.py 88% <83.33%> (-3.31%) ⬇️
niceman/interface/base.py 95.2% <96.55%> (+0.28%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e9c3e2...042277c. Read the comment docs.

else:
raise NotImplementedError("Bad --backend paramenter '{}'".format(key))
if backend:
config = backend_set_config(backend, env_resource, config)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho better to have a function without 'side effect' of modifying config in place and then also returning it... what if

backend_set_config -> get_backend_config(backend, env_resource) which returns a backend_config, and then you just do config.update(backend_config), i.e. update with those new settings. IMHO makes it clearer


# Set resource properties to any backend specific command line arguments.
if backend:
config = backend_set_config(backend, env_resource, config)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same applies as above... I feel that it all might become also shorter after we look into making ResourceManager a proper class etc, but that later

lgr.debug("Opening TTY connection to AWS EC2 instance.")
host = self._ec2_instance.public_ip_address
ssh = SSHClient(host, private_key=self.key_filename)
ssh.interactive_shell(self.user)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we also get a simple "SSHHost" resource or smth like that so we could register/login to remote hosts (which do not need startup etc) general?

if line != '':
output.append(line)
print line,
print(line),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh -- starcluster is not python3 compatible? we are asking for trouble I am afraid... we might want to just futurize its source code or smth like that at least...

@yarikoptic
Copy link
Member

Ok @mjtravers -- I will merge it so I could merge these changes with my branch as well since tests pass already, and then we could address those comments I have left.

@yarikoptic yarikoptic merged commit 5442096 into ReproNim:master Aug 9, 2017
@asmacdo asmacdo mentioned this pull request Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants