Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
5f7f9d7
`cargo pgx new encrypted_sql_ops`
laysakura May 20, 2021
28a3753
adds `example/encrypted-sql-ops/pg-extension` as a workspace member
laysakura May 20, 2021
3c629f4
Moves profile settings to workspace root following the cargo warning:
laysakura May 20, 2021
0f350fa
adds README.md to show motivation and usage
laysakura May 20, 2021
a3f1543
set version to 0.1.0
laysakura May 20, 2021
29dd2fb
just ported laysakura/sgx-kungfu
laysakura May 20, 2021
488f8da
moves average state calculation into -enclave
laysakura May 21, 2021
8843173
Serialize, Deserialize for AvgState
laysakura May 21, 2021
4d23619
extensions definition
laysakura May 21, 2021
328b29a
adds example/encrypted-sql-ops/enclave
laysakura May 21, 2021
51ec92b
adds `EnclaveError` and `EnclaveResult`
laysakura May 21, 2021
5e6117f
updates Cargo.toml
laysakura May 21, 2021
6b05016
makes EncInteger::as_slice public (used in -enclave crate for decrypt…
laysakura May 21, 2021
2b4587c
things for conditional compilation
laysakura May 21, 2021
9f735f1
updates Cargo.lock
laysakura May 21, 2021
7795eea
adds EncInteger and decrypt(), encrypt() functions
laysakura May 21, 2021
417d481
changes module names in cargo
laysakura May 21, 2021
0a6f9c7
removes files from extension which should be implemented in module
laysakura May 21, 2021
81bd6cc
fix: example build from std env
laysakura May 21, 2021
fdbf2e8
AvgState needs to be indirectly referred from `CREATE AGGREGATEION` s…
laysakura May 21, 2021
8e8e730
adds `AvgState` in module
laysakura May 21, 2021
f4cfdf6
Moves AvgState to encrypted-sql-ops-enclave
laysakura May 21, 2021
0137e27
adds `EncInteger`
laysakura May 21, 2021
2362509
moves `EncInteger` to ecall-types
laysakura May 21, 2021
a3263f9
wip
laysakura May 21, 2021
8510c4a
updates lib.rs
laysakura May 21, 2021
e6d77ff
register_ecalls!
laysakura May 21, 2021
85a72b8
adds ecall command numbrers
laysakura May 21, 2021
c020b94
adds .vscode/ in .gitignore
laysakura May 22, 2021
215212d
adds host/enclace input/output to workflow
laysakura May 22, 2021
4d22423
exclude pg-extension from cargo workspace
laysakura May 22, 2021
68a93c5
deletes unused file
laysakura May 22, 2021
cefac08
build: pg-extension is not a member of cargo workflow
laysakura May 22, 2021
cdf96cf
rename ecall related types
laysakura May 22, 2021
c6da5e0
wip: writing workflow
laysakura May 22, 2021
db537ba
wip: writing workflow
laysakura May 22, 2021
b06cb8f
fix: `feature = ["sgx", "std"]` のケースで `localstd` が二重定義される問題を修正
laysakura May 22, 2021
6afe83b
refactor: EnclaveEngine -> StateRuntimeEnclaveEngine
laysakura May 22, 2021
95b10e8
feat: adds BasicEnclaveEngine and key-vault-enclave uses it
laysakura May 22, 2021
ff11981
refactor: decrypt -> new; ciphertext -> ecall_input
laysakura May 22, 2021
c8338cf
refactor: remove StateRuntimeEnclaveEngine::handle_without_runtime
laysakura May 22, 2021
b877f42
refactor: BasicEnclaveEngine::{handle_without_runtime -> handle}
laysakura May 22, 2021
61d33b1
refactor: BasicEnclaveEngine::{decrypt -> new}
laysakura May 22, 2021
252d0d6
refactor: BasicEnclaveEngine only requires ConfigGetter for context
laysakura May 22, 2021
ca13f98
fix: takes self
laysakura May 22, 2021
ccdeba0
fix: ServerStopper::handle signature
laysakura May 22, 2021
701b979
fix: import
laysakura May 22, 2021
d2a5654
fix: import
laysakura May 22, 2021
cd04468
fix: rewrites register_ecall! to support both {Basic, StateRuntime}En…
laysakura May 22, 2021
ea8ffaa
Merge remote-tracking branch 'origin/refactor/EnclaveEngine-handle_wi…
laysakura May 22, 2021
e24cf15
registers ENCINTEGER_FROM command
laysakura May 23, 2021
23dad39
wip: adding init to extension
laysakura May 23, 2021
8107e1f
Merge branch 'build/dev-docker-non-root' into feature/encrypted-AVG-S…
laysakura May 25, 2021
364f6ee
adds pgx image
laysakura May 25, 2021
ebce9f9
removes unnecessary list from doc
laysakura May 25, 2021
a8bbbf3
fix: libreadline-dev is necessary
laysakura May 25, 2021
2080c18
doc: updates how to use pgx
laysakura May 25, 2021
ee0a967
fix: unnecessary feature flag
laysakura May 25, 2021
09fed4f
Merge remote-tracking branch 'origin/main' into feature/encrypted-AVG…
laysakura May 25, 2021
194c7b5
build: somehow needs extra import (for trait funciton) in anonify-dev…
laysakura May 25, 2021
d0cfcac
Merge remote-tracking branch 'origin/main' into feature/encrypted-AVG…
laysakura May 26, 2021
8a0c885
updates rust channel to pass pgx build
laysakura May 27, 2021
a79065a
Merge remote-tracking branch 'origin/main' into feature/encrypted-AVG…
laysakura May 27, 2021
b97f897
fix: checkout main crypto.rs (recovered from compile error)
laysakura May 27, 2021
26746ef
build: pgx's Cargo.lock is also necessary
laysakura May 27, 2021
2f67f67
build: freeze ed25519-delek version with the same one as frame-host's…
laysakura May 27, 2021
da8153b
fix: encrypted-sql-ops-pg-extension compiles :tada:
laysakura May 27, 2021
d8a2af3
fix: sql load order
laysakura May 27, 2021
263d37e
Merge remote-tracking branch 'origin/feature/PJ_ROOT_DIR-envvar' into…
laysakura May 27, 2021
5caa54e
fix: compile errors
laysakura May 27, 2021
b1a4350
Merge branch 'feature/PJ_ROOT_DIR-envvar' into feature/encrypted-AVG-…
laysakura May 27, 2021
8417d46
Merge branch 'feature/PJ_ROOT_DIR-envvar' into feature/encrypted-AVG-…
laysakura May 27, 2021
33f5aa4
build: encrypted_sql_ops.enclave.so
laysakura May 27, 2021
2a50306
fix: now compiles example/encrypted-sql-ops/enclave :tada:
laysakura May 27, 2021
bd69736
Merge remote-tracking branch 'origin/main' into feature/encrypted-AVG…
laysakura May 27, 2021
28a21bb
fix: initial lib name should be anonifyenclave
laysakura May 27, 2021
a80f50c
build: encrypted-sql-ops-pg image
laysakura May 27, 2021
4210bff
fix: more build-arg
laysakura May 27, 2021
d63b623
fix: cargo pgx build should be on second stage
laysakura May 27, 2021
e8a555b
fix: path
laysakura May 27, 2021
26cfca4
build: adds anonify-dev-pgx image
laysakura May 27, 2021
5cbfdb3
fix: no source codes in image
laysakura May 27, 2021
1329b7c
fix: path
laysakura May 27, 2021
19ef2ff
build: pgx image already built
laysakura May 27, 2021
335a99c
implements ecall_cmd()
laysakura May 27, 2021
cf4ec5c
fix: type
laysakura May 27, 2021
0d05eed
adds info log
laysakura May 27, 2021
b8a989a
fix: typo
laysakura May 27, 2021
8e57adc
use log instead
laysakura May 27, 2021
db93513
fix compile error
laysakura May 27, 2021
f0952d8
pgx::log available
laysakura May 27, 2021
0a07c8c
fix
laysakura May 27, 2021
ef15924
fix
laysakura May 27, 2021
7f377bf
fix: SgxEnclave got dropped
laysakura May 27, 2021
b35d9da
fix
laysakura May 27, 2021
d7bce52
fix: dependencies
laysakura May 27, 2021
437d7e5
uses global()
laysakura May 27, 2021
6cfa407
fix
laysakura May 27, 2021
ae82418
deref
laysakura May 27, 2021
4cab969
fix
laysakura May 27, 2021
b938c7e
impl handle()
laysakura May 28, 2021
0334df7
doc cooment
laysakura May 28, 2021
c89fad0
fix import
laysakura May 28, 2021
d8dc630
fix: compile
laysakura May 28, 2021
b4e9e81
fix: impl set_ecall_output()
laysakura May 28, 2021
24588b0
doc comment
laysakura May 28, 2021
45228e6
updates Cargo.lock
laysakura May 28, 2021
9eaea3a
fix: namespace
laysakura May 28, 2021
77f34fe
refactor: mod structures
laysakura May 28, 2021
dff36e0
wip: compiles
laysakura May 28, 2021
8ed14aa
refactor: compiles
laysakura May 28, 2021
ff07f6e
refactor: build but `initcond` is wrong
laysakura May 28, 2021
aceb39b
compiles
laysakura May 28, 2021
89aa7de
fix: runs to SELECT
laysakura May 28, 2021
4d7e2fd
runs well
laysakura May 28, 2021
9f5dce6
wip
laysakura May 28, 2021
bb3452e
wip
laysakura May 28, 2021
d039340
example/encrypted-sql-ops/enclave compiles
laysakura May 28, 2021
1f02ba5
Merge remote-tracking branch 'origin/main' into feature/encrypted-AVG…
laysakura May 31, 2021
b0e1cf3
Merge branch 'feature/encrypted-AVG-SQL-roadmap4' of ssh://github.com…
laysakura May 31, 2021
6dfbf22
build: uses latest
laysakura Jun 1, 2021
fc946da
ci: kick build of encrypted-sql-ops-pg
laysakura Jun 1, 2021
aad5f07
fix: ci def
laysakura Jun 1, 2021
674271c
build: pull
laysakura Jun 1, 2021
cb3c0ec
fix: pull
laysakura Jun 1, 2021
899d2ea
uses base image
laysakura Jun 1, 2021
1d9684f
fix
laysakura Jun 1, 2021
3af9145
wip
laysakura Jun 1, 2021
8c265d7
updates image
laysakura Jun 1, 2021
a491e9d
pgx
laysakura Jun 1, 2021
f4dee3b
fix
laysakura Jun 1, 2021
608869a
rust-toolchain
laysakura Jun 1, 2021
36d3813
do not add rust channel in dockerfile
laysakura Jun 1, 2021
df6c6a3
use latest
laysakura Jun 1, 2021
03301bc
cargo.lock
laysakura Jun 1, 2021
00a006c
uses esop
laysakura Jun 1, 2021
c1f7aef
adds toolchain
laysakura Jun 1, 2021
fd3dee3
uses PlainI32 for internal members
laysakura Jun 1, 2021
804fccd
PlainAvgState has enc/dec methods
laysakura Jun 2, 2021
8ea5174
wip
laysakura Jun 2, 2021
f401979
wip
laysakura Jun 2, 2021
4f27328
wip
laysakura Jun 2, 2021
e6e6b01
impl enc/dec
laysakura Jun 2, 2021
ce53ad7
impl EncIntegerAvgStateFuncCmdHandler
laysakura Jun 2, 2021
b4eaf02
PlainI32 -> PlainInteger
laysakura Jun 2, 2021
1c56837
compiles
laysakura Jun 2, 2021
6cd2673
may finish impl
laysakura Jun 2, 2021
8d8184b
ci: merge from main
laysakura Jun 2, 2021
45e6e84
build: revert docker-compose.yml
laysakura Jun 2, 2021
1caa30b
fix
laysakura Jun 2, 2021
3155c63
fix
laysakura Jun 2, 2021
979f5ea
fix
laysakura Jun 2, 2021
039230d
updates readme
laysakura Jun 2, 2021
4e2f0f9
rm
laysakura Jun 2, 2021
d81197b
fmt
laysakura Jun 2, 2021
42c7a63
fix extension name to pass `cargo pgx test`
laysakura Jun 2, 2021
3637786
adds case with 0 record avg
laysakura Jun 2, 2021
d763380
adds e2e for esop
laysakura Jun 3, 2021
39ff8b8
comment-out test
laysakura Jun 3, 2021
13d39f6
fix dockerfile name
laysakura Jun 3, 2021
4f77c79
fix
laysakura Jun 3, 2021
6f410f7
command
laysakura Jun 3, 2021
173e0e3
refactor
laysakura Jun 3, 2021
fca0bc2
feat: faster fixuid
laysakura Jun 3, 2021
f340488
ci: build base images
laysakura Jun 3, 2021
3e1f27a
fix
laysakura Jun 3, 2021
a746ecd
skip fixuid
laysakura Jun 3, 2021
f0b1e9f
chown only necessary dir
laysakura Jun 3, 2021
c374708
fix: ENTRYPOINT launches interactive shell so `docker run` or `docker…
laysakura Jun 3, 2021
f63b314
build images
laysakura Jun 3, 2021
a4984e6
Merge remote-tracking branch 'origin/main' into feature/encrypted-AVG…
laysakura Jun 3, 2021
d9634ac
should pass e2e
laysakura Jun 3, 2021
0978c2d
buid base images
laysakura Jun 3, 2021
c07c365
e2e-esop
laysakura Jun 3, 2021
b937d4a
fix condition
laysakura Jun 3, 2021
a1cd3a8
fix: copy
laysakura Jun 3, 2021
5858dda
exit status
laysakura Jun 3, 2021
c139243
log
laysakura Jun 3, 2021
5559fda
condition always
laysakura Jun 3, 2021
2f371e0
fix
laysakura Jun 3, 2021
f2c1041
log
laysakura Jun 3, 2021
590681a
build esop
laysakura Jun 3, 2021
24a1ad4
x
laysakura Jun 3, 2021
805b002
fix name
laysakura Jun 3, 2021
34ee43c
fix: needs this var
laysakura Jun 3, 2021
825e400
revive
laysakura Jun 3, 2021
2c37580
fin azure-pipeline
laysakura Jun 3, 2021
e0953a0
refactor: use into()
laysakura Jun 3, 2021
1c3f279
refactor: use into()
laysakura Jun 3, 2021
a48b03f
fix test code and add unit test to CI
laysakura Jun 3, 2021
6719f60
fix: typo
laysakura Jun 4, 2021
06771c7
clippy for encrypted-sql-ops crates
laysakura Jun 4, 2021
1bd119f
clippy for encrypted-sql-ops-pg-extension
laysakura Jun 4, 2021
30e5fff
follow repo's unit test manner
laysakura Jun 4, 2021
4c39f3f
fix clippy target
laysakura Jun 4, 2021
46aa090
fix clippy errors
laysakura Jun 4, 2021
488d05c
fix: compile error on `make DEBUG=1 TEST=1 ENCLAVE_DIR=tests/units/en…
laysakura Jun 4, 2021
a0152c3
esop-docker-compose.yml as utility
laysakura Jun 4, 2021
767d02b
adds integration test to CI
laysakura Jun 5, 2021
d428ef1
fix: pass UID & GID
laysakura Jun 5, 2021
05289cd
fix: CI user is root so need to specify anonify-dev user for container
laysakura Jun 5, 2021
5965881
fix: chown anonify dir
laysakura Jun 5, 2021
c987589
ci: revert
laysakura Jun 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ docker/
!docker/entrypoint

.dockerignore
.git
118 changes: 97 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ members = [
"modules/key-vault-ecall-types",
"modules/occlum-enclave",
"modules/occlum-host",
"modules/encrypted-sql-ops-enclave",
"modules/encrypted-sql-ops-host",
"modules/encrypted-sql-ops-ecall-types",
"nodes/key-vault",
"nodes/state-runtime/api",
"nodes/state-runtime/server",
Expand All @@ -31,9 +34,14 @@ members = [
"example/occlum/rpc-types",
"example/occlum/enclave",
"example/occlum/host",
"example/encrypted-sql-ops/enclave",
"example/wallet",
"tests/integration",
"tests/units/enclave",
"tests/units/host",
"tests/utils",
]
exclude = [
# If adding this to workspace, top-level `cargo check` needs `pgx` installed and initialized.
"example/encrypted-sql-ops/pg-extension",
]
83 changes: 83 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ stages:
- script: docker-compose down
condition: always()
displayName: 'rust-sgx-sdk docker-compose down'

- script: |
cp .env.sample .env
export SPID=$(SPID)
export SUB_KEY=$(SUB_KEY)

docker-compose -f pgx-docker-compose.yml up -d
docker-compose -f pgx-docker-compose.yml exec -T sgx_machine_pgx bash -c "cd anonify && ./scripts/encrypted-sql-ops-pg-test.sh"
displayName: 'Run encrypted-sql-ops-pg integration tests'
- script: docker-compose -f pgx-docker-compose.yml down
condition: always()
displayName: 'pgx docker-compose down'

# NOTE: temporary removed: Add once occlum version bump up to 0.23.0
# - script: |
# cp .env.sample .env
Expand Down Expand Up @@ -124,6 +137,25 @@ stages:
dockerfile: ./docker/base-anonify-dev.Dockerfile
buildContext: .

- task: Docker@2
displayName: Build anonify-dev-pgx image
inputs:
command: build
containerRegistry: anonify-ci-cd-acr
repository: anonify-dev-pgx
tags: latest
dockerfile: ./docker/base-anonify-dev-pgx.Dockerfile
buildContext: .
- task: Docker@2
displayName: Push anonify-dev-pgx image
inputs:
command: push
containerRegistry: anonify-ci-cd-acr
repository: anonify-dev-pgx
tags: latest
dockerfile: ./docker/base-anonify-dev-pgx.Dockerfile
buildContext: .

- script: docker image prune -f
displayName: Remove dangling images

Expand Down Expand Up @@ -153,6 +185,7 @@ stages:
tags: latest
dockerfile: ./docker/example-erc20.Dockerfile
buildContext: .

- task: Docker@2
displayName: Build key-vault for erc20 image
inputs:
Expand All @@ -172,5 +205,55 @@ stages:
tags: latest
dockerfile: ./docker/example-keyvault.Dockerfile
buildContext: .

- task: Docker@2
displayName: Build encrypted-sql-ops-pg image
inputs:
command: build
containerRegistry: anonify-ci-cd-acr
repository: encrypted-sql-ops-pg
tags: latest
dockerfile: ./docker/example-encrypted-sql-ops-pg.Dockerfile
buildContext: .
arguments: '--build-arg AZ_KV_ENDPOINT=$(AZ_KV_ENDPOINT) --build-arg AZURE_CLIENT_ID=$(AZURE_CLIENT_ID) --build-arg AZURE_CLIENT_SECRET=$(AZURE_CLIENT_SECRET) --build-arg AZURE_TENANT_ID=$(AZURE_TENANT_ID) --build-arg PROD_ID=$(PROD_ID) --build-arg ISVSVN=$(ISVSVN)'
- task: Docker@2
displayName: Push encrypted-sql-ops-pg image
inputs:
command: push
containerRegistry: anonify-ci-cd-acr
repository: encrypted-sql-ops-pg
tags: latest
dockerfile: ./docker/example-encrypted-sql-ops-pg.Dockerfile
buildContext: .

- script: docker image prune -f
displayName: Remove dangling images

- stage: E2E_encrypted_sql_ops_pg
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
jobs:
- job: E2E_encrypted_sql_ops_pg
pool:
name: 'AnonifyAgent'
steps:
- task: Docker@2
displayName: Build encrypted-sql-ops-pg image
inputs:
command: build
containerRegistry: anonify-ci-cd-acr
repository: encrypted-sql-ops-pg
tags: latest
dockerfile: ./docker/example-encrypted-sql-ops-pg.Dockerfile
buildContext: .
arguments: '--build-arg AZ_KV_ENDPOINT=$(AZ_KV_ENDPOINT) --build-arg AZURE_CLIENT_ID=$(AZURE_CLIENT_ID) --build-arg AZURE_CLIENT_SECRET=$(AZURE_CLIENT_SECRET) --build-arg AZURE_TENANT_ID=$(AZURE_TENANT_ID) --build-arg PROD_ID=$(PROD_ID) --build-arg ISVSVN=$(ISVSVN)'
- script: |
export SPID=$(SPID)
export SUB_KEY=$(SUB_KEY)
docker-compose -f esop-docker-compose.yml up --exit-code-from encrypted_sql_ops_pg
displayName: 'Run E2E tests for encrypted-sql-ops-pg'
- script: docker image prune -f
condition: always()
displayName: Remove dangling images
- script: docker-compose -f esop-docker-compose.yml down
condition: always()
displayName: 'Shutdown'
5 changes: 2 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Should match to the name: `docker/base-*.Dockerfile` in order for CI to build &
- for developing in the occlum-enable environment
- `base-occlum-host.Dockerfile`
- for a non-sgx environment to communicate with occlum enclave
- `base-anonify-dev-pgx.Dockerfile`
- [pgx](https://github.com/zombodb/pgx) is installed in addition to `anonify-dev` container.

#### Example `docker run` command

Expand All @@ -47,6 +49,3 @@ $ docker run --env-file .env -v `pwd`:/home/anonify-dev/anonify --rm -it anonif
### Application Images

Should match to the name: `docker/example-*.Dockerfile` in order for CI to build & push every time main branch has been changed (supposing app codes have been modified).

- `example-erc20.Dockerfile`
- `example-keyvault.Dockerfile`
Loading