Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Conversation

@Porges
Copy link
Member

@Porges Porges commented Jul 19, 2023

Closes #3156.

From now on, we will store additional information about containers in a table (ContainerInformation). This is populated when a container is created, or lazily when looking for a container we have not yet stored in the table.

Reads from this table are also cached in memory for a short period of time (currently 10 minutes).

The table is currently used to speed up lookups for containers across storage accounts; we round-robin creation of containers across multiple storage accounts to spread load, so when we read from a container we need to find what storage account it lives in.

The ContainerInformation table could also be used in future to store information about access control (see, e.g. #1419).

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2023

Codecov Report

Merging #3304 (4402ce0) into main (c44bd03) will increase coverage by 1.79%.
The diff coverage is 79.46%.

@@            Coverage Diff             @@
##             main    #3304      +/-   ##
==========================================
+ Coverage   29.99%   31.78%   +1.79%     
==========================================
  Files         133      307     +174     
  Lines       14180    37312   +23132     
==========================================
+ Hits         4253    11860    +7607     
- Misses       9927    25452   +15525     
Impacted Files Coverage Δ
src/ApiService/ApiService/onefuzzlib/orm/Orm.cs 59.60% <45.83%> (+0.63%) ⬆️
...rvice/ApiService/onefuzzlib/orm/EntityConverter.cs 90.10% <50.00%> (-0.29%) ⬇️
.../ApiService/ApiService/OneFuzzTypes/ReturnTypes.cs 70.83% <61.53%> (+7.97%) ⬆️
src/ApiService/ApiService/onefuzzlib/Storage.cs 22.40% <87.50%> (+4.45%) ⬆️
src/ApiService/ApiService/onefuzzlib/Containers.cs 68.67% <94.73%> (+6.55%) ⬆️
src/ApiService/ApiService/Functions/Containers.cs 87.67% <100.00%> (-0.65%) ⬇️
src/ApiService/ApiService/OneFuzzTypes/Model.cs 72.05% <100.00%> (+0.16%) ⬆️

... and 175 files with indirect coverage changes

@Porges Porges marked this pull request as ready for review July 20, 2023 01:08
@Porges Porges merged commit 51591b7 into main Jul 20, 2023
@Porges Porges deleted the cache-findcontainer branch July 20, 2023 21:03
Porges added a commit that referenced this pull request Jul 24, 2023
Noticed a few things while doing #3304, so fixing them in another PR:

- Add `CreateNewContainer` which will always create a new container instead of looking for one first.
- InstanceId was not being cached properly (the Lazy would be recreated upon every request) — my fault!
- Add `GetBlob` beside `GetBlogWithTags` for when we don't need the tags
- Make `GetBlogWithTags` do both fetches in parallel
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FindContainer should cache the storage account to avoid generating spurious 404s and for performance reasons

4 participants