Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
655 commits
Select commit Hold shift + click to select a range
da2cf75
use optimised png if exists
ellenmuller Mar 6, 2026
19aa558
don't remove lastModified
ellenmuller Mar 6, 2026
3f60c2f
add test logging
ellenmuller Mar 6, 2026
e75e1e2
Bump immutable from 3.8.2 to 3.8.3 in /kahuna
dependabot[bot] Mar 6, 2026
b84a228
Merge pull request #4653 from guardian/js-use-grant-read-for-s3-access
joelochlann Mar 9, 2026
c623d72
derive embedder S3 bucket, key, and mime type from stored image asset
ellenmuller Mar 11, 2026
27eefd0
Merge branch 'main' of github.com:guardian/grid into em-write-embeddi…
ellenmuller Mar 11, 2026
d1c5fac
define client each handler invocation
ellenmuller Mar 11, 2026
e664239
improve comment
ellenmuller Mar 11, 2026
77dbad1
log how long it takes to initialise bedrock runtime client
ellenmuller Mar 11, 2026
121956e
Merge pull request #4662 from guardian/em-reinitialise-bedrock-client
ellenmuller Mar 11, 2026
eeb2ea9
pull in main
ellenmuller Mar 11, 2026
d4b1846
action comments
ellenmuller Mar 11, 2026
b853782
action comments
ellenmuller Mar 11, 2026
5ec1827
Merge pull request #4631 from guardian/em-write-embedding-to-es
ellenmuller Mar 11, 2026
25bee84
Merge pull request #4659 from guardian/dependabot/npm_and_yarn/kahuna…
andrew-nowak Mar 12, 2026
16c4db4
pull in main
ellenmuller Mar 12, 2026
810c5eb
fix queueImageToEmbed
ellenmuller Mar 12, 2026
eace8f2
refactor S3 vector store methods
ellenmuller Mar 13, 2026
b1c3298
Move models out of the index
alexduf Mar 16, 2026
88148d2
increase topk to 100
ellenmuller Mar 17, 2026
a89a27c
Separate image fetching concepts
alexduf Mar 16, 2026
ed7eb5b
Extract the image resizing logic
alexduf Mar 17, 2026
2b76e39
Extract image embedder and thrall event publisher out of index.ts
alexduf Mar 17, 2026
902e8ba
Extract the S3 vector logic out
alexduf Mar 17, 2026
cdb206f
Reorganise the wiring to be more logical
alexduf Mar 17, 2026
4ea5a6b
Fix test utils
alexduf Mar 17, 2026
49aa90b
remove use ai search from setandwatch
ellenmuller Mar 17, 2026
48a51fd
remove relevance logic
ellenmuller Mar 17, 2026
4f46ce8
use null instead of undefined to clear useAISearch URL param
ellenmuller Mar 17, 2026
9c5aee8
move more like this behind feature switch
ellenmuller Mar 17, 2026
e3fd024
tidy up
ellenmuller Mar 18, 2026
e485408
bump jackson to 2.21 for dos vuln remediation
andrew-nowak Mar 4, 2026
a6af5b9
Bump GuCDK
bryophyta Mar 19, 2026
f5a899b
Merge pull request #4654 from guardian/an/jackson-2.21
andrew-nowak Mar 19, 2026
a466052
Update svgo config to use new API: https://svgo.dev/docs/migrations/m…
bryophyta Mar 19, 2026
d949b5c
Bump AWS SDK
bryophyta Mar 19, 2026
642e566
Merge pull request #4668 from guardian/pf/cdk-upgrade
bryophyta Mar 19, 2026
4a6ec49
Merge pull request #4644 from guardian/dependabot/npm_and_yarn/kahuna…
bryophyta Mar 19, 2026
f78b487
refactor into for yield and add image ids case class
ellenmuller Mar 20, 2026
cf40893
refactor get vector by image id to case match statement
ellenmuller Mar 20, 2026
d6edd17
remove Future try for blocking call and just wrap in a Try instead
ellenmuller Mar 20, 2026
bf717cd
Merge branch 'main' of github.com:guardian/grid into em-image-to-imag…
ellenmuller Mar 20, 2026
6c4b670
tighten the collection regex
andrew-nowak Mar 20, 2026
9196b0e
fix type error
ellenmuller Mar 20, 2026
a58b7d1
Update kahuna/public/js/components/gr-more-like-this/gr-more-like-thi…
ellenmuller Mar 20, 2026
afeb2d9
Merge pull request #4666 from guardian/adu-restructure-image-embedder-2
alexduf Mar 23, 2026
0581558
Merge pull request #4669 from guardian/pf/bump-aws-sdk
bryophyta Mar 23, 2026
668ca90
Merge pull request #4673 from guardian/an/regex-tighten
andrew-nowak Mar 23, 2026
c43a5be
Adds the telemetry tracking pixel via a script in the main twirl temp…
SHession Mar 19, 2026
0d28e7b
Add telemetry uri to image src CSP
SHession Mar 19, 2026
1966cd1
Tracking loadedPageUri using pathname to avoid detecting filter chang…
SHession Mar 24, 2026
10e4019
Update common-lib/src/main/scala/com/gu/mediaservice/lib/aws/S3Vector…
ellenmuller Mar 24, 2026
0ee53b7
Merge pull request #4667 from guardian/sh/add-telemetry-tracking-pixe…
SHession Mar 24, 2026
6c75cb3
pull in main
ellenmuller Mar 24, 2026
4cc8c5c
Merge pull request #4554 from guardian/em-image-to-image-similarity
ellenmuller Mar 24, 2026
ccfd7f1
Update dependencies
alexduf Mar 23, 2026
efbebd9
Re-organise folders
alexduf Mar 23, 2026
3a9b9fc
Re-organise folders
alexduf Mar 23, 2026
c9b3061
Hello world + bundling
alexduf Mar 23, 2026
e48ff0f
Wire the backfill lambda
alexduf Mar 23, 2026
9c9492a
Add a oneliner in the docs
alexduf Mar 23, 2026
212ac62
Fix name collision
alexduf Mar 24, 2026
7b7ad9e
Update riff-raff.yaml
alexduf Mar 24, 2026
f1798bd
Merge pull request #4645 from guardian/remove-s3watcher
twrichards Mar 26, 2026
5a876eb
add ability to optionally sample a percentage of images to a lower en…
twrichards Oct 10, 2025
b0a5b88
update to use regular config rather than env var
andrew-nowak Mar 26, 2026
50107ef
Taking PR comments into account
alexduf Mar 26, 2026
2ddb197
Merge branch 'main' into adu-vector-backfill
alexduf Mar 26, 2026
4bf932e
Update cdk tests after merge
alexduf Mar 26, 2026
8670138
Merge pull request #4677 from guardian/adu-vector-backfill
alexduf Mar 27, 2026
35d573b
Implement fetching and queuing logic
alexduf Mar 25, 2026
16fe9a3
Implement local stack
alexduf Mar 25, 2026
cf34d60
Move local run to embedder folder
alexduf Mar 30, 2026
70fff9c
Move embedder specific localRun.ts
alexduf Mar 25, 2026
f71f156
Implement a localRun
alexduf Mar 26, 2026
3f85d03
Add tests
alexduf Mar 26, 2026
4ee0655
Update cdk snapshot and package-lock after rebase
alexduf Mar 27, 2026
a9ed7de
Fix linting errors
alexduf Mar 27, 2026
485c48d
Grant the missing sqs permissions to the backfiller
alexduf Mar 27, 2026
53db0ee
Add sourcemap support to have proper stack traces
alexduf Mar 27, 2026
3d7f1f1
Add better errors and debugging
alexduf Mar 27, 2026
3d367fd
Set env variables before importing handler
alexduf Mar 27, 2026
d401a07
Spawn lambda from within VPC
alexduf Mar 30, 2026
4f7302e
Get rid of Environment variable injection
alexduf Mar 30, 2026
f2d49e5
don't skip prod
ellenmuller Mar 31, 2026
d1a25ea
Wire the execution id as the random seed
alexduf Mar 31, 2026
3bb0aa1
Take review into account
alexduf Mar 31, 2026
488a9d4
Merge pull request #4542 from guardian/percentage-sampling-to-lower-e…
andrew-nowak Apr 1, 2026
6214ece
Override the version of netty to use fixed vuln
lindseydew Apr 1, 2026
c3d907d
Use dependency rather than dependencyOverrides
lindseydew Apr 1, 2026
a4653d9
Upgrade to the latest version of amazon sdk
lindseydew Apr 1, 2026
da0655e
Merge pull request #4693 from guardian/ld/fix-netty-vuln
andrew-nowak Apr 2, 2026
d088094
Merge pull request #4691 from guardian/em-write-to-es-prod
ellenmuller Apr 2, 2026
a131ca6
s3 vectors doesn't have localstack yet, and set aws_profile env var i…
ellenmuller Apr 2, 2026
776fbe0
Disable schedule
alexduf Apr 2, 2026
a972a6a
embed with cohere v4, max dimensions
ellenmuller Apr 2, 2026
545147b
reduce max pixels to 30_000 and check if cached image is below this (…
ellenmuller Apr 2, 2026
9dcf6bf
Bump lodash from 4.17.23 to 4.18.1 in /kahuna
dependabot[bot] Apr 2, 2026
41ae90d
Add cohere v4 mapping
alexduf Mar 31, 2026
e848639
Add support for embed v4 in Thrall
alexduf Apr 2, 2026
d72b9ef
Merge pull request #4689 from guardian/adu-vector-backfill-2
alexduf Apr 6, 2026
47e0b64
Merge branch 'main' into adu-support-cohere-v4
alexduf Apr 6, 2026
3abfe5c
Point backfiller to cohereEmbedV4
alexduf Apr 6, 2026
cb1afaf
only write 256 dimensions to ES
ellenmuller Apr 7, 2026
6b38b15
update embedding message points to v4 from the lambda side
ellenmuller Apr 7, 2026
11e408b
cdk new vector bucket and index now in eu-west-1
ellenmuller Apr 7, 2026
4089c26
update vector bucket
ellenmuller Apr 7, 2026
da5696c
Merge pull request #4692 from guardian/adu-support-cohere-v4
alexduf Apr 7, 2026
62a6525
merge in main
ellenmuller Apr 7, 2026
6b029af
remove the cloudfront sdk
andrew-nowak Apr 7, 2026
deb8bcd
write to v4 with updateEmbedding thrall message
ellenmuller Apr 8, 2026
2905aa3
add tags to index
ellenmuller Apr 8, 2026
f191377
sort imports
ellenmuller Apr 8, 2026
87007ff
lowercase bucket name
ellenmuller Apr 8, 2026
7110a87
Bump fast-xml-parser and @aws-sdk/xml-builder in /cdk
dependabot[bot] Apr 9, 2026
b6e1ac1
Merge pull request #4695 from guardian/dependabot/npm_and_yarn/kahuna…
andrew-nowak Apr 9, 2026
0b10ef4
Merge pull request #4699 from guardian/dependabot/npm_and_yarn/cdk/mu…
andrew-nowak Apr 9, 2026
ca6a7fa
rename from cohere embed english v4 to cohere embed v4
ellenmuller Apr 9, 2026
f6e520f
use eu-west-1 and write 1536 dimensions to s3 vs
ellenmuller Apr 9, 2026
0d56d3f
fix downscale logic issue
ellenmuller Apr 9, 2026
a289fa3
don't add the tags
ellenmuller Apr 9, 2026
aed781b
Implement ai search tracking
alexduf Apr 9, 2026
2e5e8f0
Only backfill free images
alexduf Apr 10, 2026
ad9f332
sort out cdk permissions etc
ellenmuller Apr 10, 2026
f3758e5
Merge branch 'main' of github.com:guardian/grid into em-embed-with-v4
ellenmuller Apr 10, 2026
1edc058
remove partialembedding class because we don't actually need it
ellenmuller Apr 10, 2026
1acff47
tidy up
ellenmuller Apr 10, 2026
24b41f4
Merge pull request #4694 from guardian/em-embed-with-v4
ellenmuller Apr 10, 2026
5d3da4c
use arn attribute to enforce dependency between bucket and index
andrew-nowak Apr 10, 2026
074b7db
Merge pull request #4704 from guardian/an/vb-dependencies
andrew-nowak Apr 10, 2026
b7204b3
Merge branch 'main' into adu-non-free-to-use-backfill
alexduf Apr 10, 2026
e2efcef
Merge branch 'main' into adu-ai-telemetry
alexduf Apr 10, 2026
0f9a152
Complete exclusion list
alexduf Apr 10, 2026
bb8c1c2
Merge pull request #4701 from guardian/adu-ai-telemetry
alexduf Apr 13, 2026
531d667
Merge branch 'main' into adu-non-free-to-use-backfill
alexduf Apr 13, 2026
0b5b151
Merge pull request #4703 from guardian/adu-non-free-to-use-backfill
alexduf Apr 14, 2026
b85cfde
Enable backfilling every minute
alexduf Apr 13, 2026
8951023
Adjust batch size
alexduf Apr 13, 2026
9cb39ee
Increase concurrency
alexduf Apr 13, 2026
f74dfc7
Fix FD leak: Limit each connection pool to 5 connections each
alexduf Apr 14, 2026
6af834d
Update aws sdk
alexduf Apr 14, 2026
566e671
Disable backfilling in TEST
alexduf Apr 14, 2026
9941cd3
Merge pull request #4705 from guardian/adu-enable-backfill
alexduf Apr 15, 2026
abf7250
Slightly increase the backfill rate
alexduf Apr 15, 2026
b6b211f
Merge pull request #4706 from guardian/adu-increase-backfill-rate
alexduf Apr 15, 2026
de6069a
merge divergent branches
AndyKilmory Apr 16, 2026
a8aad08
Disable backfill
alexduf Apr 20, 2026
9abc1a5
Merge branch 'main' into adu-disable-backfill
alexduf Apr 20, 2026
7324ec5
use v4
ellenmuller Apr 20, 2026
2d171cd
it compiles
ellenmuller Apr 20, 2026
81f8043
Merge pull request #4707 from guardian/adu-disable-backfill
alexduf Apr 20, 2026
a2f003c
set k to 100
ellenmuller Apr 20, 2026
f969411
do not poll for knn search
ellenmuller Apr 20, 2026
66dd04b
tidy up
ellenmuller Apr 20, 2026
06788aa
introduce similar search and text search sealed traits
ellenmuller Apr 21, 2026
cc24f31
add images like this back in
ellenmuller Apr 21, 2026
516973f
Merge branch 'main' of github.com:guardian/grid into em-semantic-sear…
ellenmuller Apr 21, 2026
9b8ec0d
split off into different functions
ellenmuller Apr 21, 2026
b2a77c7
big tidy up and removing unsused s3 vectors code
ellenmuller Apr 21, 2026
d15c655
remove unused bits
ellenmuller Apr 21, 2026
60e86d2
Merge pull request #4698 from guardian/an/remove-cloudfront-sdk
andrew-nowak Apr 22, 2026
fc48b5b
correctly generate the full thumbnail url
andrew-nowak Apr 22, 2026
ca0d11d
Merge pull request #4709 from guardian/an/correct-formatted-thumb-url
andrew-nowak Apr 22, 2026
adb55ea
UI Changes to introduce Published/Unpublished differentiation for Cap…
AndyKilmory Apr 22, 2026
81eec00
Update ReaperController.scala
AndyKilmory Apr 22, 2026
e6a9216
add pagination
ellenmuller Apr 23, 2026
68fc2b1
pull in main
ellenmuller Apr 23, 2026
4f8c0d5
Fix AI search bootstrap pagination in Kahuna and Media API
ellenmuller Apr 23, 2026
29ed10f
Improve AI search pagination with bounded KNN window and fix totalHit…
ellenmuller Apr 23, 2026
5fdefe4
cache query text embedding
ellenmuller Apr 24, 2026
9c493ff
Fix multiple search calls
alexduf Apr 23, 2026
dd3933d
Fix scroll position
alexduf Apr 24, 2026
7a494b8
remove some superfluous comments
ellenmuller Apr 27, 2026
f533683
sort comments
ellenmuller Apr 27, 2026
3ac2511
Reformat everything with prettier
alexduf Apr 22, 2026
43977b9
Fix dimension count
alexduf Apr 22, 2026
006b2da
Transform the downscale integration test into a unit test
alexduf Apr 29, 2026
056735d
Merge pull request #4710 from guardian/adu-perf-issue
alexduf Apr 29, 2026
d5c1ee3
Merge branch 'main' of github.com:guardian/grid into em-semantic-sear…
ellenmuller Apr 29, 2026
62d37ff
switch to use scaffeine cache instead of guava
andrew-nowak Apr 29, 2026
b700f16
Merge branch 'an/em-semantic-search-elastic/scaffeine' of github.com:…
ellenmuller Apr 29, 2026
eb1c50e
don't explicitly pass ec
ellenmuller Apr 29, 2026
c8b5f01
update comment
ellenmuller Apr 29, 2026
9cb7b66
Apply suggestions from code review
ellenmuller Apr 29, 2026
16199c5
remove ttl for cache and just use maximumSize
ellenmuller Apr 29, 2026
80c3fc7
Fix backfill integration test
alexduf Apr 29, 2026
9594aee
Merge pull request #4717 from guardian/adu-image-embedder-unit-tests
alexduf Apr 29, 2026
8cf74cf
go back to unpaginated
ellenmuller May 1, 2026
7283ff1
Merge branch 'main' of github.com:guardian/grid into em-semantic-sear…
ellenmuller May 1, 2026
09301c0
try removing signature override
andrew-nowak Feb 23, 2026
0200113
include parameter stripping in dev imgops
andrew-nowak Mar 11, 2026
ebadf0d
remove legacySigningClient
andrew-nowak May 1, 2026
f13f1b7
Merge pull request #4708 from guardian/em-semantic-search-elastic
ellenmuller May 5, 2026
1d28b0f
Merge pull request #4634 from guardian/an/s3-sdk-upgrade
andrew-nowak May 5, 2026
fbce411
don't lazy load for ai search
ellenmuller May 5, 2026
6b4b7a6
Merge branch 'main' of github.com:guardian/grid into em-no-polling-us…
ellenmuller May 5, 2026
d588bcd
add config setting
ellenmuller May 5, 2026
60a8496
document stripping of timestamp param also
andrew-nowak May 6, 2026
14965b0
WIP: hybrid search
alexduf May 6, 2026
29e0b4a
make total imageHits.length
ellenmuller May 7, 2026
0d5fec7
Update kahuna/public/js/search/results.js
ellenmuller May 7, 2026
9352574
refactor
ellenmuller May 7, 2026
5a45106
add comment
ellenmuller May 7, 2026
3ec0ce7
Merge pull request #4722 from guardian/em-no-polling-use-ai
ellenmuller May 8, 2026
ca06696
Update nginx.conf
andrew-nowak May 8, 2026
31d901f
Merge pull request #4725 from guardian/an/imgops-timestamp-param
andrew-nowak May 8, 2026
97a293d
Bump fast-xml-builder from 1.1.4 to 1.2.0 in /image-embedder-lambda
dependabot[bot] May 8, 2026
9847110
Bump fast-xml-builder from 1.1.4 to 1.2.0 in /cdk
dependabot[bot] May 8, 2026
6ca9520
tidy cql ts
AndyKilmory May 12, 2026
e52348b
Merge branch 'main' into t3088-capture-published-ui
AndyKilmory May 12, 2026
3fbfbac
Merge branch 'main' of github.com:guardian/grid into hybrid-search
ellenmuller May 14, 2026
f2fa291
upgrade kcl-pekko-stream to 0.1.2
andrew-nowak Apr 30, 2026
b819246
Merge pull request #4718 from guardian/an/kcl-ps-012
andrew-nowak May 14, 2026
c455c35
Merge pull request #4731 from guardian/dependabot/npm_and_yarn/image-…
lindseydew May 14, 2026
79437cf
Merge pull request #4732 from guardian/dependabot/npm_and_yarn/cdk/fa…
lindseydew May 14, 2026
9312865
upgrade panda to latest; partially switching to s3 sdk v2
andrew-nowak May 14, 2026
9a89253
move to hybrid search
ellenmuller May 14, 2026
0096880
add comments and handle divide by 0 case
ellenmuller May 14, 2026
581524b
Merge branch 'main' of github.com:guardian/grid into hybrid-search
ellenmuller May 14, 2026
279a439
oops remove scratch that had example cerebro request
ellenmuller May 14, 2026
cf10157
not working, intermediate commit
ellenmuller May 14, 2026
6587acd
add vecweight parameter to control hybrid search
ellenmuller May 14, 2026
1b16745
remove trailing comma that broke kahuna linting
ellenmuller May 14, 2026
140e315
AP Photo quickfix
paperboyo May 14, 2026
c5deb8d
Merge pull request #4741 from guardian/mk-ap-quickfix
paperboyo May 15, 2026
5101eef
Match on AP intermediaries and write them into Supplier Collection
paperboyo May 15, 2026
7b7be3a
Add some more tests to check and document expected behaviour of changes
bryophyta May 15, 2026
07c18f3
Merge pull request #4742 from guardian/mk-ap-quickfix-intermediaries
paperboyo May 18, 2026
f364568
Merge branch 'main' of github.com:guardian/grid into hybrid-search
ellenmuller May 19, 2026
90416b4
total is 200 in semantic mode, so matches is the correct number
ellenmuller May 19, 2026
7f91639
Apply suggestions from code review
ellenmuller May 19, 2026
c4e8b8c
Potential fix for pull request finding
ellenmuller May 19, 2026
53a9cbc
Potential fix for pull request finding
ellenmuller May 19, 2026
8a9f214
account for vecWeight = 0.0
ellenmuller May 19, 2026
12fabd1
action small comments from Alex
ellenmuller May 19, 2026
a9a1d4b
create match query helper function
ellenmuller May 19, 2026
44eda6f
refactor into for-comprehension
ellenmuller May 19, 2026
51c06e9
put comments back in (copilot removed them)
ellenmuller May 19, 2026
8e409d4
set vecWeight to 1.0 if not in url param
ellenmuller May 20, 2026
f2bfde7
Update media-api/app/lib/elasticsearch/ElasticSearch.scala
ellenmuller May 20, 2026
471759a
adjust the cookie monster to expire cookies at the start of the epoch
andrew-nowak May 20, 2026
3ec9b62
Merge pull request #4737 from guardian/an/panda-upgrade
andrew-nowak May 21, 2026
3b684e5
Merge pull request #4735 from bbc/t3088-capture-published-ui
andrew-nowak May 21, 2026
5aa340d
upgrade direct kcl dependencies to 3.4.3 too
andrew-nowak May 14, 2026
c0b6133
reintroduce pekko version override
andrew-nowak May 21, 2026
2cf4ae7
Merge pull request #4736 from guardian/an/direct-kcl-3.4.3
andrew-nowak May 22, 2026
636d029
pull in main, resolve conflict
ellenmuller May 22, 2026
d9a2861
pull in main, resolve conflict
ellenmuller May 22, 2026
31c745b
Merge pull request #4738 from guardian/hybrid-search
ellenmuller May 22, 2026
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
12 changes: 0 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,3 @@ updates:
# interval: 'weekly'
# commit-message:
# prefix: "chore(deps): "
# - package-ecosystem: 'npm'
# directory: '/s3watcher/lambda'
# schedule:
# interval: 'weekly'
# commit-message:
# prefix: "chore(deps): "
# - package-ecosystem: 'npm'
# directory: '/s3watcher/scripts'
# schedule:
# interval: 'weekly'
# commit-message:
# prefix: "chore(deps): "
9 changes: 9 additions & 0 deletions .github/workflows/check-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: CORE4 label enforcement
permissions:
contents: read
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize, reopened, edited]
jobs:
require-label:
uses: guardian/.github/.github/workflows/require-label.yaml@4cb5024736632ffcc564b7f4b772c38b8e5ce739 # v2.0.0
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ jobs:
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.2
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: "cdk/package-lock.json"
- name: Kahuna (client-side)
working-directory: ./kahuna
run: |
Expand All @@ -66,13 +68,16 @@ jobs:
npm install-clean
npm test
npm run compile
- name: S3Watcher
working-directory: ./s3watcher/lambda
- name: Image Embedder CDK
run: ./scripts/embedder-deploy/cdk.sh
- name: Image Embedder tests
working-directory: ./image-embedder-lambda
run: |
npm install-clean
npm test
npm run build
- uses: guardian/actions-riff-raff@v4.2.3
- name: Image Embedder bundling
run: ./scripts/embedder-deploy/build.sh
- uses: guardian/actions-riff-raff@v4.2.4
if: "! github.event.pull_request.head.repo.fork"
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -108,4 +113,9 @@ jobs:
image-counter-lambda:
- image-counter-lambda/dist/image-counter-lambda.zip


