Commit 72f27b5
Example CacheLib with Proxygen (#416)
Summary:
For some benchmarking we like to have the network stack included - here is a simple example of adding CacheLib on top of proxygen for receiving data via HTTP request.
## Quick Setup (assumes dependencies live at CacheLib/opt)
### Build and run
```
getdeps.py install-system-deps cachelib
getdeps.py build --allow-system-packages cachelib
getdeps.py build --allow-system-packages proxygen
./build.sh
./build/proxygen_cache
```
### PUT a value
`curl -X PUT --data-binary 'hello world' http://localhost:8111/cache/greeting -i`
### GET it back
`curl http://localhost:8111/cache/greeting -i`
### DELETE it
`curl -X DELETE http://localhost:8111/cache/greeting -i`
Pull Request resolved: #416
Test Plan:
Imported from GitHub, without a `Test Plan:` line.
```
getdeps.py install-system-deps cachelib
getdeps.py build --allow-system-packages cachelib
getdeps.py build --allow-system-packages proxygen
./example/proxygen_cache/build.sh
/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/cachelib/usr/local/lib/cmake:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/proxygen/usr/local/lib/cmake/proxygen:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/cachelib/usr/local/lib64/cmake:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/proxygen/usr/local/lib64/cmake/proxygen:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/cachelib/usr/local/lib:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/cachelib/usr/local/lib64:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/cachelib/usr/local:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/:/data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/proxygen/usr/local:
-- Found Boost: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/boost-3q1puqWKBVvE03fZboaAfiTqx8sfrdLPSNiGTo7FTQU/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable version "1.83.0", minimum required is "1.51.0") found components: context filesystem program_options regex system thread
-- Found folly: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/folly
-- Found folly: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/folly
-- Found fizz: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/liboqs-RS3Wq0UEy2BDdhQeFw1Q9VKrvJJ9dfECMDxnYEI_vRo
-- Found wangle: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/wangle
-- Found fizz: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/fizz
-- Found Boost: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/boost-3q1puqWKBVvE03fZboaAfiTqx8sfrdLPSNiGTo7FTQU/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: iostreams system thread filesystem regex context
-- Found mvfst: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/fizz
-- Found FBThrift: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/fbthrift
-- Found cachelib: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/fizz
-- Found mvfst: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/mvfst
-- Found Boost: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/boost-3q1puqWKBVvE03fZboaAfiTqx8sfrdLPSNiGTo7FTQU/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable version "1.83.0", minimum required is "1.58") found components: iostreams context filesystem program_options regex system thread
-- Found proxygen: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/c-ares-fJOoWaHm8mhW5_cCWvKAjAePYXt5UOAFYGwbgpiezTA
-- looking numa in dir: : /usr/include
-- root: :
-- root: :
-- looking numa in dir again : /usr/include
-- cachelib include dirs: /data/users/juwin/scratch/homeZjuwinZCacheLib/fbcode_builder_getdeps/installed/cachelib/include/cachelib
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/juwin/CacheLib/examples/proxygen_cache/build
[ 50%] Building CXX object CMakeFiles/proxygen_cache.dir/main.cpp.o
[100%] Linking CXX executable proxygen_cache
[100%] Built target proxygen_cache
[juwin@devvm29225.atn0 ~/CacheLib/examples/proxygen_cache (pr)]$ ./build/proxygen_cache
I20251008 19:51:43.835841 3488174 main.cpp:198] creating cache with size 1069547520 bytes
I20251008 19:51:43.836023 3488174 main.cpp:239] Listening on port 8111
```
Reviewed By: SamirFarhat17
Differential Revision: D84167914
Pulled By: juwinviray
fbshipit-source-id: 068a7d0d1d3dcb1ca7446a736c79f59a5c0e7fa01 parent 3f6f7ee commit 72f27b5
7 files changed
Lines changed: 722 additions & 1 deletion
File tree
- build/fbcode_builder/manifests
- examples/proxygen_cache
- cmake
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
0 commit comments