Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bitacross-worker #3203

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 0 additions & 15 deletions .github/file-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,6 @@ identity_src: &identity_src
- 'tee-worker/identity/build.Dockerfile'
- 'tee-worker/identity/enclave-runtime/**'

bitacross_src: &bitacross_src
- 'common/**'
- 'tee-worker/Cargo.toml'
- 'tee-worker/Cargo.lock'
- 'tee-worker/bitacross/**/*.rs'
- 'tee-worker/bitacross/**/rust-toolchain.toml'
- 'tee-worker/bitacross/build.Dockerfile'
- 'tee-worker/bitacross/enclave-runtime/**'

bitacross_test: &bitacross_test
- 'tee-worker/bitacross/ts-tests/**'
- 'tee-worker/bitacross/cli/*.sh'
- 'parachain/docker/**'
- 'tee-worker/bitacross/docker/*.yml'

omni_executor_src: &omni_executor_src
- 'tee-worker/omni-executor/Cargo.toml'
- 'tee-worker/omni-executor/Cargo.lock'
Expand Down
200 changes: 1 addition & 199 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ on:
description: rebuild-identity
required: true
default: true
rebuild-bitacross:
type: boolean
description: rebuild-bitacross
required: true
default: true
rebuild-omni-executor:
type: boolean
description: rebuild-omni-executor
Expand Down Expand Up @@ -99,12 +94,10 @@ jobs:
outputs:
rebuild_parachain: ${{ steps.env.outputs.rebuild_parachain }}
rebuild_identity: ${{ steps.env.outputs.rebuild_identity }}
rebuild_bitacross: ${{ steps.env.outputs.rebuild_bitacross }}
rebuild_omni_executor: ${{ steps.env.outputs.rebuild_omni_executor }}
push_docker: ${{ steps.env.outputs.push_docker }}
run_parachain_test: ${{ steps.env.outputs.run_parachain_test }}
run_identity_test: ${{ steps.env.outputs.run_identity_test }}
run_bitacross_test: ${{ steps.env.outputs.run_bitacross_test }}
run_omni_executor_test: ${{ steps.env.outputs.run_omni_executor_test }}
steps:
- uses: actions/checkout@v4
Expand All @@ -124,22 +117,17 @@ jobs:
run: |
rebuild_parachain=false
rebuild_identity=false
rebuild_bitacross=false
rebuild_omni_executor=false
push_docker=false
run_parachain_test=false
run_identity_test=false
run_bitacross_test=false
run_omni_executor_test=false
if [ "${{ github.event.inputs.rebuild-parachain }}" = "true" ] || [ "${{ steps.filter.outputs.parachain_src }}" = "true" ]; then
rebuild_parachain=true
fi
if [ "${{ github.event.inputs.rebuild-identity }}" = "true" ] || [ "${{ steps.filter.outputs.identity_src }}" = "true" ]; then
rebuild_identity=true
fi
if [ "${{ github.event.inputs.rebuild-bitacross }}" = "true" ] || [ "${{ steps.filter.outputs.bitacross_src }}" = "true" ]; then
rebuild_bitacross=true
fi
if [ "${{ github.event.inputs.rebuild-omni-executor }}" = "true" ] || [ "${{ steps.filter.outputs.omni_executor_src }}" = "true" ]; then
rebuild_omni_executor=true
fi
Expand All @@ -154,20 +142,15 @@ jobs:
if [ "${{ steps.filter.outputs.identity_test }}" = "true" ] || [ "$rebuild_parachain" = "true" ] || [ "$rebuild_identity" = "true" ]; then
run_identity_test=true
fi
if [ "${{ steps.filter.outputs.bitacross_test }}" = "true" ] || [ "$rebuild_parachain" = "true" ] || [ "$rebuild_bitacross" = "true" ]; then
run_bitacross_test=true
fi
if [ "${{ steps.filter.outputs.omni_executor_test }}" = "true" ] || [ "$rebuild_parachain" = "true" ] || [ "$rebuild_omni_executor" = "true" ]; then
run_omni_executor_test=true
fi
echo "rebuild_parachain=$rebuild_parachain" | tee -a $GITHUB_OUTPUT
echo "rebuild_identity=$rebuild_identity" | tee -a $GITHUB_OUTPUT
echo "rebuild_bitacross=$rebuild_bitacross" | tee -a $GITHUB_OUTPUT
echo "rebuild_omni_executor=$rebuild_omni_executor" | tee -a $GITHUB_OUTPUT
echo "push_docker=$push_docker" | tee -a $GITHUB_OUTPUT
echo "run_parachain_test=$run_parachain_test" | tee -a $GITHUB_OUTPUT
echo "run_identity_test=$run_identity_test" | tee -a $GITHUB_OUTPUT
echo "run_bitacross_test=$run_bitacross_test" | tee -a $GITHUB_OUTPUT
echo "run_omni_executor_test=$run_omni_executor_test" | tee -a $GITHUB_OUTPUT

fmt:
Expand Down Expand Up @@ -204,11 +187,6 @@ jobs:
run: |
cargo fmt --all -- --check

- name: bitacross-worker enclave-runtime fmt check
working-directory: ./tee-worker/bitacross/enclave-runtime
run: |
cargo fmt --all -- --check

- name: omni-executor fmt check
working-directory: ./tee-worker/omni-executor
run: |
Expand Down Expand Up @@ -292,7 +270,7 @@ jobs:
working-directory: ./tee-worker
shell: bash
run: |
for d in . identity/enclave-runtime bitacross/enclave-runtime; do
for d in . identity/enclave-runtime; do
pushd "$d"
echo "::group::cargo clippy all"
cargo clippy --release -- -D warnings
Expand Down Expand Up @@ -539,84 +517,6 @@ jobs:
if: failure()
uses: andymckay/[email protected]

