Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Commit

Permalink
try shared target dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Apr 25, 2018
1 parent 21b6763 commit 6235a98
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 27 deletions.
55 changes: 43 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,53 @@ jobs:
- checkout

# Install Ekiden binaries.
- run: cargo install --git https://github.com/oasislabs/ekiden --tag 0.1.0-alpha.3 ekiden-tools
- run: cargo install --git https://github.com/oasislabs/ekiden --tag 0.1.0-alpha.3 ekiden-compute
- run: cargo install --git https://github.com/oasislabs/ekiden --tag 0.1.0-alpha.3 ekiden-consensus
# %%% change --branch ... to --tag ...
- run:
environment:
CARGO_TARGET_DIR: target
command: >-
cargo install
--git https://github.com/oasislabs/ekiden
--branch pro-wh/feature/targetpath
--debug
ekiden-tools
- run:
environment:
CARGO_TARGET_DIR: target
command: >-
cargo install
--git https://github.com/oasislabs/ekiden
--branch pro-wh/feature/targetpath
--debug
ekiden-compute
- run:
environment:
CARGO_TARGET_DIR: target
command: >-
cargo install
--git https://github.com/oasislabs/ekiden
--branch pro-wh/feature/targetpath
--debug
ekiden-consensus
# Build key manager contract.
- run: |
cargo ekiden build-contract \
--git https://github.com/oasislabs/ekiden \
--tag 0.1.0-alpha.3 \
--output target/contract \
ekiden-key-manager
# %%% change --branch ... to --tag ...
- run: >-
cargo ekiden build-contract
--git https://github.com/oasislabs/ekiden
--branch pro-wh/feature/targetpath
--output target/contract
--target-dir "$PWD/target"
ekiden-key-manager
# Build the contract.
- run: cargo ekiden build-contract --output-identity
# Run the contract tests.
- run: cargo test
# Build the client.
- run:
command: cargo build
environment:
CARGO_BUILD_TARGET_DIR: ../target
working_directory: client
command: cargo build
# Check style. This needs to be after everything is built.
- run: cargo fmt -- --write-mode=diff

Expand All @@ -54,7 +83,6 @@ jobs:
# Start web3 proxy.
- run:
command: ./target/debug/web3-client --mr-enclave $(cat ../target/contract/evm.mrenclave)
working_directory: client
background: true
# TODO: Run a test script.
# - run:
Expand All @@ -76,6 +104,8 @@ jobs:
- run: |
echo "$DOCKERHUB_PASSWORD" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
BUILD_IMAGES_NO_ENTER=1 ./docker/deployment/build-images.sh
# %%% don't push. remove this step
- run: "false"
# Push deployment image.
- run: docker push oasislabs/ekiden-contract-evm:latest
# Update testnet.
Expand All @@ -97,7 +127,8 @@ workflows:
- deploy:
filters:
branches:
only: master
# %%% change back to master
only: targetpath
requires:
- build
experimental:
Expand Down
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ etcommon-hexutil = { version = "0.2", default-features = false }
sha3 = "0.6"
sputnikvm = { version = "0.9", default-features = false }
evm-api = { path = "./api" }
ekiden-core = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
ekiden-trusted = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
# %%% change branch = ... to tag = ...
ekiden-core = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
ekiden-trusted = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
protobuf = "1.4.3"

[build-dependencies]
ekiden-tools = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
ekiden-edl = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
# %%% change branch = ... to tag = ...
ekiden-tools = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
ekiden-edl = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
6 changes: 4 additions & 2 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ authors = ["Oasis Labs Inc. <[email protected]>"]
build = "build.rs"

[dependencies]
ekiden-core = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
# %%% change branch = ... to tag = ...
ekiden-core = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
protobuf = "1.4.3"

[build-dependencies]
ekiden-tools = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
# %%% change branch = ... to tag = ...
ekiden-tools = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
7 changes: 4 additions & 3 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ authors = ["Oasis Labs Inc. <[email protected]>", "Wei Tang <[email protected]>"]

## Ekiden client dependencies

client-utils = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
ekiden-core = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
ekiden-rpc-client = { git = "https://github.com/oasislabs/ekiden", tag = "0.1.0-alpha.3" }
# %%% change branch = ... to tag = ...
client-utils = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
ekiden-core = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
ekiden-rpc-client = { git = "https://github.com/oasislabs/ekiden", branch = "pro-wh/feature/targetpath" }
evm-api = { path = "../api" }
clap = "2.29.1"
rand = "0.4"
Expand Down
11 changes: 5 additions & 6 deletions docker/deployment/build-images-inner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ EOF
fi

# Build all Ekiden binaries and resources.
# TODO: Check if we can save any compilation by setting CARGO_TARGET_DIR.
cargo install --force --git https://github.com/oasislabs/ekiden --tag 0.1.0-alpha.3 ekiden-tools
# TODO: Let this share our target path to reduce duplicated compilation.
cargo ekiden build-contract --git https://github.com/oasislabs/ekiden --tag 0.1.0-alpha.3 --output target/contract --release ekiden-key-manager
# %%% change --branch ... to --tag ...
CARGO_TARGET_DIR=target cargo install --force --git https://github.com/oasislabs/ekiden --branch pro-wh/feature/targetpath ekiden-tools
cargo ekiden build-contract --git https://github.com/oasislabs/ekiden --branch pro-wh/feature/targetpath --output target/contract --target-dir target --release ekiden-key-manager
cargo ekiden build-contract --release --output-identity
(cd client && cargo build --release)
(cd client && CARGO_BUILD_TARGET_DIR=../target cargo build --release)

# Package all binaries and resources.
mkdir -p target/docker-deployment/context/bin target/docker-deployment/context/lib target/docker-deployment/context/res
ln target/contract/ekiden-key-manager.so target/docker-deployment/context/lib/evm-key-manager.so
ln target/contract/evm.so target/docker-deployment/context/lib
ln target/contract/evm.mrenclave target/docker-deployment/context/res
ln client/target/release/web3-client target/docker-deployment/context/bin
ln target/release/web3-client target/docker-deployment/context/bin
ln docker/deployment/Dockerfile target/docker-deployment/context/Dockerfile
tar cvzhf target/docker-deployment/context.tar.gz -C target/docker-deployment/context .
rm -rf target/docker-deployment/context

0 comments on commit 6235a98

Please sign in to comment.