Deploy Weights & Biases On-prem with Terraform Cloud

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up everyone my name is costa and i am a machine learning engineer intern at weights and biases in this video i'll showcase how to self-host and maintain waste and biases deployment on aws using terraform cloud terraform is an open source tool that allows you to use code to define resources provisioned in the cloud in a nutshell you can write code like this to precisely define the resource you want then use terraform plan to see the plan infrastructure changes and use terraform applied to apply these changes to the cloud and seeing is believing you can actually go to your cloud providers dashboard to see the provision resource terraform cloud is a software as a service provider to augment developers workflow in a production setting today we're going to talk about the most popular version control workflow which integrates very nicely with github workflows there are roughly three stages of this workflow first whenever we want to make an infrastructure change we start by creating a pull request by modifying the terraform files this pr will automatically trigger a terraform plan which you can conveniently view it in the terraform cloud dashboard once we're happy with the pr we can go ahead and merge it and terraform cloud will automatically apply the plan changes to the infrastructure you might be wondering why do i need this complicated process to provision resources when i could use my cloud providers dashboard well we are really talking about what happens when you have complicated infrastructures that have hundreds of resources with terraform it's easy to scale whereas the alternative is to have a massive brain to know how to click buttons on hundreds of dashboards with the introduction out of the way let's get started we start by creating an empty github repository on github to version our infrastructure we then simply clone the repository to our machine and use vs code to check out the folder then we're going to log into terraform cloud create a new workspace and choose the version control workflow then we're going to select the wmb stack repository we just created turn on the automatic speculative plans option and finally create the workspace then we're going to configure a terraform cloud setting to make the workflow easier in particular we're going to turn on the auto apply option next we're going to set up some terraform variables in particular we're going to add our aws access key and secret and according to wnb terraforms documentation we also need to set up a global name as well as license this is a great place to input your license if you have one but for this video we're going to leave it blank next we're going to queue a dummy run according to terraform cloud's requirement so that our pull request can trigger a speculative run note that this dummy run is expected to fail once this is finished we're ready to dive into some code go to the wnb local repository and check out the terraform aws folder then we're going to copy the local.tf cube and info folder to our repository here i simply use curl to download these files i also need to match the terraform 1.0 version that is used in terraform cloud next we're going to prepare a pull request for our infrastructure change we do this by creating a branch commit our changes and push to our repository now we're ready to go back to github and finally make the pull request which will automatically trigger a speculative plan from terraform once the plan has finished we can click on the integration link to see the planned infrastructure changes as you can see in this page terraform plans to spin up all the required resources for the waste and biases deployment once we're happy with the change we can go ahead and merge the pro request because we had previously configured the auto apply feature now terraform cloud is going to automatically apply our infrastructure changes from this pr this is the point you could get out and go get a cup of coffee because this process will take 10 to 30 minutes sometimes terraform could fail to create all the resources not to worry simply cue another plan and the issue usually goes away during the replan terraform will recalibrate and make up for the resources it had failed to create once the apply has finished we can open the output url and we can readily see the private wnb installation up and running simply create an account continue and you're in in the following video i'll showcase how to add https to the wnb deployment using route 53. we will first check out and pull the main branch then in infra.tf i am going to add my own domain casah.dev to the route 53 zone i'll also output the name server so that i can tell my domain provider to use these name servers note that i'll also need to output the name servers in the local.tf the next steps are like what we did before which is to basically make a pr review the speculative plan changes on terraform and then merge it at this point we see the name servers from the route 53 zone i personally use google domains as my domain providers and i'm simply going to tell it to use these name servers after that we'll check out and pull the main branch again and now we're ready to set up https for our deployment the exact source code is a bit arcane to understand but i basically use raw53 to set up a subdomain and a certificate as well next we're going to tell the load balancer to always redirect http to https and also just set up a listener for https endpoint lastly we'll delete the original listener now we're ready to ship simply make a pull request review and merge and we should be able to see the https deployment once the terraform apply is finished we can use our custom sub domain to open the wmb installation and as you can see the connection is secured and the certificate is signed by aws with that said this concludes our video tutorial the source code of our terraform files is linked in the video description and if you ever run into any issues feel free to reach out to us at support wnb.com my name is costa and i'll see you again
Info
Channel: Weights & Biases
Views: 233
Rating: 5 out of 5
Keywords:
Id: bYmLY5fT2oA
Channel Id: undefined
Length: 7min 17sec (437 seconds)
Published: Thu Sep 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.