bitacross-build:
runs-on: ubuntu-22.04
needs:
- fmt
- set-condition
- sequentialise
steps:
- uses: actions/checkout@v4

- name: Free up disk space
if: startsWith(runner.name, 'GitHub Actions')
uses: ./.github/actions/disk-cleanup

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# use the docker driver to access the local image
# we don't need external caches or multi platforms here
# see https://docs.docker.com/build/drivers/
driver: docker

- name: Build local builder
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: tee-worker/bitacross/build.Dockerfile
tags: local-builder:latest
target: builder
build-args: |
WORKER_MODE_ARG=offchain-worker
ADDITIONAL_FEATURES_ARG=

- name: Build worker
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: tee-worker/bitacross/build.Dockerfile
tags: litentry/bitacross-worker:latest
target: deployed-worker

- name: Build cli
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: tee-worker/bitacross/build.Dockerfile
tags: litentry/bitacross-cli:latest
target: deployed-client

- name: Pull and tag worker and cli image optionally
if: needs.set-condition.outputs.rebuild_bitacross == 'false'
run: |
docker pull litentry/bitacross-worker:latest
docker pull litentry/bitacross-cli:latest

- run: docker images --all

- name: Test enclave
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
# cargo test is not supported in the enclave
# see https://github.com/apache/incubator-teaclave-sgx-sdk/issues/232
run: docker run litentry/bitacross-worker:latest test --all

- name: Save docker images
run: docker save litentry/bitacross-worker:latest litentry/bitacross-cli:latest | gzip > litentry-bitacross.tar.gz

- name: Upload docker images
uses: actions/upload-artifact@v4
with:
name: litentry-bitacross
path: litentry-bitacross.tar.gz
if-no-files-found: error
- name: Fail early
if: failure()
uses: andymckay/[email protected]

omni-executor-build:
runs-on: ubuntu-22.04
needs:
Expand Down Expand Up @@ -964,86 +864,6 @@ jobs:
if-no-files-found: ignore
retention-days: 3

bitacross-worker-test:
runs-on: ubuntu-22.04
needs:
- set-condition
- parachain-build-dev
- bitacross-build
strategy:
fail-fast: false
matrix:
include:
- test_name: lit-sign-bitcoin
name: ${{ matrix.test_name }}
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: litentry-parachain-dev

- uses: actions/download-artifact@v4
with:
name: litentry-bitacross

- name: Load docker image
run: |
docker load < litentry-parachain-dev.tar.gz
docker load < litentry-bitacross.tar.gz
docker images

- name: Enable corepack and pnpm
run: corepack enable && corepack enable pnpm

- name: Launch parachain network
run: |
make launch-network-litentry

- name: Integration bitacross worker test ${{ matrix.test_name }}
working-directory: ./tee-worker/bitacross/docker
if: needs.set-condition.outputs.run_bitacross_test == 'true'
timeout-minutes: 40
run: |
docker compose -f multiworker-docker-compose.yml -f ${{ matrix.test_name }}.yml up --no-build --exit-code-from ${{ matrix.test_name }} ${{ matrix.test_name }}

- name: Stop integration multi worker docker containers
working-directory: ./tee-worker/bitacross/docker
if: needs.set-condition.outputs.run_bitacross_test == 'true'
run: |
docker compose -f multiworker-docker-compose.yml -f ${{ matrix.test_name }}.yml stop

- name: Upload zombienet logs if test fails
continue-on-error: true
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.test_name }}-zombienet-logs
path: |
/tmp/parachain_dev
!/tmp/parachain_dev/polkadot*
!/tmp/parachain_dev/zombienet*
!/tmp/parachain_dev/litentry-collator
if-no-files-found: ignore
retention-days: 3

- name: Collect docker logs if test fails
continue-on-error: true
uses: jwalton/gh-docker-logs@v2
if: failure()
with:
tail: all
dest: docker-logs

- name: Upload docker logs if test fails
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.test_name }}-docker-logs
path: docker-logs
if-no-files-found: ignore
retention-days: 3

omni-executor-test:
runs-on: ubuntu-22.04
needs:
Expand Down Expand Up @@ -1080,12 +900,6 @@ jobs:
# run: |
# docker compose -f docker-compose.yml -f ${{ matrix.test_name }}.yml up --no-build --exit-code-from ${{ matrix.test_name }} ${{ matrix.test_name }}

# - name: Stop integration omni executor docker containers
# working-directory: ./tee-worker/bitacross/docker
# if: needs.set-condition.outputs.run_omni_executor_test == 'true'
# run: |
# docker compose -f docker-compose.yml -f ${{ matrix.test_name }}.yml stop

- name: Collect docker logs if test fails
continue-on-error: true
uses: jwalton/gh-docker-logs@v2
Expand Down Expand Up @@ -1123,7 +937,6 @@ jobs:
- set-condition
- parachain-ts-test
- identity-single-worker-test
- bitacross-worker-test
- omni-executor-test
if: ${{ !failure() && needs.set-condition.outputs.push_docker == 'true' }}
steps:
Expand All @@ -1135,10 +948,6 @@ jobs:
with:
name: litentry-identity

- uses: actions/download-artifact@v4
with:
name: litentry-bitacross

- uses: actions/download-artifact@v4
with:
name: litentry-omni
Expand All @@ -1163,13 +972,6 @@ jobs:
docker push litentry/identity-worker
docker push litentry/identity-cli

- name: Push bitacross-worker image
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
run: |
docker load < litentry-bitacross.tar.gz
docker push litentry/bitacross-worker
docker push litentry/bitacross-cli

- name: Push omni-executor image
if: needs.set-condition.outputs.rebuild_omni_executor == 'true'
run: |
Expand Down
Loading
Loading