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

fix leftover since last change of dockerfile. #3185

Merged
merged 5 commits into from
Dec 4, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading