Skip to content

Commit

Permalink
Updates to the Azure terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
DonFreed committed Apr 8, 2024
1 parent 3b5beb9 commit 651a16c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ Terraform configuration files for the Sentieon software
* The [Terraform CLI](https://developer.hashicorp.com/terraform/downloads)
* The [Azure CLI]( https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
* An Azure account and credentials with permission to provision resources inside the account
* A Sentieon license file for your FQDN, bound to port 8990

### Provision the license server

Use the terraform configuration files to provision the following infrastructure:

* An Azure Virtual Network. The default network configuration with the default subnet(s), internet gateway, and route table is assumed in this deployment guide.
Security groups that can be used to run the Sentieon® license server and the compute nodes.
* A (Standard_B1s) instance running the Sentieon® license server.
* Security groups for the Sentieon license server and any compute nodes
* Security groups for the Sentieon license server.
* A (Standard_B1s) instance.

```bash
git clone https://github.com/sentieon/terraform
Expand All @@ -37,22 +35,41 @@ terraform init
# Provision the license server infrastructure
terraform apply \
-var 'azure_region=<AZURE_REGION>' \
-var 'resource_name=<RESROUCE_NAME>'
-var 'resource_name=<RESOURCE_NAME>' \
-var 'private_key_location=<KEY_LOCATION>'

# For example
# terraform apply \
# -var 'azure_region=West US' \
# -var 'resource_name=sentieon-licsrvr' \
# -var 'private_key_location=azure_licsrvr_key.pem'
```

The infrastructure should startup within a few minutes.
The infrastructure should startup within a few minutes and terraform will create a private key file at `KEY_LOCATION`. Additionally, terraform will output the public and private IP addresses of the VM to the terminal.

Azure will charge your account for deployed infrastructure including the VM instance, disk, public ip and virtual network.

### Install Sentieon and license file

User the ssh key downloaded from infrastrucutre spin up to copy your license file to the instance as well as download the Sentieon® tools.
Send your Sentieon support representative the private IP address of your instance and port 8990. They will send you back a Sentieon license file that can be used on the newly created VM.

Start the license server with the following command:
Use the private key file and the instance's public IP to transfer the license file into the vm and ssh into the VM:
```bash
# Transfer the license file into the instance
scp -i <KEY_LOCATION> <SENTIEON_LICENSE_FILE> adminUser@<PUBLIC_IP>:~/

# Connect to the vm
ssh -i <KEY_LOCATION> adminUser@<PUBLIC_IP>
```
sentieon licsrvr --start [-l <licsrvr_log>] <license_file>

Download the Sentieon software to the VM and start the Sentieon license server:
```bash
# Download the Sentieon software package
curl -L <SENTIEON_URL.tar.gz> \
| tar -zxf -

# Start the sentieon license server
sentieon-genomics-<VERSION>/bin/sentieon licsrvr --start -l licsrvr.log ~/<LICENSE_FILE>
```

### Cleanup
Expand All @@ -62,7 +79,7 @@ The provisioned infrastructure can be destroyed with the `terraform apply -destr
terraform apply -destroy \
-var 'azure_region=<AZURE_REGION>' \
-var 'resource_name=<RESOURCE_NAME>' \
-var 'public_key_location=<PUBLIC_KEY_LOCATION>'
-var 'private_key_location=<KEY_LOCATION>'
```

## Quick Start - Sentieon License server deployment to AWS
Expand Down
15 changes: 9 additions & 6 deletions azure_license-server/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "azure_region" {}
variable "resource_name" {}
variable "private_key_location" {}
variable "azure_region" {} # The Azure region for the license server
variable "resource_name" {} # The name of the Azure resource group
variable "private_key_location" {} # Specify the path where you want to save the PEM key

provider "azurerm" {
features {}
Expand All @@ -9,7 +9,6 @@ provider "azurerm" {
resource "azurerm_resource_group" "rg" {
name = var.resource_name
location = var.azure_region
key = var.private_key_location
}

resource "azurerm_virtual_network" "vnet" {
Expand Down Expand Up @@ -89,7 +88,11 @@ output "license_server_private_ip" {
value = azurerm_linux_virtual_machine.license_server_instance.private_ip_address
}

resource "local_file" "admin_ssh_key_pem" {
filename = azurerm_resource_group.rg.key # Specify the path where you want to save the PEM key
output "license_server_public_ip" {
value = azurerm_linux_virtual_machine.license_server_instance.public_ip_address
}

resource "local_sensitive_file" "admin_ssh_key_pem" {
filename = var.private_key_location
content = tls_private_key.ssh.private_key_pem
}

0 comments on commit 651a16c

Please sign in to comment.