Skip to content

Commit

Permalink
Merge pull request lavanet#493 from lavanet/CNS-409-docker-image-node
Browse files Browse the repository at this point in the history
CNS-409 update docker image for lava node
  • Loading branch information
Yaroms authored May 21, 2023
2 parents b10be20 + f506a13 commit c887567
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 180 deletions.
58 changes: 33 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ FROM ${RUNNER_IMAGE} as runner-base

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -yqq --no-install-recommends \
git curl unzip ca-certificates \
&& apt-get install -yq --no-install-recommends \
git curl unzip ca-certificates jq \
&& apt-get -y purge \
&& apt-get -y clean \
&& apt-get -y autoremove \
Expand All @@ -133,29 +133,37 @@ COPY docker/entrypoint.sh /
COPY docker/start_node.sh start_node.sh
COPY docker/start_portal.sh start_portal.sh

ENV LAVA_HOME_DIR= \
LAVA_USER= \
LAVA_ADDRESS= \
LAVA_KEYRING= \
LAVA_STAKE_AMOUNT= \
LAVA_GAS_MODE= \
LAVA_GAS_ADJUST= \
LAVA_GAS_PRICE= \
LAVA_GEOLOCATION= \
LAVA_RPC_NODE= \
LAVA_CHAIN_ID= \
LAVA_LISTEN_IP= \
LAVA_NODE_PORT_API= \
LAVA_NODE_PORT_GRPC= \
LAVA_NODE_PORT_GRPC_WEB= \
LAVA_NODE_PORT_P2P= \
LAVA_NODE_PORT_RPC= \
LAVA_PORTAL_PORT= \
LAVA_RELAY_CHAIN_ID= \
LAVA_RELAY_IFACE= \
LAVA_RELAY_NODE_URL= \
LAVA_RELAY_ENDPOINT= \
LAVA_LOG_LEVEL=
# common setup
ENV LAVA_COSMOVISOR_URL=
ENV LAVA_CONFIG_GIT_URL=
ENV LAVA_CHAIN_ID=
ENV LAVA_MONIKER=

# common runtime
ENV LAVA_LOG_LEVEL=

# provider/validator [OUTDATED]
#ENV LAVA_ACCOUNT=
#ENV LAVA_USER=
#ENV LAVA_ADDRESS=
#ENV LAVA_KEYRING=
#ENV LAVA_STAKE_AMOUNT=
#ENV LAVA_GAS_MODE=
#ENV LAVA_GAS_ADJUST=
#ENV LAVA_GAS_PRICE=
#ENV LAVA_GEOLOCATION=
#ENV LAVA_RPC_NODE=
#ENV LAVA_LISTEN_IP=
#ENV LAVA_NODE_PORT_API=
#ENV LAVA_NODE_PORT_GRPC=
#ENV LAVA_NODE_PORT_GRPC_WEB=
#ENV LAVA_NODE_PORT_P2P=
#ENV LAVA_NODE_PORT_RPC=
#ENV LAVA_PORTAL_PORT=
#ENV LAVA_RELAY_CHAIN_ID=
#ENV LAVA_RELAY_IFACE=
#ENV LAVA_RELAY_NODE_URL=
#ENV LAVA_RELAY_ENDPOINT=

# lava api
EXPOSE 1317
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
#
# Targets:
#
# build - local build (output: `build/lavad`)
# docker-build - docker build (output: `build/lavad`) with docker image
# build - local build (output: `build/lavad`)
# docker-build - docker build (output: `build/lavad`) with docker image
#
# build-images - build both amd64,arm64 lavad(s) and docker image(s)
# build-image-amd64 - docker build (output: `build/lavad-linux-amd64`) with docker image
# build-image-arm64 - docker build (output: `build/lavad-linux-arm64`) with docker image
# build-images - build both amd64,arm64 lavad(s) and docker image(s)
# build-image-amd64 - docker build (output: `build/lavad-linux-amd64`) with docker image
# build-image-arm64 - docker build (output: `build/lavad-linux-arm64`) with docker image
#
# test - run unit-tests
# lint - run the linter
# test - run unit-tests
# lint - run the linter
#
# Options:
# (comma separated list of options to turn on specific features)
#
# static - build static binary
# release - generate release build
# nostrip - do not strip binary from paths
# static - build static binary
# release - generate release build
# nostrip - do not strip binary from paths
#
# debug_mutex - (debug) enable debug mutex
# mask_consumer_logs - (debug) enable debug mutex
# debug_mutex - (debug) enable debug mutex
# mask_consumer_logs - (debug) enable debug mutex
#
# cleveldb, rocksdb - (not to be used)
#
# Environment
# LAVA_VERSION=... - select lava version (for 'release')
# BUILDDIR=... - select local directory for build output
# LEDGER_ENABLED - (not to be used)
# LAVA_VERSION=... - select lava version (for 'release')
# BUILDDIR=... - select local directory for build output
# LEDGER_ENABLED - (not to be used)
#
# Examples:
#
Expand Down
8 changes: 6 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

**Run Lava Node**

1. Review the settings in `docker/env`. The default settings are usually
suitable for all deployments.
1. Review the settings in `docker/env` (sections "common setup" and "common
runtime"). The default settings are usually suitable for all deployments.

2. Use the following the commands to create/start/stop/destroy the node:
```
Expand All @@ -53,6 +53,9 @@ suitable for all deployments.

**Run Lava Portal / Provider**

This section is outdated and is temporarily removed.

<!--
1. Create a lava user and fund it.
```
export LAVA_HOME='.lava'
Expand Down Expand Up @@ -91,3 +94,4 @@ for the 'portal' / 'provider' role.
# to destroy the portal/provider:
docker-compose --profile portal --env-file env -f docker-compose.yml down
```
-->
138 changes: 70 additions & 68 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,72 +28,74 @@ services:
restart: on-failure:5
profiles: ["node"]

lava-portal:
build: ..
image: lava:latest
command: "portal"
volumes:
- *vol-lava
environment:
# common env
- LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0}
- LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info}
# portal env
- LAVA_USER
- LAVA_KEYRING
- LAVA_ADDRESS
- LAVA_STAKE_AMOUNT
- LAVA_GAS_MODE
- LAVA_GAS_ADJUST
- LAVA_GAS_PRICE
- LAVA_GEOLOCATION
- LAVA_RPC_NODE
- LAVA_CHAIN_ID
- LAVA_RELAY_CHAIN_ID
- LAVA_RELAY_IFACE
- LAVA_PORTAL_PORT
ports:
- '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_PORTAL_PORT:-8080}:${LAVA_PORTAL_PORT:-8080}'
deploy:
resources:
limits:
cpus: '2'
memory: '2gb'
restart: on-failure:5
profiles: ["portal"]
# --- OUTDATED ---
# lava-portal:
# build: ..
# image: lava:latest
# command: "portal"
# volumes:
# - *vol-lava
# environment:
# # common env
# - LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0}
# - LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info}
# # portal env
# - LAVA_USER
# - LAVA_KEYRING
# - LAVA_ADDRESS
# - LAVA_STAKE_AMOUNT
# - LAVA_GAS_MODE
# - LAVA_GAS_ADJUST
# - LAVA_GAS_PRICE
# - LAVA_GEOLOCATION
# - LAVA_RPC_NODE
# - LAVA_CHAIN_ID
# - LAVA_RELAY_CHAIN_ID
# - LAVA_RELAY_IFACE
# - LAVA_PORTAL_PORT
# ports:
# - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_PORTAL_PORT:-8080}:${LAVA_PORTAL_PORT:-8080}'
# deploy:
# resources:
# limits:
# cpus: '2'
# memory: '2gb'
# restart: on-failure:5
# profiles: ["portal"]

lava-provider:
build: ..
image: lava:latest
command: "provider"
volumes:
- *vol-lava
environment:
# common env
- LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0}
- LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info}
# portal env
- LAVA_USER
- LAVA_KEYRING
- LAVA_ADDRESS
- LAVA_STAKE_AMOUNT
- LAVA_GAS_MODE
- LAVA_GAS_ADJUST
- LAVA_GAS_PRICE
- LAVA_GEOLOCATION
- LAVA_RPC_NODE
- LAVA_CHAIN_ID
- LAVA_RELAY_ENDPOINT
- LAVA_RELAY_NODE_URL
- LAVA_RELAY_CHAIN_ID
- LAVA_RELAY_IFACE
- LAVA_PORTAL_PORT
ports:
- '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_PORTAL_PORT:-8080}:${LAVA_PORTAL_PORT:-8080}'
deploy:
resources:
limits:
cpus: '2'
memory: '4gb'
restart: on-failure:5
profiles: ["provider"]
# --- OUTDATED ---
# lava-provider:
# build: ..
# image: lava:latest
# command: "provider"
# volumes:
# - *vol-lava
# environment:
# # common env
# - LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0}
# - LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info}
# # portal env
# - LAVA_USER
# - LAVA_KEYRING
# - LAVA_ADDRESS
# - LAVA_STAKE_AMOUNT
# - LAVA_GAS_MODE
# - LAVA_GAS_ADJUST
# - LAVA_GAS_PRICE
# - LAVA_GEOLOCATION
# - LAVA_RPC_NODE
# - LAVA_CHAIN_ID
# - LAVA_RELAY_ENDPOINT
# - LAVA_RELAY_NODE_URL
# - LAVA_RELAY_CHAIN_ID
# - LAVA_RELAY_IFACE
# - LAVA_PORTAL_PORT
# ports:
# - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_PORTAL_PORT:-8080}:${LAVA_PORTAL_PORT:-8080}'
# deploy:
# resources:
# limits:
# cpus: '2'
# memory: '4gb'
# restart: on-failure:5
# profiles: ["provider"]
Loading

0 comments on commit c887567

Please sign in to comment.