Skip to contents

EC2

The purpose of this package is to provide Gradient team members the ability to start an Amazon EC2 instance (a virtual computer) with the specified machine preferences. The vignette in the articles section will explain how to work with EC2 and docker.

Example

# Make sure you set the following system variables in your .Renviron

AWS_ACCESS_KEY_ID =
AWS_DEFAULT_REGION = us-east-1
AWS_PEM =
AWS_SECRET_ACCESS_KEY =
DOCKER_PASSWORD =
DOCKER_USERNAME =
GITHUB_PASSWORD =
GITHUB_USERNAME =

# specifying instance
  
instance_1 <-
  g6tr_ec2_launch(
  rserver_username = 'marcin',
  rserver_password = 'secretpassword',
  image_name = 'Making tests',
  image_keypair = '20170822',
  pemfile_path = Sys.getenv('AWS_PEM')
  )

instance_2 <-
 g6tr_ec2_launch(
   rserver_username = 'marcin',
   rserver_password = 'secretpassword',
   image_name = 'Making tests 2',
   image_keypair = '20170822',
   pemfile_path = Sys.getenv('AWS_PEM')
   )


 g6tr_ec2_stop(instance_1)
 g6tr_ec2_start(instance_1)
 g6tr_ec2_stop(instance_1)
 g6tr_ec2_terminate(instance_1)

 g6tr_ec2_stop(instance_ip = '3.81.159.227')
 instance_3 <- g6tr_ec2_start(instance_name = 'Making tests 2')
 g6tr_ec2_terminate(instance_3)