Skip to content

Commit

Permalink
Add PRUNTIME_TRIE_CACHE_PATH in menifest
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed May 12, 2023
1 parent bc3f676 commit a78cc1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/phala-trie-storage/src/kvdb/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub(crate) fn with_cache_dir<T>(cache_dir: &str, f: impl FnOnce() -> T) -> T {
pub(crate) fn create_db() -> (TransactionDB<MultiThreaded>, usize) {
let test_path = test_cached_path::with(|path| path.clone());
let cache_path = &test_path
.or_else(|| std::env::var("PHALA_TRIE_CACHE_PATH").ok())
.or_else(|| std::env::var("PRUNTIME_TRIE_CACHE_PATH").ok())
.unwrap_or_else(|| "data/protected_files/caches".to_string());
static NEXT_SN: AtomicUsize = AtomicUsize::new(0);
let sn = NEXT_SN.fetch_add(1, Ordering::SeqCst);
Expand Down
5 changes: 4 additions & 1 deletion standalone/pruntime/gramine-build/pruntime.manifest.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% set pink_runtime_mount_dir = "/pink-runtime" %}
{% set protected_dir = "/data/protected_files" %}
{% set trie_cache_dir = protected_dir + "/caches" %}

[libos]
entrypoint = "pruntime"
Expand Down Expand Up @@ -27,6 +29,7 @@ serving the async tasks.
#}
ROCKET_WORKERS = "8"
PINK_RUNTIME_PATH = "{{ pink_runtime_mount_dir }}"
PRUNTIME_TRIE_CACHE_PATH = "{{ trie_cache_dir }}"
{#
When enable, the pruntime will only logs with targets in the hardcoded whitelist.
So, log from thirdparty crates will be ignored to avoid unexpected information leaks.
Expand All @@ -42,7 +45,7 @@ path = "/lib"
uri = "file:{{ libdir }}"

[[fs.mounts]]
path = "/data/protected_files"
path = "{{ protected_dir }}"
uri = "file:{{ seal_dir }}"
type = "encrypted"
key_name = "_sgx_mrenclave"
Expand Down

0 comments on commit a78cc1d

Please sign in to comment.