Skip to content

Commit f85a91b

Browse files
authored
Switch to local dependencies (#1037)
* use local dependencies * fix docker path
1 parent b6dda59 commit f85a91b

File tree

16 files changed

+57
-86
lines changed

16 files changed

+57
-86
lines changed

.github/workflows/tee-worker-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,19 @@ jobs:
107107
env:
108108
DOCKER_BUILDKIT: 1
109109
run: >
110-
docker build -t integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}
110+
cd .. && docker build -t integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}
111111
--target deployed-worker
112112
--build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }}
113-
-f build.Dockerfile .
113+
-f tee-worker/build.Dockerfile .
114114
115115
- name: Build CLI client
116116
env:
117117
DOCKER_BUILDKIT: 1
118118
run: >
119-
docker build -t integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}
119+
cd .. && docker build -t integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}
120120
--target deployed-client
121121
--build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }}
122-
-f build.Dockerfile .
122+
-f tee-worker/build.Dockerfile .
123123
124124
- run: docker images --all
125125

@@ -322,12 +322,12 @@ jobs:
322322
name: logs-${{ matrix.test }}-${{ matrix.flavor_id }}
323323
path: ${{ env.UPLOAD_DOWNLOAD_DIR_PREFIX }}/${{ env.LOG_DIR }}
324324

325-
# Only push docker image when tests are passed on dev branch
325+
# Only push docker image when tests are passed and it's a push event
326326
push-docker-image:
327327
runs-on: ubuntu-latest
328328
needs:
329329
- integration-tests
330-
if: ${{ success() && (github.event_name == 'push') && (github.ref == 'refs/heads/dev') }}
330+
if: ${{ success() && (github.event_name == 'push') }}
331331
steps:
332332
- uses: actions/download-artifact@v3
333333
with:

tee-worker/Cargo.lock

