Skip to content

Commit

Permalink
Merge pull request #148 from alan-turing-institute/pulumi-hackweek
Browse files Browse the repository at this point in the history
Pulumi for hackweek
  • Loading branch information
rchan26 authored Jan 15, 2024
2 parents 815731e + e529158 commit 7c7f014
Show file tree
Hide file tree
Showing 16 changed files with 1,055 additions and 384 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,10 @@ azure/*/.secrets
azure/*.secrets
azure/*/Pulumi.*.yaml
data/llama_index_indices/all_data/

# environment files
*.env
*_env

# misc
.vscode/
42 changes: 37 additions & 5 deletions azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,49 @@ You will need to install

in order to run this code.

1. Setup the Pulumi backend (if it already exists this will just check that you have access)
1. Have a .pulumi_env file (in this directory) including the variables that you need.

For the `api_bot` model, you will need to have the following variables:

```bash
REGINALD_SLACK_APP_TOKEN
REGINALD_SLACK_BOT_TOKEN
REGINALD_API_URL
GITHUB_TOKEN
```

For the `hack_week` model, you will need to have the following variables:

```bash
OPENAI_AZURE_API_BASE
OPENAI_AZURE_API_KEY
COMPLETION_SLACK_APP_TOKEN
COMPLETION_SLACK_BOT_TOKEN
GPT_AZURE_SLACK_APP_TOKEN
GPT_AZURE_SLACK_BOT_TOKEN
GITHUB_TOKEN
OPENAI_API_KEY (optional)
```

2. Move into the folder for the model you want to deploy, e.g. for the `api_bot` model:

```bash
cd api_bot
```

3. Setup the Pulumi backend (if it already exists this will just check that you have access)

```bash
./setup.sh
```

this will also create a local `.secrets` file
This may create a local `.secrets` file.
This file contains the secrets that you need to deploy the model and includes the environment variables needed for the container instance (see Step 1.).
You will need to source this file before deploying in the next step.

2. Deploy with Pulumi
4. Deploy with Pulumi

```bash
> source .secrets
> AZURE_KEYVAULT_AUTH_VIA_CLI=true pulumi update
> source .secrets (if this exists)
> AZURE_KEYVAULT_AUTH_VIA_CLI=true pulumi up
```
4 changes: 0 additions & 4 deletions azure/api_bot/Pulumi.yaml

This file was deleted.

89 changes: 0 additions & 89 deletions azure/api_bot/__main__.py

This file was deleted.

4 changes: 2 additions & 2 deletions azure/hack_week/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: reginald
name: reginald_hack_week
runtime:
name: python
description: Slack bot to respond to REG queries
description: Slack bot to respond to REG queries. Models developed during REG Hack Week 2023.
Loading

0 comments on commit 7c7f014

Please sign in to comment.