You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generate-perftest-permissions: ## Generate perftest permissions and add to nrlf_permissions
253
-
poetry run python tests/performance/producer/generate_permissions.py --output_dir="$(DIST_PATH)/nrlf_permissions/K6PerformanceTest"
256
+
perftest-generate-permissions: ## Generate perftest permissions and add to nrlf_permissions
257
+
PYTHONPATH=. poetry run python tests/performance/producer/generate_permissions.py --output_dir="$(DIST_PATH)/nrlf_permissions/K6PerformanceTest"
254
258
255
-
perftest-producer:
259
+
perftest-seed-tables: ## Seed tables and upload generated perftest input files to s3
260
+
@echo "Seeding performance test pointer tables with ENV=$(ENV) and PERFTEST_TABLE_NAME=$(PERFTEST_TABLE_NAME) and PERFTEST_PATIENTS_WITH_POINTERS=$(PERFTEST_PATIENTS_WITH_POINTERS) and PERFTEST_POINTERS_PER_PATIENT=$(PERFTEST_POINTERS_PER_PATIENT) and PERFTEST_TYPE_DIST_PROFILE=$(PERFTEST_TYPE_DIST_PROFILE) and PERFTEST_CUSTODIAN_DIST_PROFILE=$(PERFTEST_CUSTODIAN_DIST_PROFILE)"
261
+
rm -rf "${DIST_PATH}/nft"
262
+
mkdir -p "${DIST_PATH}/nft"
263
+
PYTHONPATH=. poetry run python ./scripts/seed_nft_tables.py --table_name=$(PERFTEST_TABLE_NAME) --patients_with_pointers=$(PERFTEST_PATIENTS_WITH_POINTERS) --pointers_per_patient=$(PERFTEST_POINTERS_PER_PATIENT) --type_dist_profile=$(PERFTEST_TYPE_DIST_PROFILE) --custodian_dist_profile=$(PERFTEST_CUSTODIAN_DIST_PROFILE)
264
+
zip -r "${DIST_PATH}/pointer_extract-${PERFTEST_TABLE_NAME}.zip""${DIST_PATH}/nft"
Copy file name to clipboardExpand all lines: tests/performance/README.md
+37-15Lines changed: 37 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,13 @@ We have performance tests which give us a benchmark of how NRLF performs under l
8
8
9
9
Perf tests are generally conducted in the perftest env. There's a selection of tables in the perftest env representing different pointer volume scenarios e.g. perftest-baseline vs perftest-1million (todo: update with real names!).
10
10
11
+
#### Pull certs for perftest
12
+
13
+
```sh
14
+
assume nhsd-nrlf-mgmt
15
+
make truststore-pull-all ENV=perftest
16
+
```
17
+
11
18
#### Point perftest at a different pointers table
12
19
13
20
We (will) have multiple tables representing different states of NRLF in the future e.g. all patients receiving an IPS (International Patient Summary), onboarding particular high-volume suppliers.
@@ -29,44 +36,37 @@ Currently, this requires tearing down the existing environment and restoring fro
29
36
2. once backed up, delete your table. In the AWS console: dynamodb > tables > your perftest table > actions > delete table
30
37
3. Rerun the Deploy Account-wide infrastructure action.
31
38
4. Terraform will create an empty table with the correct name & (most importantly!) read/write IAM policies.
32
-
5. Delete the empty table created by terraform and restore from the backup, specifying the same table name you've defined in code.
39
+
5. Delete the empty table created by terraform and restore from the backup, specifying the same table name you've defined in code & selecting the matching customer managed encryption key.
33
40
6. Run the [Persistent Environment Deploy](https://github.com/NHSDigital/NRLF/actions/workflows/persistent-environment.yml) workflow against your branch & `perftest` to restore the environment with lambdas pointed at your chosen table.
34
41
7. You can check this has been successful by checking the table name in the lambdas.
35
42
- In the AWS console: Lambda > functions > pick any perftest-1 lambda > Configuration > Environment variables > `TABLE_NAME` should be your desired pointer table e.g. `nhsd-nrlf--perftest-baseline-pointers-table`
36
43
37
44
If you've followed these steps, you will also need to [generate permissions](#generate-permissions) as the organisation permissions will have been lost when the environment was torn down.
38
45
39
-
### Prepare to run tests
40
-
41
-
#### Pull certs for perftest
42
-
43
-
```sh
44
-
assume management
45
-
make truststore-pull-all ENV=perftest
46
-
```
47
-
48
46
#### Generate permissions
49
47
50
48
You will need to generate pointer permissions the first time performance tests are run in an environment e.g. if the perftest environment is destroyed & recreated.
51
49
52
50
```sh
53
51
# In project root
54
-
make generatepermissions # makes a bunch of json permission files for test organisations
52
+
make perftest-generate-permissions # makes a bunch of json permission files for test organisations
55
53
make build # will take all permissions & create nrlf_permissions.zip file
56
54
57
55
# apply this new permissions zip file to your environment
58
56
cd ./terraform/infrastructure
59
-
assume nhsd-nrlf-test
57
+
assume nhsd-nrlf-mgmt
60
58
make init TF_WORKSPACE_NAME=perftest-1 ENV=perftest
61
59
make ENV=perftest USE_SHARED_RESOURCES=true apply
62
60
```
63
61
64
-
#### Generate input files
62
+
### Prepare to run tests
63
+
64
+
Prepare input files
65
65
66
66
```sh
67
67
assume nhsd-nrlf-test
68
-
#creates 2 csv files and a json file
69
-
make perftest-prepare PERFTEST_TABLE_NAME=perftest-baseline
68
+
#PERFTEST_TABLE_NAME = pointer table currently pointed to by perftest env
69
+
make perftest-prepare PERFTEST_TABLE_NAME=nhsd-nrlf--perftest-baseline-pointers-table ENV=perftest
70
70
```
71
71
72
72
### Run tests
@@ -76,6 +76,28 @@ make perftest-consumer ENV_TYPE=perftest PERFTEST_HOST=perftest-1.perftest.recor
76
76
make perftest-producer ENV_TYPE=perftest PERFTEST_HOST=perftest-1.perftest.record-locator.national.nhs.uk
77
77
```
78
78
79
+
## Seed data
80
+
81
+
Must be run on an empty table. Cannot top up an existing set of pointers.
Regenerates the input files from the current state of a given perftest table & uploads files to s3. These files are usually generated at the end of the seed tables make command (above).
93
+
94
+
> Note: this can be an expensive operation for large table sizes.
0 commit comments