Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to merge into 0.8.1 #90

Draft
wants to merge 204 commits into
base: upstream/hosted-branch
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
5f31e25
feat: make openAI model version configurable
isobel-daley-6point6 Jul 4, 2024
ef0993f
fix: remove auto-formatting changes
isobel-daley-6point6 Jul 4, 2024
3d7ad66
fix: remove auto-formatting changes
isobel-daley-6point6 Jul 4, 2024
6a3f912
SSO integration with v0.4
Jul 9, 2024
ed4a0e4
feat:make elastic host and password configurable
isobel-daley-6point6 Jul 9, 2024
396c9bf
Merge pull request #5 from uktrade/feat/configurable_elastic_password
simonstrong-dbt Jul 9, 2024
66ae59b
Merge pull request #4 from uktrade/feat/sso-integration
simonstrong-dbt Jul 9, 2024
05e7afa
fix: host updated to elastic_host
isobel-daley-6point6 Jul 9, 2024
d26e6c8
Merge pull request #6 from uktrade/fix/elastic_host
isobel-daley-6point6 Jul 9, 2024
1a170bf
fix: update elastic_host and elastic_password
isobel-daley-6point6 Jul 9, 2024
8ba6622
Merge pull request #7 from uktrade/fix/elastic_host
simonstrong-dbt Jul 9, 2024
43fb6d3
fix: remove default values in env files
isobel-daley-6point6 Jul 9, 2024
526431e
Merge pull request #8 from uktrade/fix/elastic_host
isobel-daley-6point6 Jul 9, 2024
ad702b1
fix: revert environment variable changes
isobel-daley-6point6 Jul 9, 2024
bffaf95
add hosts env variable
a-gleeson Jul 10, 2024
4304f21
Merge pull request #9 from uktrade/feat/hosts-configuration
isobel-daley-6point6 Jul 10, 2024
63e8724
hot fix deployment Prod
Jul 9, 2024
be74015
feat: modify HTML to reflect DBT-specific content
isobel-daley-6point6 Jul 10, 2024
6cd060f
fix: minor modifications to bring into line with dev
isobel-daley-6point6 Jul 10, 2024
94444e3
Merge pull request #10 from uktrade/feat/html_changes
isobel-daley-6point6 Jul 10, 2024
1b68c3e
fix: address html error in base.html
isobel-daley-6point6 Jul 10, 2024
ccf2726
Merge pull request #11 from uktrade/feat/html_changes
isobel-daley-6point6 Jul 10, 2024
28e917f
fix: fix feedback email address
isobel-daley-6point6 Jul 10, 2024
686e8e2
Merge pull request #12 from uktrade/feat/html_changes
isobel-daley-6point6 Jul 10, 2024
2039546
Merge branch 'dev' into feat/upgrade_gpt4
isobel-daley-6point6 Jul 11, 2024
f7434ea
Merge pull request #1 from uktrade/feat/upgrade_gpt4
isobel-daley-6point6 Jul 11, 2024
3ba1180
Merge pull request #14 from uktrade/dev
isobel-daley-6point6 Jul 11, 2024
cf6dd05
fix: remove register interest link
isobel-daley-6point6 Jul 11, 2024
102de62
Merge pull request #15 from uktrade/fix/remote_register_interest_link
isobel-daley-6point6 Jul 11, 2024
b022ce9
Merge pull request #16 from uktrade/dev
isobel-daley-6point6 Jul 11, 2024
9b9d3b4
Merge remote-tracking branch 'upstream/main' into upstream/embedding-…
a-gleeson Jul 12, 2024
e08a249
feat: automate the existing RAG notebooks into one script (#3)
nboyse Jul 17, 2024
7b6d1f8
feat: exploration - analysis of chat history and streamlit dashboard
esoutter Jul 19, 2024
e4d1a81
make User model configurable
a-gleeson Jul 19, 2024
180440a
WIP: Creating docker image for streamlit app
nboyse Jul 22, 2024
14e71f4
major WIP
nboyse Jul 22, 2024
9b34b79
chat history eda notebook added
emilylambert2 Jul 23, 2024
654d967
feat: automate the existing RAG notebooks into one script (#3)
nboyse Jul 17, 2024
b25e0c2
feat: exploration - analysis of chat history and streamlit dashboard
esoutter Jul 19, 2024
7ab64a4
WIP: Creating docker image for streamlit app
nboyse Jul 22, 2024
cd0b202
major WIP
nboyse Jul 22, 2024
63b526e
Merge branch 'dev' into feat/analysis-history-refactor
nboyse Jul 23, 2024
570e462
feat: make openAI model version configurable
isobel-daley-6point6 Jul 4, 2024
537095f
fix: remove auto-formatting changes
isobel-daley-6point6 Jul 4, 2024
b121c0d
fix: remove auto-formatting changes
isobel-daley-6point6 Jul 4, 2024
95b8c31
SSO integration with v0.4
Jul 9, 2024
b615bb6
feat:make elastic host and password configurable
isobel-daley-6point6 Jul 9, 2024
de216a5
fix: host updated to elastic_host
isobel-daley-6point6 Jul 9, 2024
0d5bfeb
fix: update elastic_host and elastic_password
isobel-daley-6point6 Jul 9, 2024
26ebb98
fix: remove default values in env files
isobel-daley-6point6 Jul 9, 2024
2a7f41e
fix: revert environment variable changes
isobel-daley-6point6 Jul 9, 2024
f92e751
add hosts env variable
a-gleeson Jul 10, 2024
d19c9c0
hot fix deployment Prod
Jul 9, 2024
9a42d5e
feat: modify HTML to reflect DBT-specific content
isobel-daley-6point6 Jul 10, 2024
d97347f
fix: minor modifications to bring into line with dev
isobel-daley-6point6 Jul 10, 2024
73690d2
fix: address html error in base.html
isobel-daley-6point6 Jul 10, 2024
5320864
fix: fix feedback email address
isobel-daley-6point6 Jul 10, 2024
5e29bd1
fix: remove register interest link
isobel-daley-6point6 Jul 11, 2024
4542bae
feat: automate the existing RAG notebooks into one script (#3)
nboyse Jul 17, 2024
134ecc0
feat: exploration - analysis of chat history and streamlit dashboard
esoutter Jul 19, 2024
3819ea3
chat log eda notebook added
emilylambert2 Jul 23, 2024
6fea88c
user usage over time and user name processing added
emilylambert2 Jul 23, 2024
ab95e89
restructure of dashboard to show stories
emilylambert2 Jul 23, 2024
1dbd921
linting
emilylambert2 Jul 23, 2024
ef64719
word frequency plots added to st dash
emilylambert2 Jul 23, 2024
5ed04b1
feat: add max_tokens paramter to openai ChatLiteLLM
isobel-daley-6point6 Jul 23, 2024
97a5768
Merge pull request #24 from uktrade/fix/remote_register_interest_link
isobel-daley-6point6 Jul 23, 2024
d530815
restrict to superuser only
nboyse Jul 25, 2024
3fd7bd5
Plot tidy
emilylambert2 Jul 25, 2024
6c3dc1a
adding missing packages
nboyse Jul 25, 2024
afe596b
Feat: Creating docker image for streamlit app (#22)
nboyse Jul 25, 2024
c993968
resolving merge conflicts
emilylambert2 Jul 25, 2024
da716d6
merged updated streamlit dashboard into dev
emilylambert2 Jul 26, 2024
b406b92
Merge pull request #23 from uktrade/feature/chat-log-eda
emilylambert2 Jul 26, 2024
56898fd
feat: add llm_max_tokens parameter to openAI function
isobel-daley-6point6 Jul 26, 2024
be5709c
Merge pull request #25 from uktrade/feat/add_llm_config
a-gleeson Jul 26, 2024
57998b6
fix: syntax correction and removing redundant logs
nboyse Jul 29, 2024
9e458ef
Merge branch 'main' into upstream/embedding-changes
a-gleeson Jul 31, 2024
6842104
poetry lock
a-gleeson Jul 31, 2024
765b855
temp dockerfile fix
a-gleeson Jul 31, 2024
7d9a0c6
docker file fix keeping layers (thanks Tash)
a-gleeson Aug 1, 2024
44a8b5f
Separating data transformations with plot generation, added anonymity…
emilylambert2 Aug 1, 2024
5cf3474
pin poetry plugin bundle
a-gleeson Aug 1, 2024
936ea75
Finalising tech debt issue
emilylambert2 Aug 1, 2024
4bb386f
Add commented instructions for difference between live and data dump
emilylambert2 Aug 1, 2024
137f329
Tidy code
emilylambert2 Aug 1, 2024
4254f6e
rmv duplicate notebook
emilylambert2 Aug 1, 2024
c4271ff
Merge pull request #29 from uktrade/feat/streamlit-dash-debt
emilylambert2 Aug 1, 2024
4d02efb
refactor chunk and embed process for 0.4
esoutter Aug 6, 2024
8728f2f
feat: automatically check for new releases by tag and create branch
isobel-daley-6point6 Aug 6, 2024
df623ad
fix: update uses to run
isobel-daley-6point6 Aug 6, 2024
e946243
fix: temporarily updating trigger to on push to test
isobel-daley-6point6 Aug 6, 2024
186e459
fix: update use of environment variables
isobel-daley-6point6 Aug 6, 2024
3670ea9
fix: adjust error in syntax
isobel-daley-6point6 Aug 6, 2024
e8afd77
feat: add branch tagging
isobel-daley-6point6 Aug 6, 2024
7138c95
fix: address command not found issue
isobel-daley-6point6 Aug 6, 2024
f32ddfc
fix: address command not found issue
isobel-daley-6point6 Aug 6, 2024
e359e80
fix: address command not found issue
isobel-daley-6point6 Aug 6, 2024
d0a9a69
fix: modify trigger for branch creation to schedule
isobel-daley-6point6 Aug 6, 2024
36c7bb5
fix: remove push trigger
isobel-daley-6point6 Aug 6, 2024
72cb072
Update README.md
nboyse Aug 8, 2024
dc0fd1b
Fix: update contributing.md (#32)
nboyse Aug 8, 2024
462530c
Merge branch 'main' into upstream/embedding-changes
a-gleeson Aug 9, 2024
33d9344
Merge branch 'dev' into upstream/embedding-changes
a-gleeson Aug 9, 2024
d1051b6
default hosts to ""
a-gleeson Aug 9, 2024
e7adfdb
Merge tag 'tags/0.5.0' into upstream/release-maple
a-gleeson Aug 9, 2024
d68e909
refactor chunk-embed for 0.4; update pass rates and plots
esoutter Aug 9, 2024
7a57bfe
Merge branch 'feat/sso--configurable-user-model' into upstream/releas…
a-gleeson Aug 9, 2024
e5ef549
revert to default values; update plot and table outputs
esoutter Aug 9, 2024
74f72af
move redundant imports
esoutter Aug 9, 2024
f7c7c12
user model updates
a-gleeson Aug 9, 2024
7824b57
update django lock
a-gleeson Aug 9, 2024
c63da32
test logs
a-gleeson Aug 9, 2024
6b7a84f
remove cache to see if it fixes worker
a-gleeson Aug 9, 2024
f0d4b35
test change comment out elastic cloud cluster
a-gleeson Aug 9, 2024
e46c9f8
change redbox reference and revert settings changes
a-gleeson Aug 9, 2024
50dabdb
updating poetry lock for worker
a-gleeson Aug 9, 2024
99e71a8
Merge pull request #39 from uktrade/upstream/release-maple
a-gleeson Aug 12, 2024
f93805f
default STREAMLIT_HOST
a-gleeson Aug 12, 2024
2dfff9f
remove conditional import
a-gleeson Aug 12, 2024
1034d28
comment out streamlit url as view delete :(
a-gleeson Aug 12, 2024
e25f0d1
User model clash work around
a-gleeson Aug 12, 2024
9a5824a
fix reference
a-gleeson Aug 12, 2024
2f56e69
fix Group reference
a-gleeson Aug 12, 2024
b72de03
Merge pull request #40 from uktrade/development
a-gleeson Aug 13, 2024
e1e80e2
Merge pull request #42 from uktrade/dev
a-gleeson Aug 13, 2024
79dc6c1
remove hard coding of user model
a-gleeson Aug 13, 2024
eb1e126
default login method to magic link
a-gleeson Aug 13, 2024
9d62a56
Merge pull request #48 from uktrade/fix/sso-integration
a-gleeson Aug 13, 2024
baafc96
fix user model reference
a-gleeson Aug 13, 2024
a42dddd
more references
a-gleeson Aug 13, 2024
a643700
update user model reference in admin
a-gleeson Aug 13, 2024
b9b7ac5
go back to one user model
a-gleeson Aug 13, 2024
15cc29d
add back sentence transformers embeddings
a-gleeson Aug 14, 2024
4053df6
add sentencetransformers as env option
a-gleeson Aug 14, 2024
1764f00
updating lock to pull in new redbox core?
a-gleeson Aug 14, 2024
a97c30a
using old sentence transformers implementation
a-gleeson Aug 14, 2024
e1a0b31
add env file for docker build stage
a-gleeson Aug 14, 2024
2d9cb74
hard code embedding model
a-gleeson Aug 14, 2024
e3996a8
add langchain community
a-gleeson Aug 14, 2024
c7938c2
fix nltk version
a-gleeson Aug 14, 2024
4b7123d
Merge pull request #50 from uktrade/fix/temp-fix-for-localai-issues
a-gleeson Aug 14, 2024
26ca5cd
Bump twisted from 24.3.0 to 24.7.0 in /notebooks (#47)
dependabot[bot] Aug 14, 2024
0ea7810
Bump aiohttp from 3.9.5 to 3.10.2 in /notebooks (#45)
dependabot[bot] Aug 14, 2024
7bf9b16
Bump django from 5.0.7 to 5.0.8 in /notebooks (#44)
dependabot[bot] Aug 14, 2024
8b05def
Bump nltk from 3.8.1 to 3.8.2 in /notebooks (#43)
dependabot[bot] Aug 14, 2024
fa7b3c1
Bump certifi from 2024.6.2 to 2024.7.4 in /django_app (#2)
dependabot[bot] Aug 14, 2024
4b5b31d
Merge pull request #30 from uktrade/feat/github_actions_track_upstream
isobel-daley-6point6 Aug 15, 2024
d47292c
release: Merge latest dev into main (#57)
nboyse Aug 16, 2024
c9701af
update comments
esoutter Aug 19, 2024
d48fa87
Merge pull request #36 from uktrade/feat/document_size_eval
esoutter Aug 19, 2024
3c82166
release: merge latest dev changes into main (#60)
nboyse Aug 20, 2024
1397339
change var to expect 'production'
Aug 21, 2024
7af9454
Merge pull request #64 from uktrade/fix/ga4-var
simonstrong-dbt Aug 21, 2024
43553c1
feat: uktrade .env file creation (#65)
nboyse Aug 21, 2024
0decf04
Adding PRODUCTION to Environment class
simonstrong-dbt Aug 21, 2024
4c9c823
Merge pull request #66 from uktrade/fix/env_key
simonstrong-dbt Aug 21, 2024
cddfc86
Adding context processor for variables
simonstrong-dbt Aug 21, 2024
b18d9a1
Merge pull request #67 from uktrade/fix/env_key
simonstrong-dbt Aug 21, 2024
8657213
Adding load_dotenv()
simonstrong-dbt Aug 21, 2024
91e4122
Merge pull request #68 from uktrade/fix/env_key
simonstrong-dbt Aug 21, 2024
799f3ba
missed a comma
simonstrong-dbt Aug 21, 2024
1a7ad1b
Merge pull request #69 from uktrade/fix/env_key
simonstrong-dbt Aug 21, 2024
7927859
moving file location
simonstrong-dbt Aug 21, 2024
fd45938
Merge pull request #70 from uktrade/fix/env_key
simonstrong-dbt Aug 21, 2024
8e3e95a
Fix: ensure jinja2 can pick up GA4 vars and remove context processors…
nboyse Aug 22, 2024
1dba4b2
fix: minor feature changes (#72)
nboyse Aug 22, 2024
30d0103
Fix/google analytics (#73)
nboyse Aug 22, 2024
6e0fb2e
Dev -> main release (#74)
nboyse Aug 22, 2024
01093bb
Bump nltk from 3.8.1 to 3.9 (#62)
dependabot[bot] Aug 23, 2024
0e401ee
add development as a support environment
a-gleeson Aug 27, 2024
92f17ee
add sandbox, environment
a-gleeson Aug 27, 2024
86a6d4e
Merge branch 'dev' into development
a-gleeson Aug 27, 2024
2403963
Merge pull request #76 from uktrade/development
a-gleeson Aug 28, 2024
f324d67
Added Password=None
simonstrong-dbt Sep 4, 2024
6c58ad4
added REPLACE_ME
simonstrong-dbt Sep 4, 2024
2e745ed
Merge pull request #79 from uktrade/feat/user-management-functions
simonstrong-dbt Sep 4, 2024
1fe039a
fix: summarise route not working (#80)
nboyse Sep 6, 2024
80db7d4
Merge pull request #82 from uktrade/dev
nboyse Sep 6, 2024
eeb65eb
fix: missing change to core-api
nboyse Sep 6, 2024
98d8801
Merge pull request #83 from uktrade/fix/accidental-uncommitted-change
nboyse Sep 6, 2024
18265f8
Merge pull request #84 from uktrade/dev
nboyse Sep 6, 2024
f81d823
Added FAQs and reorganised components on homepage
simonstrong-dbt Sep 11, 2024
0028e07
Merge pull request #88 from uktrade/feat/faq
simonstrong-dbt Sep 11, 2024
74cce8f
Updated poetry lock and included bucket creation locally
a-gleeson Sep 11, 2024
c771031
set up steps in readme and edits to get core-api unit tests working
a-gleeson Sep 11, 2024
2c65b2f
add defaults to analytics env vars
a-gleeson Sep 11, 2024
77caa7e
Unit tests and new coach route
a-gleeson Sep 11, 2024
41c429d
fix read me instructions
a-gleeson Sep 12, 2024
3763fc3
format output, improved guidance lines and question pass through
a-gleeson Sep 12, 2024
3cb906e
embedded faq advice, example response, and clear goal
a-gleeson Sep 12, 2024
dea8f05
new iteration of sys prompt and move prompt to settings
a-gleeson Sep 17, 2024
bec8d44
Merge pull request #93 from uktrade/feat/rb-170--coach-route
a-gleeson Sep 17, 2024
04b9f45
Adding FAQ page reachable from chats page
simonstrong-dbt Sep 18, 2024
7425a4b
Merge pull request #94 from uktrade/feat/advanced_prompt_faq
simonstrong-dbt Sep 18, 2024
2ed9202
Updated FAQ homepage and link to advanced FAQs
simonstrong-dbt Sep 20, 2024
e68808c
fix: api keys redacted in logs (#85)
nboyse Sep 24, 2024
48d3440
Merge pull request #95 from uktrade/feat/advanced_prompt_faq
simonstrong-dbt Sep 25, 2024
d781685
Merge pull request #98 from uktrade/dev
simonstrong-dbt Oct 8, 2024
92fdb42
dev -> main (#106)
nboyse Oct 21, 2024
96a3f02
fix: deprecated ntlk punk (#112)
nboyse Oct 29, 2024
35bb8db
fix: add missing migration and update nltk averaged_perceptron_tagger…
nboyse Oct 29, 2024
7bcf61e
feat: REDBOX-303 - update privacy notice (#117)
nboyse Nov 29, 2024
93ad826
fix: bug with frontend import (#118)
nboyse Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.django
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

ANTHROPIC_API_KEY=
OPENAI_API_KEY=
OPENAI_MODEL=
LLM_MAX_TOKENS=1024

# === Development ===
Expand Down
1 change: 1 addition & 0 deletions .env.docker_build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EMBEDDING_MODEL=all-mpnet-base-v2
80 changes: 80 additions & 0 deletions .env.uktrade
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
ANALYTICS_LINK=REPLACE_WITH_GITLAB_SECRET
ANALYTICS_TAG=REPLACE_WITH_GITLAB_SECRET

AUTHBROKER_CLIENT_ID=REPLACE_WITH_GITLAB_SECRET
AUTHBROKER_CLIENT_SECRET=REPLACE_WITH_GITLAB_SECRET
AUTHBROKER_URL=https://sso.trade.gov.uk

AWS_ACCESS_KEY=GET_FROM_AWS_ACCESS_PORTAL
AWS_SECRET_KEY=GET_FROM_AWS_ACCESS_PORTAL

AWS_REGION=eu-west-2

BUCKET_NAME=dbt-default

CHAT_BACKEND=openai

COMPRESSION_ENABLED=false

CONTACT_EMAIL=redbox@businessandtrade.gov.uk

CORE_API_PORT=5002
EMAIL_BACKEND_TYPE=CONSOLE
FROM_EMAIL=REPLACE_ME

DEV_MODE=false

DJANGO_SETTINGS_MODULE=redbox_app.settings
DEBUG=false
DJANGO_SECRET_KEY=REPLACE_WITH_GITLAB_SECRET
DJANGO_LOG_LEVEL=DEBUG

ELASTIC__HOST=elasticsearch.internal
ELASTIC__VERSION=8.11.0
ELASTIC__USER=elastic
ELASTIC__PASSWORD=REPLACE_WITH_GITLAB_SECRET
ELASTIC__PORT=9200
ELASTIC__SCHEME=http

EMBEDDING_MODEL=all-mpnet-base-v2
EMBEDDING_BACKEND=sentencetransformers
EMBEDDING_OPENAI_MODEL=all-mpnet-base-v2

EMBED_QUEUE_NAME=redbox-embedder-queue

ENVIRONMENT=DEV

FILE_EXPIRY_IN_DAYS=30

INGEST_QUEUE_NAME=redbox-ingester-queue

LLM_MAX_TOKENS=4096

LOGIN_METHOD=sso

OBJECT_STORE=s3

OPENAI_API_KEY=REPLACE_WITH_GITLAB_SECRET
OPENAI_MODEL=gpt-4o-mini

POSTGRES_DB=redbox
POSTGRES_PASSWORD=REPLACE_WITH_GITLAB_SECRET
POSTGRES_USER=postgres

REDIS_PORT=6379

USE_STREAMING=false

MAX_SECURITY_CLASSIFICATION=OFFICIAL

SESSION_COOKIE_SECURE=false

SUPERUSER_EMAIL=isobel.daley@digital.trade.gov.uk

REPO_OWNER=uktrade

WORKER_INGEST_MAX_CHUNK_SIZE=600
WORKER_INGEST_MIN_CHUNK_SIZE=400

ANALYTICS_TAG=REPLACE_WITH_GITLAB_SECRET
ANALYTICS_LINK=REPLACE_WITH_GITLAB_SECRET
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
- [ ] I have added any new ENV vars in all deployed environments
- [ ] I have tested any code added or changed
- [ ] I have run integration tests
- [ ] I have added/updated any DBT specific changes to .env.uktrade
37 changes: 37 additions & 0 deletions .github/workflows/pull-upstream-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Detect upstream release

on:
schedule:
- cron: '0 8 * * *' # run every day at 8am
workflow_dispatch:

jobs:
check-upstream-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Fetch upstream release_version
run: |
git remote add upstream https://github.com/i-dot-ai/redbox.git
git fetch upstream --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for new release tag
id: check_tag
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag: $latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_ENV

- name: Create new branch if new release found
if: github.event_name == 'schedule'
run: |
branch_name=upstream/release-${{ env.latest_tag }}
echo branch_name: $branch_name
git checkout -b $branch_name
git push origin $branch_name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
cp .env.test worker/.env
cd worker
poetry install
poetry run python -m nltk.downloader punkt
poetry run python -m nltk.downloader punkt_tab
poetry run pytest --cov=worker -v --cov-report=term-missing --cov-fail-under=80

test-redbox:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,7 @@ django_app/tests/staticfiles
infrastructure/aws/cleanup_lambda/*.zip
infrastructure/aws/cleanup_lambda/layer/*


# chat history files and personal data
*chat_history_*
notebooks/evaluation/results
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ rebuild: stop prune ## Rebuild all images
docker compose build --no-cache

.PHONY: test-core-api
test-core-api: ## Test core-api
test-core-api: stop ## Test core-api
docker compose up -d --wait elasticsearch minio
cp .env.test core-api/.env
cd core-api && poetry install --with dev && poetry run python -m pytest -m "not ai" --cov=core_api -v --cov-report=term-missing --cov-fail-under=75

Expand Down Expand Up @@ -124,15 +125,17 @@ docs-build: ## Build documentation
poetry run mkdocs build

# Docker
AWS_ACCOUNT_ID=REPLACE_ME

AWS_REGION=eu-west-2
APP_NAME=redbox
APP_NAME=dbt
ECR_URL=$(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
ECR_REPO_URL=$(ECR_URL)/$(ECR_REPO_NAME)
IMAGE=$(ECR_REPO_URL):$(IMAGE_TAG)
IMAGE=latest

ECR_REPO_NAME=$(APP_NAME)
PREV_IMAGE_TAG=$$(git rev-parse HEAD~1)
IMAGE_TAG=$$(git rev-parse HEAD)
PREV_IMAGE_TAG=latest
IMAGE_TAG=latest

tf_build_args=-var "image_tag=$(IMAGE_TAG)"
DOCKER_SERVICES=$$(docker compose config --services | grep -v mlflow)
Expand Down Expand Up @@ -169,7 +172,7 @@ docker_build: ## Build the docker container
PREV_IMAGE="$(ECR_REPO_URL)-$$service:$(PREV_IMAGE_TAG)"; \
echo "Pulling previous image: $$PREV_IMAGE"; \
docker pull $$PREV_IMAGE; \
docker compose build $$service; \
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose build $$service; \
else \
echo "Skipping $$service uses default image"; \
fi; \
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Redbox is a retrieval augmented generation (RAG) app that uses GenAI to chat wit
- **Better retrieval**. Redbox increases organisational memory by indexing documents
- **Faster, accurate summarisation**. Redbox can summarise reports read months ago, supplement them with current work, and produce a first draft that lets civil servants focus on what they do best


https://github.com/i-dot-ai/redbox-copilot/assets/8233643/e7984242-1403-4c93-9e68-03b3f065b38d

# Setup
Expand Down Expand Up @@ -90,7 +89,7 @@ redbox/

# Contributing

We welcome contributions to this project. Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) file for more information.
We welcome contributions to this project. Please see the [CONTRIBUTING.md](./docs/contributing.md) file for more information.

# License

Expand Down Expand Up @@ -184,9 +183,9 @@ On initial app setup you will need to run `poetry run python manage.py collectst

checkout the `main` branch of the following repos:

* https://github.com/i-dot-ai/redbox
* https://github.com/i-dot-ai/i-ai-core-infrastructure/
* https://github.com/i-dot-ai/redbox-copilot-infra-config
- https://github.com/i-dot-ai/redbox
- https://github.com/i-dot-ai/i-ai-core-infrastructure/
- https://github.com/i-dot-ai/redbox-copilot-infra-config

If, and only if, you want to deploy something other than HEAD then replace `var.image_tag` in `infrastructure/aws/ecs.tf` with the hash of the build you want deployed.

Expand All @@ -197,3 +196,13 @@ cd redbox
make tf_init
make tf_apply env=<ENVIRONMENT>
```

Local set up for DBT

```
cp .env.uktrade .env
docker compose build
docker compose up -d
docker compose exec django-app bash
venv/bin/django-admin createsuperuser
```
5 changes: 4 additions & 1 deletion core-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM python:3.12-bookworm as builder
FROM python:3.12-bookworm AS builder

RUN apt-get update && apt-get install --yes build-essential curl > /dev/null

# Add redbox python package and install it with poetry
ADD redbox-core/ /app/redbox-core
ADD core-api/ /app/core-api
ADD README.md /app/README.md
ADD download_embedder.py /app/

WORKDIR /app/core-api

RUN pip install poetry
RUN poetry install

RUN type=cache poetry run python ../download_embedder.py --embedding_model "all-mpnet-base-v2"

# Run FastAPI
EXPOSE 5002
CMD ["poetry", "run", "uvicorn", "core_api.app:app", "--host", "0.0.0.0", "--port", "5002"]
Loading
Loading