Lines changed: 19 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tee-worker/app-libs/sgx-runtime/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pallet-parentchain = { default-features = false, git = "https://github.com/integ
5050

5151
# Litentry
5252
litentry-primitives = { path = "../../litentry/primitives", default-features = false }
53-
pallet-identity-management = { path = "../../litentry/pallets/identity-management", default-features = false }
53+
pallet-imt = { package = "pallet-identity-management-tee", path = "../../litentry/pallets/identity-management", default-features = false }
5454

5555
[features]
5656
default = ["std"]
@@ -85,7 +85,7 @@ std = [
8585
"pallet-timestamp/std",
8686
"pallet-transaction-payment/std",
8787
"pallet-parentchain/std",
88-
"pallet-identity-management/std",
88+
"pallet-imt/std",
8989
"pallet-grandpa/std",
9090
"sp-api/std",
9191
"sp-core/std",

tee-worker/app-libs/sgx-runtime/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub use sp_runtime::BuildStorage;
7777
pub use sp_runtime::{Perbill, Permill};
7878

7979
// litentry
80-
pub use pallet_identity_management::{self, Call as IdentityManagementCall};
80+
pub use pallet_imt::{self, Call as IdentityManagementCall};
8181

8282
/// Block type as expected by this sgx-runtime.
8383
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
@@ -260,7 +260,7 @@ impl pallet_parentchain::Config for Runtime {
260260
type WeightInfo = ();
261261
}
262262

263-
impl pallet_identity_management::Config for Runtime {
263+
impl pallet_imt::Config for Runtime {
264264
type Event = Event;
265265
type ManageOrigin = EnsureRoot<AccountId>;
266266
type MaxMetadataLength = ConstU32<128>;
@@ -281,7 +281,7 @@ construct_runtime!(
281281
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
282282
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
283283
Parentchain: pallet_parentchain::{Pallet, Call, Storage},
284-
IdentityManagement: pallet_identity_management,
284+
IdentityManagement: pallet_imt,
285285
}
286286
);
287287

@@ -302,7 +302,7 @@ construct_runtime!(
302302
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
303303
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
304304
Parentchain: pallet_parentchain::{Pallet, Call, Storage},
305-
IdentityManagement: pallet_identity_management,
305+
IdentityManagement: pallet_imt,
306306

307307
Evm: pallet_evm::{Pallet, Call, Storage, Config, Event<T>},
308308
}

tee-worker/app-libs/stf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su
4141
lc-stf-task-sender = { path = "../../litentry/core/stf-task/sender", default-features = false }
4242
litentry-primitives = { path = "../../litentry/primitives", default-features = false }
4343
pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "master" }
44-
parentchain-primitives = { package = "primitives", git = "https://github.com/litentry/litentry-parachain.git", branch = "tee-dev", default-features = false, optional = true }
44+
parentchain-primitives = { package = "primitives", path = "../../../primitives", default-features = false, optional = true }
4545
rand = { version = "0.7", optional = true }
4646
rand-sgx = { package = "rand", git = "https://github.com/mesalock-linux/rand-sgx", tag = "sgx_1.1.3", features = ["sgx_tstd"], optional = true }
4747
ring = { version = "0.16.20", default-features = false }

tee-worker/app-libs/stf/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ pub use parentchain_primitives::{Balance, BlockNumber, Index};
3333

3434
use codec::{Compact, Decode, Encode};
3535
use derive_more::Display;
36-
use ita_sgx_runtime::{
37-
pallet_identity_management::MetadataOf, IdentityManagement, Runtime, System,
38-
};
36+
use ita_sgx_runtime::{pallet_imt::MetadataOf, IdentityManagement, Runtime, System};
3937
use itp_node_api_metadata::Error as MetadataError;
4038
use itp_node_api_metadata_provider::Error as MetadataProviderError;
4139
use sp_core::{crypto::AccountId32, ed25519, sr25519, Pair, H256};

tee-worker/app-libs/stf/src/trusted_call_litentry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl TrustedCallSigned {
187187
assertion: Assertion,
188188
) -> StfResult<()> {
189189
let v_identity_context =
190-
ita_sgx_runtime::pallet_identity_management::Pallet::<Runtime>::get_identity_and_identity_context(&who);
190+
ita_sgx_runtime::pallet_imt::Pallet::<Runtime>::get_identity_and_identity_context(&who);
191191

192192
let mut vec_identity: BoundedVec<Identity, MaxIdentityLength> = vec![].try_into().unwrap();
193193

tee-worker/build.Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ ENV WORKER_MODE=$WORKER_MODE_ARG
3636
ARG ADDITIONAL_FEATURES_ARG
3737
ENV ADDITIONAL_FEATURES=$ADDITIONAL_FEATURES_ARG
3838

39-
WORKDIR $HOME/worker
40-
COPY . .
39+
WORKDIR $HOME/tee-worker
40+
COPY . $HOME
4141

4242
RUN make
4343

@@ -71,8 +71,8 @@ ENV RUSTC_WRAPPER="/usr/local/cargo/bin/sccache"
7171
ARG WORKER_MODE_ARG
7272
ENV WORKER_MODE=$WORKER_MODE_ARG
7373

74-
WORKDIR $HOME/worker
75-
COPY . .
74+
WORKDIR $HOME/tee-worker
75+
COPY . $HOME
7676

7777
RUN --mount=type=cache,id=cargo,target=/root/work/.cache/sccache make && sccache --show-stats
7878

@@ -99,8 +99,8 @@ ARG LOG_DIR=/usr/local/log
9999
ENV SCRIPT_DIR ${SCRIPT_DIR}
100100
ENV LOG_DIR ${LOG_DIR}
101101

102-
COPY --from=builder /root/work/worker/bin/integritee-cli /usr/local/bin
103-
COPY ./cli/*.sh /usr/local/worker-cli/
102+
COPY --from=builder /root/work/tee-worker/bin/integritee-cli /usr/local/bin
103+
COPY ./tee-worker/cli/*.sh /usr/local/worker-cli/
104104

105105
RUN chmod +x /usr/local/bin/integritee-cli ${SCRIPT_DIR}/*.sh
106106
RUN mkdir ${LOG_DIR}
@@ -128,7 +128,7 @@ ENV LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${SGX_SDK}/lib64"
128128
WORKDIR /usr/local/bin
129129

130130
COPY --from=builder /opt/sgxsdk/lib64 /opt/sgxsdk/lib64
131-
COPY --from=builder /root/work/worker/bin/* ./
131+
COPY --from=builder /root/work/tee-worker/bin/* ./
132132

133133
RUN touch spid.txt key.txt
134134
RUN chmod +x /usr/local/bin/integritee-service

tee-worker/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sgx_crypto_helper = { branch = "master", git = "https://github.com/apache/teacla
2323
ws = { version = "0.9.1", features = ["ssl"] }
2424

2525
# scs / integritee
26-
my-node-runtime = { package = "rococo-parachain-runtime", git = "https://github.com/litentry/litentry-parachain.git", branch = "tee-dev" }
26+
my-node-runtime = { package = "rococo-parachain-runtime", path = "../../runtime/rococo" }
2727
pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.29" }
2828
substrate-api-client = { features = ["ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.29" }
2929
substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.29" }

tee-worker/core/parentchain/indirect-calls-executor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git"
4242
# litentry
4343
ita-sgx-runtime = { path = "../../../app-libs/sgx-runtime", default-features = false }
4444
litentry-primitives = { path = "../../../litentry/primitives", default-features = false }
45-
pallet-imp = { package = "pallet-identity-management", git = "https://github.com/litentry/litentry-parachain.git", branch = "tee-dev", default-features = false }
45+
pallet-imp = { package = "pallet-identity-management", path = "../../../../pallets/identity-management", default-features = false }
4646

4747
[dev-dependencies]
4848
env_logger = "0.9.0"

0 commit comments

Comments
 (0)