[apache/incubator-teaclave-sgx-sdk] V2.0.0 preview:can't build `pgx` crate with error:can't find crate for `proc_macro` (Issue #415)

2023-01-05 Thread xin201501
`pgx` is a crate to wirte custom functions to postgres database.
It has `no_std` features to turn off std,(but I think in v2.0.0 we don't have 
to turn off std for most crates.)
I used the `project template` in the samplecode folder.
Here is my `Cargo.toml` file:
```cargo.toml
[package]
name = "sample"
version = "1.0.0"
authors = ["XXX"]
edition = "2021"

[lib]
name = "sample"
crate-type = ["staticlib"]

[features]
default = ["pg15"]
pg11 = ["pgx/pg11"]
pg12 = ["pgx/pg12"]
pg13 = ["pgx/pg13"]
pg14 = ["pgx/pg14"]
pg15 = ["pgx/pg15"]

[dependencies]
pgx = {version = "0.6.1",default-features = false}

[dev-dependencies]

# uncomment these if compiling outside of 'pgx'
[profile.dev]
panic = "unwind"
lto = "thin"

[profile.release]
panic = "unwind"
opt-level = 3
lto = "fat"
codegen-units = 1
```
---
here is the  compile output:
```zsh
--- samplecode/pgx_in_sgx ‹v2.0.0-preview* ?› » CC=gcc-10 CXX=g++-10 make
/home/xin201501/sgx_sdk_2_17_1/sgxsdk/bin/x64/sgx_edger8r  --trusted 
enclave/enclave.edl --search-path 
/home/xin201501/incubator-teaclave-sgx-sdk/common/inc --search-path 
/home/xin201501/incubator-teaclave-sgx-sdk/sgx_edl/edl --trusted-dir enclave
/home/xin201501/sgx_sdk_2_17_1/sgxsdk/bin/x64/sgx_edger8r  --untrusted 
enclave/enclave.edl --search-path 
/home/xin201501/incubator-teaclave-sgx-sdk/common/inc --search-path 
/home/xin201501/incubator-teaclave-sgx-sdk/sgx_edl/edl --untrusted-dir app
GEN => enclave/enclave_t.c enclave/enclave_t.h app/enclave_u.c app/enclave_u.h
   Compiling sgx_types v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_types)
   Compiling libc v0.2.139
   Compiling sgx_urts v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_urts)
   Compiling app v1.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/samplecode/pgx_in_sgx/app)
   Compiling sgx_uprotected_fs v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_protected_fs/ufs)
Finished release [optimized] target(s) in 1.58s
LINK => bin/app
Updating crates.io index
   Compiling compiler_builtins v0.1.82
   Compiling sgx_build_helper v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_build_helper/build_helper)
   Compiling core v0.0.0 
(/home/xin201501/.rustup/toolchains/nightly-2022-10-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling sgx_types v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_types)
   Compiling sgx_trts v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_trts)
   Compiling sgx_download_prebuilt v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_build_helper/download_prebuilt)
   Compiling sgx_unwind v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_unwind)
   Compiling sgx_tlibc_sys v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_libc/sgx_tlibc_sys)
   Compiling sgx_crypto_sys v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_crypto/sgx_crypto_sys)
   Compiling rustc-std-workspace-core v1.99.0 
(/home/xin201501/.rustup/toolchains/nightly-2022-10-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 
(/home/xin201501/.rustup/toolchains/nightly-2022-10-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
   Compiling sgx_alloc v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_alloc)
   Compiling hashbrown_tstd v0.12.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_tstd/hashbrown)
   Compiling panic_unwind v0.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/rustlib/panic_unwind)
   Compiling sgx_ffi v2.0.0 (/home/xin201501/incubator-teaclave-sgx-sdk/sgx_ffi)
   Compiling sgx_sync v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_sync)
   Compiling panic_abort v0.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/rustlib/panic_abort)
   Compiling sgx_oc v2.0.0 (/home/xin201501/incubator-teaclave-sgx-sdk/sgx_oc)
   Compiling sgx_rsrvmm v2.0.0 
(/home/xin201501/incubator-teaclave-sgx-sdk/sgx_rsrvmm)
   Compiling std v0.0.0 (/home/xin201501/incubator-teaclave-sgx-sdk/rustlib/std)
Finished release [optimized] target(s) in 24.81s
error: failed to parse manifest at 
`/home/xin201501/incubator-teaclave-sgx-sdk/samplecode/pgx_in_sgx/enclave/Cargo.toml`

Caused by:
  feature `pg11` includes `pgx-tests/pg11`, but `pgx-tests` is not a dependency
make: *** [Makefile:181:enclave] 错误 101
--- samplecode/pgx_in_sgx ‹v2.0.0-preview* ?› » CC=gcc-10 CXX=g++-10 make   2 ↵
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Finished release [optimized] target(s) in 1.22s
LINK => bin/app
Finished release [optimized] target(s) in 0.09s
   Compiling proc-macro2 v1.0.49
   Compiling quote v1.0.23
   Compiling unicode-ident v1.0.6
   Compiling syn v1.0.107
   Compiling autocfg v1.1.0
   Compiling memchr v2.5.0
   Compiling libc v0.2.139
   Compiling cfg-if v1.0.0
   Compiling log v0.4.17
   Compiling serde v1.0.152
   Compiling serde_derive v1.0.152
   Compiling 

[apache/incubator-teaclave] Aggregate task and platform logs (Issue #669)

2023-01-05 Thread He Sun


### Motivation & problem statement



Current implementation uses env_logger that outputs to std::io. It is 
convenient for development as the developer can see the logs immediately in the 
terminal.
However, it is not friendly to the users. The users have no access to logs, 
which is not good for workflow depending on intermedia outputs, e.g., model 
tuning.
Besides, the logging service is often required for audit in some standards of 
privacy-preserving platforms.
It is also efficient for platform Ops to see the logs of all the distributed 
services through a single interface.

### Proposed solution



The implementation has two parts: one is for task log and the other is for 
platform log.
 Task log
A new logger implementation named `teaclave_logger` is added. It supports both 
env_logger and `task_logger`.
After the execution service pulls a task successfully, `task_logger` is used. 
The logs will be buffered in memory and sent to storage service after the task 
is over or the buffer is full. The key of the log in storage is the task id 
with a sequence number in case the logs are sent multiple times. The task users 
can get the task log after they are authored through FE. This design is only 
for the execution service that handles tasks one by one. Concurrency would be 
handled when the execution service could handle tasks parallely in later 
design. It is out of the scope in this solution.
When the execution service is not handling tasks, env_logger is used.
 Platform log
A new `logging` service that aggregates logs is added. It is backed by 
[tantivy](https://github.com/quickwit-oss/tantivy). Tantivy is a full-text 
search engine library. It has powerful features and can support quick search 
towards the logs.
The env_logger in every service is replaced by `platform_logger` in 
`teaclave_logger`. All the platform logs except debug level ones will be sent 
to `logging` service. Only platform admin can see the logs through FE. The logs 
can be searched in `tantivy` way.
The new service topology will be as below:
```
clients => authentication <-+   +> storage <+   
 | 
|   |   |   
 |
clients => frontend --> managementscheduler <-- execution   
 |   ---> logging
|   
 |
+--> access_control 
 |


  =>  api endpoint 
connections
  -> internal endpoint 
connections
```


The `debug` level logs will be output to std::io anyway.

### Describe alternatives you've considered



[quickwit](https://github.com/quickwit-oss/quickwit): it uses AGPL license that 
is not friendly to teaclave.
No other mature loggers written Rust are found. Feel free to recommend here.



-- 
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave/issues/669
You are receiving this because you are subscribed to this thread.

Message ID: 

[GitHub] [incubator-teaclave-java-tee-sdk] superajun-wsj commented on pull request #17: Add NOTICE file for JavaEnclave

2023-01-05 Thread GitBox


superajun-wsj commented on PR #17:
URL: 
https://github.com/apache/incubator-teaclave-java-tee-sdk/pull/17#issuecomment-1373029714

   @mssun invite you to help review this pr, if you have any comments let me 
know, thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org
For additional commands, e-mail: dev-h...@teaclave.apache.org