Disclaimer: This guide describes the basic setup of Compute Server on AWS. There are a lot of extra features (for example concerning security or availability) that may have to be added to fit your specific needs.
Connectivity
- If you have not done so already, define a Virtual Private Cloud (VPC) and a public subnet within this VPC. Note that the VPC, subnet, and all instances have to be in the same cloud region.
- During the setup process, it may be helpful to enable a public IP in the subnet. This allows you to connect directly to the machine through a browser (see below) and perform the setup process. Otherwise, you can tunnel through using your AWS credentials.
- Setting up a new public subnet will also create a new Elastic Network Interface (ENI). This is key as it allows Gurobi to have a persistent property of the network it can use to identify the machine. You can see the ENIs you have configured under AWS > EC2 > Network interfaces
- Create an EC2 instance of the desired size. You can use Ubuntu as the Amazon Machine Image (AMI), but there is no wrong choice as Gurobi runs on Windows, macOS, and all major Linux distributions.
- It is best to use a dedicated resource for the optimization, rather than a shared resource. This is an option when you set up the instance.
- It is best to create a dedicated volume where Gurobi is stored.
- You should attach a network interface to the instance that corresponds to the
subnet you created in Step 1. - It is good practice to store the SSH private key as it is impossible to configure
again.
- Open the port that the Compute Server can use. This can be done in the dashboard of the Instance you created by going to “Security” and select the security group. This takes you to the “Security Groups” page, where you should click “Edit inbound rules”, and where you should add an HTTP rule that anyone (i.e. Source=”0.0.0.0/0”) can use. This can be set to HTTPS, but is not necessary when the communication stays within a given VPC.
- Connect to the instance: in the top right corner of the AWS console, there is a button “Connect”, which then allows you to open a terminal window inside of your browser. Then you can select the “EC2 Instance Connect” to open a terminal window in the browser.
- Since you need to execute a lot of “sudo” commands, we suggest that you run sudo su to use root directly.
Installation
- Mount the Volume to the instance.
- If the volume was newly created, it does not have a file system. Please follow this guide to create one.
- Download Gurobi Remote Services. Note that in Unix you can use wget to download the package in the terminal.
- Set up Gurobi Remote Services. It is good practice to add the additional path variable to a shell script so that it gets executed every time one opens a session. You can consult this stackoverflow discussion around what the most suitable way is for you.
- Install the Gurobi Remote Services service using grb_rs install.
- Open the generated grb_rs.cnf file, and add the name that will be used by other machines to send optimization problems as the HOSTNAME. If you are using the server within the VPC only, then you can use the “Private IPv4 DNS” displayed by the instance. If the server is supposed to be reachable by the outside world, then you have to use the Public IPv4 DNS. Note that this should be constant, and therefore you should assign a static IP address.
Starting up the service
- Launch the service with grb_rs start. To check the status of the service, you can at any time call systemctl status grb_rs.service
- To start sending jobs to the service, all you need is a client license file that reads:
COMPUTESERVER=<AWS domain name>:<port>
Note that the <port> needs to match the port set in the grb_rs.cnf file and the port opened in the Security Group (see Step 3).
Comments
0 comments
Article is closed for comments.