cdk.out:
- cdk/cdk.out
image-embedder-lambda:
- image-embedder.zip
image-embedder-backfill-lambda:
- image-embedder.zip
2 changes: 1 addition & 1 deletion .github/workflows/push-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
contents: write
actions: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.2
- name: push-pr
env:
PR: ${{ inputs.prNumber }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sbt-dependency-graph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- name: Checkout branch
id: checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v6.0.1
- name: Install Java
id: java
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.2.0
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: corretto
java-version: 17
Expand All @@ -22,7 +22,7 @@ jobs:
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1.1.14
- name: Submit dependencies
id: submit
uses: scalacenter/sbt-dependency-submission@64084844d2b0a9b6c3765f33acde2fbe3f5ae7d3 # v3.1.0
uses: scalacenter/sbt-dependency-submission@f43202114d7522a4b233e052f82c2eea8d658134 # v3.2.1
- name: Log snapshot for user validation
id: validate
run: cat ${{ steps.submit.outputs.snapshot-json-path }} | jq
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ dev/config/permissions.json

coverage/
.bsp

image-embedder.zip

# Integration test data (cached S3 downloads and outputs)
image-embedder-lambda/__tests__/embedder/integration/test-data/
image-embedder-lambda/__tests__/embedder/test-data
11 changes: 7 additions & 4 deletions auth/app/auth/AuthController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import play.api.libs.json.Json
import play.api.mvc.{BaseController, ControllerComponents, Result}

import java.net.URI
import java.util.Date
import java.time.Instant
import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try

Expand All @@ -34,10 +34,13 @@ class AuthController(auth: Authentication, providers: AuthenticationProviders, v

def cookieMonster = auth { request =>
providers.userProvider match {
case panda: PandaAuthenticationProvider =>{
val cookieBatter = panda.readAuthenticatedUser(request).map(user => panda.generateCookie(user.copy(expires = new Date().getTime)))
case panda: PandaAuthenticationProvider =>
val cookieBatter = panda.readAuthenticatedUser(request)
// Note the cookie monster does not expire the cookie itself, but instead expires the panda token stored
// by the cookie. The cookie will remain in the browser storage, but if decoded will declare that it expired
// at the epoch in 1970.
.map(user => panda.generateCookie(user.copy(expires = Instant.ofEpochMilli(0L))))
cookieBatter.fold(respond("Me want cookie."))(cookie => respond("Cookies are a sometimes food.").withCookies(cookie))
}
case _ => respond("Me want cookie.")
}
}
Expand Down
50 changes: 29 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ ThisBuild / packageOptions += FixedTimestamp(Package.keepTimestamps)
ThisBuild / libraryDependencySchemes +=
"org.scala-lang.modules" %% "scala-java8-compat" % VersionScheme.Always

lazy val jacksonVersion = "2.21.1"
lazy val jacksonAnnotationsVersion = "2.21"
lazy val jacksonOverrides = Seq(
"com.fasterxml.jackson.core" % "jackson-core",
"com.fasterxml.jackson.core" % "jackson-databind",
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310",
"com.fasterxml.jackson.module" % "jackson-module-parameter-names",
"com.fasterxml.jackson.module" %% "jackson-module-scala"
).map(_ % jacksonVersion) ++ Seq(
"com.fasterxml.jackson.core" % "jackson-annotations" % jacksonAnnotationsVersion
)

val commonSettings = Seq(
scalaVersion := "2.13.16",
scalaVersion := "2.13.18",
description := "grid",
organization := "com.gu",
version := "0.1",
Expand All @@ -40,7 +54,7 @@ val commonSettings = Seq(
"org.mockito" % "mockito-core" % "2.18.0" % Test,
"org.scalamock" %% "scalamock" % "5.1.0" % Test,
),
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.19.0",
dependencyOverrides ++= jacksonOverrides,

Compile / doc / sources := Seq.empty,
Compile / packageDoc / publishArtifact := false
Expand All @@ -63,8 +77,9 @@ Global / concurrentRestrictions := Seq(
)

val awsSdkVersion = "1.12.470"
val awsSdkV2Version = "2.32.33"
val elastic4sVersion = "8.18.2"
val awsSdkV2Version = "2.42.25"
val elastic4sVersion = "8.19.1"
val awsKclVersion = "3.4.3"
val okHttpVersion = "3.12.1"

val bbcBuildProcess: Boolean = System.getenv().asScala.get("BUILD_ORG").contains("bbc")
Expand All @@ -77,17 +92,16 @@ val maybeBBCLib: Option[sbt.ProjectReference] = if(bbcBuildProcess) Some(bbcProj
lazy val commonLib = project("common-lib").settings(
libraryDependencies ++= Seq(
"com.gu" %% "editorial-permissions-client" % "4.0.0",
"com.gu" %% "pan-domain-auth-play_3-0" % "9.0.0",
"com.gu" %% "pan-domain-auth-play_3-0" % "19.0.0",
"com.amazonaws" % "aws-java-sdk-iam" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-s3" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-ec2" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-cloudwatch" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-cloudfront" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-sqs" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-sns" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-sts" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-kinesis" % awsSdkVersion,
"software.amazon.awssdk" % "s3" % awsSdkV2Version,
"nl.gn0s1s" %% "elastic4s-core" % elastic4sVersion,
"nl.gn0s1s" %% "elastic4s-client-esjava" % elastic4sVersion,
"nl.gn0s1s" %% "elastic4s-domain" % elastic4sVersion,
Expand All @@ -107,11 +121,13 @@ lazy val commonLib = project("common-lib").settings(
"org.scanamo" %% "scanamo" % "2.0.0",
// declare explicit dependency on desired version of aws sdk v2 dynamo
"software.amazon.awssdk" % "dynamodb" % awsSdkV2Version,
"software.amazon.awssdk" % "dynamodb-enhanced" % awsSdkV2Version,
"software.amazon.awssdk" % "cloudwatch" % awsSdkV2Version,
// declare explicit dependency on desired version of aws sdk v2 bedrock runtime
"software.amazon.awssdk" % "bedrockruntime" % awsSdkV2Version,
"software.amazon.awssdk" % "s3vectors" % awsSdkV2Version,
ws,
"org.testcontainers" % "elasticsearch" % "1.19.2" % Test
"org.testcontainers" % "elasticsearch" % "1.21.4" % Test
),
dependencyOverrides += "ch.qos.logback" % "logback-classic" % "1.2.13" % Test
)
Expand All @@ -132,7 +148,7 @@ lazy val cropper = playProject("cropper", 9006)

lazy val imageLoader = playProject("image-loader", 9003).settings {
libraryDependencies ++= Seq(
"org.apache.tika" % "tika-core" % "1.28.5",
"org.apache.tika" % "tika-core" % "3.2.3",
"com.drewnoakes" % "metadata-extractor" % "2.19.0"
)
}
Expand All @@ -150,6 +166,7 @@ lazy val mediaApi = playProject("media-api", 9001)
"org.apache.commons" % "commons-email" % "1.5",
"org.parboiled" %% "parboiled" % "2.1.7",
"org.http4s" %% "http4s-core" % "0.23.17",
"com.github.blemale" %% "scaffeine" % "5.3.0"
)
)

Expand All @@ -161,19 +178,15 @@ lazy val thrall = playProject("thrall", 9002)
pipelineStages := Seq(digest, gzip),
libraryDependencies ++= Seq(
"org.codehaus.groovy" % "groovy-json" % "3.0.7",
// TODO upgrading kcl to v3? check if you can remove avro override below
"software.amazon.kinesis" % "amazon-kinesis-client" % "2.6.1",
"software.amazon.kinesis" % "amazon-kinesis-client" % awsKclVersion,
// explicit dependencies on kinesis and dynamodb to upgrade the versions used by kcl
"software.amazon.awssdk" % "kinesis" % awsSdkV2Version,
"software.amazon.awssdk" % "dynamodb" % awsSdkV2Version,
"com.gu" %% "kcl-pekko-stream" % "0.1.0",
"com.gu" %% "kcl-pekko-stream" % "0.1.2",
"org.testcontainers" % "elasticsearch" % "1.19.2" % Test,
"com.google.protobuf" % "protobuf-java" % "3.19.6"
),
// amazon-kinesis-client 2.6.0 brings in a critically vulnerable version of apache avro,
// but we cannot upgrade amazon-kinesis-client further without performing the v2->v3 upgrade https://docs.aws.amazon.com/streams/latest/dev/kcl-migration-from-2-3.html
dependencyOverrides ++= Seq(
"org.apache.avro" % "avro" % "1.11.4",
"org.apache.pekko" %% "pekko-stream" % "1.0.3"
)
)
Expand All @@ -183,17 +196,12 @@ lazy val usage = playProject("usage", 9009).settings(
"com.gu" %% "content-api-client-default" % "32.0.0",
"com.gu" %% "content-api-client-aws" % "0.7.6",
"io.reactivex" %% "rxscala" % "0.27.0",
// amazon-kinesis-client brings in a critical vulnerability warning through apache avro, resolved in versions 1.11.4 and 1.12.0.
// updating amazon-kinesis-client? check if the override below can be removed
"software.amazon.kinesis" % "amazon-kinesis-client" % "3.0.2",
"software.amazon.kinesis" % "amazon-kinesis-client" % awsKclVersion,
// explicit dependencies on kinesis and dynamodb to upgrade the versions used by kcl
"software.amazon.awssdk" % "kinesis" % awsSdkV2Version,
"software.amazon.awssdk" % "dynamodb" % awsSdkV2Version,
"com.google.protobuf" % "protobuf-java" % "3.19.6"
),
dependencyOverrides ++= Seq(
"org.apache.avro" % "avro" % "1.11.4",
)
)

lazy val scripts = project("scripts")
Expand Down
11 changes: 11 additions & 0 deletions cdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.js
!jest.config.js
!jest.setup.js
!.eslintrc.js
*.d.ts
node_modules
dist

# CDK asset staging directory
.cdk.staging
cdk.out
5 changes: 5 additions & 0 deletions cdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Infrastructure

This directory defines the components to be deployed to AWS.

See [`package.json`](./package.json) for a list of available scripts.
7 changes: 7 additions & 0 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import "source-map-support/register";
import { GuRoot } from "@guardian/cdk/lib/constructs/root";
import { ImageEmbedder } from "../lib/image-embedder-lambda";

const app = new GuRoot();
new ImageEmbedder(app, "ImageEmbedderLambda-euwest-1-PROD", { stack: "media-service", stage: "PROD", env: { region: "eu-west-1" } });
new ImageEmbedder(app, "ImageEmbedderLambda-euwest-1-TEST", { stack: "media-service", stage: "TEST", env: { region: "eu-west-1" } });
7 changes: 7 additions & 0 deletions cdk/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app": "npx ts-node bin/cdk.ts",
"context": {
"aws-cdk:enableDiffNoFail": "true",
"@aws-cdk/core:stackRelativeExports": "true"
}
}
6 changes: 6 additions & 0 deletions cdk/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import guardian from '@guardian/eslint-config';

export default [
...guardian.configs.recommended,
...guardian.configs.jest
];
2 changes: 2 additions & 0 deletions cdk/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable no-undef -- jest globals are missing due to guardian.recommended.jest eslint rules not covering jest.setup.js */
jest.mock("@guardian/cdk/lib/constants/tracking-tag");
Loading
Loading