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

How to fetch UDF versions from bucket? #29

Open
maciejkowalczyk opened this issue Dec 16, 2024 · 5 comments
Open

How to fetch UDF versions from bucket? #29

maciejkowalczyk opened this issue Dec 16, 2024 · 5 comments
Assignees

Comments

@maciejkowalczyk
Copy link
Contributor

According to v4.4.0 release notes one can now specify a udf version in request. Are there some docs, how to use this feature?
I tried using BUYER_CODE_FETCH_CONFIG like this one:

    {
        "fetch_mode": 1,
        "protectedAuctionBiddingJsBucket": "%BUCKET_NAME%",
        "protectedAuctionBiddingJsBucketDefaultBlob": "dir1/dir2/file.js",
        "protectedAppSignalsBiddingJsBucket": "",
        "protectedAppSignalsBiddingJsBucketDefaultBlob": "",
        "urlFetchPeriodMs": 60001,
        "urlFetchTimeoutMs": 30000,
        "enableBuyerDebugUrlGeneration": true,
        "adsRetrievalJsBucket": "",
        "adsRetrievalBucketDefaultBlob": "",
        "enablePrivateAggregateReporting": false
      }

Upon bidding service startup and once every minute I'm seeing logs like these:

I1216 15:30:33.348910 43 periodic_bucket_code_fetcher.cc:94] Current code loaded into Roma for version %BUCKET_NAME%/dir1/dir2/file.js

Followed by the wrapper JS code and the scripts contents (and also for other scripts in the bucket).

Unfortunately every request fails with an error this one:

I1216 14:16:33.058221 90 generate_bids_reactor.cc:433] (adtechDebugId: DEBUG_ID, generationId: 39b6d619-81d0-431b-bc53-89dd8b4211a6) Generate Bids V8 Response: INTERNAL: Execution failed; Could not find a stored context for the execution request.

It was the same when I set this JS path in blob_versions.protected_audience_generate_bid_udf of PerBuyerConfig or when I added a / or %BUCKET_NAME%/ prefix.

I also tried using stub JS scripts like function generateBid().
The only difference I observed was a bidding service crash when I uploaded an empty script to the bucket:

terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_M_replace_aux
*** SIGABRT received at time=1734358814 on cpu 1 ***
PC: @ 0x7e558f886ce1 (unknown) raise
@ 0x55dd97ad1b92 208 absl::AbslFailureSignalHandler()
@ 0x7e558fd6d140 (unknown) (unknown)
@ 0x4d5f3a3a676e6972 (unknown) (unknown)
Aborted (core dumped)
@dankocoj-google
Copy link
Collaborator

Hi Maciej, thanks for testing this out. I'll try and repro and get back to you today.

@dankocoj-google
Copy link
Collaborator

Following up, the feature needs a few fixes/additions before it's fully usable.

  1. Nested directory structure support (currently broken)
  2. Connection from SFE -> BFE (probably why it's not working for you)
  3. Metrics (this is quite necessary for production usage - it's too hard to keep track of which machine has which blob otherwise)
  4. Better documentation

I plan to have this all ready for the next release - sorry for any confusion - I should have marked the feature as 'wip' in the 4.4 release note.

@fhoering
Copy link

fhoering commented Dec 20, 2024

Is there a specification somewhere where this feature is discussed ?
Do you think you can put back some basic version also where this can be specified again in the Interest Group with ids for example (similar to the renderIds )?

Being able to have only one single bidding script is very constraining. Having the bidding script settable in the IG would allow the buyer, for example, to experiment with different script sizes and new experimental breaking features.

Also there might be issues by having split up the bidding and reporting script. What happens if an error occurs in reportWin? The seller might not necessarily monitor that and the script must still be exposed by the buyer.

@dankocoj-google
Copy link
Collaborator

Hi Fabian,

These are good questions. We currently plan to support multi-version by fetching a bucket containing N versions, periodically, outside of the critical path of the request. During the request, you can specify the version as part of the plaintext auction config (formed after getting a contextual response, see here for the definition and how BuyerBlobVersions is passed through SelectAdRequest:

message BuyerBlobVersions {
). Note that you will not be able to specify a version per-IG or even know what IGs are present in the request to inform your version specification.

We can put this on the Protected Auction WICG agenda if you’d like to discuss more in person - we do not have anything designed for reportWin yet.

@fhoering
Copy link

fhoering commented Jan 6, 2025

The possibility to be able to specify the trusted KV url and bidding scripts in the IG has some very good properties.
I think it should be kept, already to keep alignment with on-device bidding, but also because it would allow more flexibility for the the buyer without having to cooperate with the seller via the auctionConfig.
I also don't really see a reason why this has been removed. It could just leverage the same optimizations that have also been done by introducing ids instead of fulls urls via renderid and therefore limit the paylaod impact flowing into B&A.

One use case I could think of would be for example to allow client side sharding by just spawning 100 trusted server urls, put them in the IG and let the buyer front end service make the right requests. This for example could solve the issue described here for B&A WICG/protected-auction-services-discussion#93 (not for one device unfortunately as it would break batching).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants