Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
remove not needed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vladupshot committed Jan 31, 2024
1 parent 3f5d85d commit 1dfeb37
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 110 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_push_ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
ECR_REPOSITORY_HEAD="${ECR_REPOSITORY}-head"
docker build --pull -f docker/Dockerfile_head \
--build-arg "GH_TOKEN=${{ secrets.GHCR_TOKEN }}" \
--build-arg "GH_TOKEN=${{ secrets.GH_READONLY_PAT }}" \
-t $ECR_REGISTRY/$ECR_REPOSITORY_HEAD:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY_HEAD:$IMAGE_TAG
Expand All @@ -63,7 +63,7 @@ jobs:
# Build a docker container and push it to ECR so that it can be deployed to ECS.
# compute-node workers
docker build --pull -f docker/Dockerfile \
--build-arg "GH_TOKEN=${{ secrets.GHCR_TOKEN }}" \
--build-arg "GH_TOKEN=${{ secrets.GH_READONLY_PAT }}" \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand Down
104 changes: 0 additions & 104 deletions docker/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion docker/Dockerfile.Operator
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax = devthefuture/dockerfile-x
FROM ./docker/Dockerfile
FROM ./docker/Dockerfile_worker
COPY ./docker/requirements.txt /tmp/
RUN pip install --requirement /tmp/requirements.txt
COPY . /tmp/
5 changes: 2 additions & 3 deletions docker/Dockerfile_head
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM --platform=linux/amd64 golang:1.21-bookworm AS builder

WORKDIR /src
ADD . /src

WORKDIR /src
ARG GH_TOKEN

RUN git config --global url."https://${GH_TOKEN}@github.com".insteadOf "https://github.com"
ENV GOPRIVATE="github.com/upshot-tech/"

RUN go mod download && \
go mod tidy && \
make all

###########################
Expand Down
72 changes: 72 additions & 0 deletions docker/Dockerfile_worker
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM --platform=linux/amd64 golang:1.21-bookworm AS builder

ADD . /src
WORKDIR /src
ARG GH_TOKEN
RUN git config --global url."https://${GH_TOKEN}@github.com".insteadOf "https://github.com"
ENV GOPRIVATE="github.com/upshot-tech/"

RUN go mod download && \
go mod tidy && \
make all

###########################
FROM --platform=linux/amd64 python:3.12-slim-bookworm
ENV DEBIAN_FRONTEND=noninteractive \
USERNAME=appuser \
APP_PATH=/data

## curl, unzip other utilities
#! libssl-dev - BLS_RUNTIME dependency # - temporary use libssl 1.1 TODO: Should use fresher libssl
#! gh - to downaload release from priv repo
RUN apt update && \
apt -y dist-upgrade && \
apt install -y --no-install-recommends \
tzdata \
curl \
unzip \
ca-certificates \
libssl-dev \
gh && \
rm -rf /var/cache/apt/* && \
python3 -m pip install --upgrade pip

RUN BLS_RUNTIME="v0.3.1" && \
curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/${BLS_RUNTIME}/blockless-runtime.linux-latest.x86_64.tar.gz && \
mkdir -p /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime
ENV RUNETIME_PATH=/app/runtime

ARG GH_TOKEN
ARG BLS_EXTENSION_VER
# If BLS_EXTENSION_VER install the version else install latest
RUN if [ -n $BLS_EXTENSION_VER]; then \
gh release download $BLS_EXTENSION_VER \
--repo "upshot-tech/upshot-blockless-extension" \
--pattern '*linux-amd64.tar.gz' \
--output upshot-extension.tar.gz; \
else \
gh release download $(gh release list --repo "upshot-tech/upshot-blockless-extension" | grep Latest | awk '{print($1)}') \
--repo "upshot-tech/upshot-blockless-extension" \
--pattern '*linux-amd64.tar.gz' \
--output upshot-extension.tar.gz; \
fi && \
mkdir -p /app/runtime/extensions && \
tar -xvkf ./upshot-extension.tar.gz -C /app/runtime/extensions && \
rm ./upshot-extension.tar.gz

COPY --from=builder /src/dist/upshot-node /usr/local/bin/upshot-node
COPY --from=builder /src/dist/upshot-keys /usr/local/bin/upshot-keys

# Smoke test
RUN /app/runtime/bls-runtime --help && \
/app/runtime/extensions/upshot-blockless-extension --help

RUN groupadd -g 1001 ${USERNAME} \
&& useradd -m -d ${APP_PATH} -u 1001 -g 1001 ${USERNAME}

USER ${USERNAME}

VOLUME ${APP_PATH}
EXPOSE 8080 9527

ENTRYPOINT ["upshot-node"]

0 comments on commit 1dfeb37

Please sign in to comment.