Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Mar 23, 2023
1 parent 28ecce1 commit 6f8daaf
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 46 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
/core/ff_fasttext/*.so
__pycache__
*.egg-info
/taxonomy.json
Dockerfile
*.whl
*.tar.gz
.mypy_cache
.idea
/cache.json
.env
.vscode
.vscode
File renamed without changes.
46 changes: 4 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,17 @@ A Rust microservice to match queries on the ONS Website to groupings in the ONS

#### Set up taxonomy.json

This should be obtained from ONS and placed in the root directory.
This should be adapted from the taxonomy.json.example and placed in the root directory.

#### Download or create embeddings

These are most simply sourced as [pretrained fifu models](https://finalfusion.github.io/pretrained), but can be dynamically generated
using the embedded FinalFusion libraries.

To build and run the API using docker:

```
make run
```

or, for Welsh,

```
make run-cy
```

To build wheels for distribution, use:

```
make wheels
make
```

### Manual building
Expand All @@ -41,35 +29,9 @@ make wheels

2. make wheels

3. you need `m4` in order to generate the local dockerfile - `sudo apt-get m4` or equivalent

4. example `CONTAINER_IMAGE, IMAGE_LATEST_TAG, IMAGE_SHA_TAG` are provided in the Makefile,
```
CONTAINER_IMAGE: $CI_REGISTRY_IMAGE:build-$CI_PIPELINE_ID
IMAGE_LATEST_TAG: $CI_REGISTRY_IMAGE:latest
IMAGE_SHA_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
```
This is how they're created, make sure you've got the latest tags.

5. `make build` will generate a dockerfile and build it.

6. make sure you've placed taxonomy.json in the root folder (This should be obtained from ONS).

7. you need an elasticsearch container forwarded to port:9200 (you can customize the port in .env) with a specific dump (also provided by ONS) `https://gitlab.com/flaxandteal/onyx/dp-search-api` in this readme you can checkout how to setup elasticsearch.
If you have access to f&t `gke_everything-219816_europe-west2-a_everything-1` cluster you can go

```shell
kubectl -n fat-ony-dev get pods
kubectl -n fat-ony-dev port-forward elasticsearch-master-0 9200:9200
```
elasticsearch-master-0 is the pod name at the time of writing.

<br><br>8. make run - will build everything, and run it on :80

#### Docker-compose setup
2. make sure you've placed taxonomy.json in the root folder (This should be obtained from ONS).

1. For now you'll have to set up all of the projects to running stage. To do that go through all of the readme's.
2. after everything is setup, you can start the whole alpha project with all of the included microservices 1using `docker-compose up`
3. [TODO: genericize] you need an elasticsearch container forwarded to port:9200 (you can customize the port in .env) with a dump matching the appropriate schema `https://gitlab.com/flaxandteal/onyx/dp-search-api` in this readme you can checkout how to setup elasticsearch.


#### Install finalfusion utils
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[project]
name = "bonn"
version = "0.0.2"
version = "0.1.0"
description = "Created for ONS. Proof-of-concept mmap'd Rust word2vec implementation linked with category matching"
license = { "file" = "LICENSE" }
license = { "file" = "LICENSE.md" }
authors = [
{ "name" = "Chris Nixon", "email" = "[email protected]" },
{ "name" = "Phil Weir", "email" = "[email protected]" }
Expand Down
111 changes: 111 additions & 0 deletions taxonomy.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"topics": [
{
"title": "Business, industry and trade",
"filterable_title": "businessindustryandtrade",
"child_topics": [
{
"title": "Business",
"filterable_title": "business",
"child_topics": [
{
"title": "Actions",
"filterable_title": "actions"
},
{
"title": "Building, and maintenance",
"filterable_title": "buildingandmaintenance"
},
{
"title": "Commercialization",
"filterable_title": "commercialization"
}
]
},
{
"title": "Changes to business",
"filterable_title": "changestobusiness",
"child_topics": [
{
"title": "Ups/downs",
"filterable_title": "upsdowns"
},
{
"title": "Lefts & Rights",
"filterable_title": "leftsrights"
},
{
"title": "Open and shut",
"filterable_title": "openandshut"
}
]
},
{
"title": "Construction industry",
"filterable_title": "constructionindustry"
},
{
"title": "International trade",
"filterable_title": "internationaltrade"
},
{
"title": "IT and internet industry",
"filterable_title": "itandinternetindustry"
},
{
"title": "Manufacturing and production industry",
"filterable_title": "manufacturingandproductionindustry"
},
{
"title": "Retail industry",
"filterable_title": "retailindustry"
},
{
"title": "Tourism industry",
"filterable_title": "tourismindustry"
}
]
},
{
"title": "Economy",
"filterable_title": "economy",
"child_topics": [
{
"title": "Foo Bar",
"filterable_title": "foobar",
"child_topics": [
{
"title": "Baz",
"filterable_title": "baz"
},
{
"title": "B i f",
"filterable_title": "bif"
},
{
"title": "Boz",
"filterable_title": "boz"
}
]
},
{
"title": "Fizz",
"filterable_title": "fizz"
},
{
"title": "Fizz Buzz",
"filterable_title": "fizzbuzz",
"child_topics": [
{
"title": "frump",
"filterable_title": "frump"
},
{
"title": "flim flam",
"filterable_title": "flimflam"
}
}
]
}
]
}

0 comments on commit 6f8daaf

Please sign in to comment.