Skip to content

Commit

Permalink
fix leftover since last change of dockerfile. (#3185)
Browse files Browse the repository at this point in the history
* fix leftover since last change of dockerfile.

* only work within omni folder. Nother else.

* not change the file path

* avoid duplicate file and folder name
  • Loading branch information
BillyWooo authored Dec 4, 2024
1 parent 68a4d70 commit 4558ce1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ jobs:
if: needs.set-condition.outputs.rebuild_omni_executor == 'true'
uses: docker/build-push-action@v6
with:
context: .
context: tee-worker/omni-executor/
file: tee-worker/omni-executor/Dockerfile
tags: litentry/omni-executor:latest
target: executor-worker
Expand Down
24 changes: 11 additions & 13 deletions tee-worker/omni-executor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
# rust:1.82 is a Debian GNU/Linux 12 (bookworm) image
FROM rust:1.82-bookworm AS plain-builder

ENV HOME=/home/ubuntu
ENV BUILD_DIR=$HOME/tee-worker/omni-executor
ENV SRC_DIR=/home/ubuntu/omni-executor

COPY . $HOME
WORKDIR $BUILD_DIR
COPY . $SRC_DIR
WORKDIR $SRC_DIR

RUN cargo build --release

Expand All @@ -18,18 +17,17 @@ RUN cargo build --release
##################################################
FROM node:20-bookworm-slim AS executor-worker

ENV HOME=/home/ubuntu
ENV BUILD_DIR=$HOME/tee-worker/omni-executor
ENV EXECUT_DIR=/usr/local/bin
WORKDIR $EXECUT_DIR
ENV SRC_DIR=/home/ubuntu/omni-executor
ENV BIN_DIR=/usr/local/bin
WORKDIR $BIN_DIR

RUN apt update && apt install -y ca-certificates
COPY --from=plain-builder $BUILD_DIR/target/release/executor-worker $EXECUT_DIR/executor-worker
COPY --from=plain-builder $SRC_DIR/target/release/executor-worker $BIN_DIR/executor-worker

RUN chmod +x $EXECUT_DIR/executor-worker
RUN ls -al $EXECUT_DIR
RUN ldd $EXECUT_DIR/executor-worker && $EXECUT_DIR/executor-worker --version
CMD ["$EXECUT_DIR/executor-worker"]
RUN chmod +x $BIN_DIR/executor-worker
RUN ls -al $BIN_DIR
RUN ldd $BIN_DIR/executor-worker && $BIN_DIR/executor-worker --version
CMD ["$BIN_DIR/executor-worker"]



Expand Down
9 changes: 4 additions & 5 deletions tee-worker/omni-executor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SELF_EXE = omni-executor-worker
COMPILATION_FEATURES =

ROOTDIR := $(shell git rev-parse --show-toplevel)
EXECUTOR_DIR := $(ROOTDIR)/tee-worker/omni-executor
OMNI_DIR := $(ROOTDIR)/tee-worker/omni-executor

.PHONY: all
all: $(SELF_EXE) omni-executor.manifest
Expand Down Expand Up @@ -69,16 +69,15 @@ distclean: clean
# By default SGX_MODE=SW for docker image
.PHONY: build-docker
build-docker:
docker build --target builder -t local-builder:latest -f $(EXECUTOR_DIR)/Dockerfile $(ROOTDIR)
docker build --target executor-worker -t litentry/omni-executor:latest -f -f $(EXECUTOR_DIR)/Dockerfile $(ROOTDIR)
docker build --target executor-worker -t litentry/omni-executor:latest -f $(OMNI_DIR)/Dockerfile $(OMNI_DIR)

.PHONY: start-local
start-local:
docker compose -f $(EXECUTOR_DIR)/docker/docker-compose.yml up
docker compose -f $(OMNI_DIR)/docker/docker-compose.yml up

.PHONY: stop-local
stop-local:
docker compose -f $(EXECUTOR_DIR)/docker/docker-compose.yml down
docker compose -f $(OMNI_DIR)/docker/docker-compose.yml down

.PHONY: get-pallet-metadata
get-pallet-metadata:
Expand Down

0 comments on commit 4558ce1

Please sign in to comment.