Skip to content

Commit

Permalink
Add monitor service image
Browse files Browse the repository at this point in the history
  • Loading branch information
m30m committed Feb 5, 2024
1 parent 163ef8f commit f7b4017
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/push-rust-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,27 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
id: meta_server
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
- name: Extract metadata (tags, labels) for Docker
id: meta_monitor
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-monitor
- name: Build and push server docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta_server.outputs.tags }}
labels: ${{ steps.meta_server.outputs.labels }}
- name: Build and push vault monitor docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ./per_sdk/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta_monitor.outputs.tags }}
labels: ${{ steps.meta_monitor.outputs.labels }}
62 changes: 62 additions & 0 deletions per_sdk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
git ARG RUST_VERSION=1.66.1
ARG PYTHON_VERSION=3.11
ARG POETRY_VERSION=1.6.1

FROM node:21-alpine3.18 AS npm_build

WORKDIR /src
COPY per_multicall per_multicall
WORKDIR /src/per_multicall
RUN npm install


FROM rust:${RUST_VERSION} AS contract_build
# Set default toolchain
RUN rustup default nightly-2023-07-23

# Install dependencies
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="${PATH}:/root/.foundry/bin/"
RUN foundryup

# Add solidity dependencies
WORKDIR /src
COPY per_multicall per_multicall
COPY --from=npm_build /src/per_multicall/node_modules/ /src/per_multicall/node_modules/
WORKDIR /src/per_multicall
RUN forge install foundry-rs/forge-std --no-git --no-commit
RUN forge install OpenZeppelin/openzeppelin-contracts --no-git --no-commit
RUN forge build --via-ir


FROM python:$PYTHON_VERSION


ARG APP_NAME
ARG APP_PATH
ARG POETRY_VERSION

ENV \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1
ENV \
POETRY_VERSION=$POETRY_VERSION \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1

# Install Poetry - respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python
ENV PATH="$POETRY_HOME/bin:$PATH"

# Copy only requirements to cache them in docker layer
WORKDIR /src
COPY per_sdk/poetry.lock per_sdk/pyproject.toml /src/per_sdk/
COPY --from=contract_build /src/per_multicall/out/ /src/per_multicall/out/

# Project initialization:
RUN poetry -C per_sdk install --no-interaction --no-ansi

# Creating folders, and files for a project:
COPY per_sdk/ /src/per_sdk

0 comments on commit f7b4017

Please sign in to comment.