Skip to content

Latest commit

 

History

History
108 lines (73 loc) · 3.39 KB

File metadata and controls

108 lines (73 loc) · 3.39 KB

Deployment: Infrastructure as code

The scripts in this folder give the ability to provision and manage compute capacity using [AWS Infrastructure]([link to follow]), in order to deploy the docker container and run the app in it.

In short the scripts does the below:

  • [instructions to follow]

Table of content

Pre-requisites

  • [AWS & Relates stuff]
  • Install Terraform (all methods for the various platforms are mentioned)
  • Clone this repo and in the right folder:
$ git clone https://github.com/neomatrix369/learning-path-index/
$ cd learning-path-index
$ cd app/llm-poc-variant-01/deploy/aws

For a summary (also helps to verify the steps) of the above steps please see here.

Provisioning Infrastructure using Terraform

Create infrastructure from the CLI using Terraform

  • Deploy with terraform
$ terraform init
$ terraform apply -var "ssh_private_key=$(cat <location of your private ssh key>)" --auto-approve

The deployment process should end with a list of private/public ip addresses like so:

Apply complete! Resources: 9 added, 0 changed, 0 destroyed.

Outputs:

instance_private_ips = [
    10.1.nn.m
]
instance_public_ips = [
    1xx.145.174.85
]

The public IP addresses are fairly dynamic in nature and could be between any range (example shown above). Please make a note of the Public IP above as it will be needed in the following steps.

Deploy the docker image with the notebooks and libraries

  • use ssh and docker to make that end meet
$ ./run-docker-container.sh

Recover/retry from failed attempt

  • Apply the fix to the configuration or script or both
  • And run the below again:
$ terraform apply -var "ssh_private_key=$(cat <location of your private ssh key>)" --auto-approve

Start clean after a failed attempt (errors encountered)

  • Run the below before proceeding:
$ terraform destroy -var "ssh_private_key=$(cat <location of your private ssh key>)" --auto-approve
$ terraform apply -var "ssh_private_key=$(cat <location of your private ssh key>)" --auto-approve

Destroy infrastructure (cleanup)

  • Remove resources or destroy them with terraform
$ terraform destroy -var "ssh_private_key=$(cat <location of your private ssh key>)" --auto-approve

You should see something like this at the end of a successful run:

.
.
.
Destroy complete! Resources: 7 destroyed.

Security

Note that this setup does not take into account establishing a secure http i.e. https communication between the Jupyter lab instance and the browser. Please beware when using this in your target domain depending on the prerequisites you need to conform to. This example is good for learning and illustration purposes, please do NOT deploy it in production or public facing environments.


Go to Main page