Skip to content

Commit

Permalink
build: docker releases and compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
walkah committed Jul 9, 2024
1 parent 2500d68 commit f69b4e5
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 5 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ jobs:
docker:
name: Push Docker image
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: ghcr.io/Lilypad-Tech/bacalhau
dockerfile: ./docker/bacalhau/Dockerfile
- image: ghcr.io/Lilypad-Tech/job-creator
dockerfile: ./docker/job-creator/Dockerfile
- image: ghcr.io/Lilypad-Tech/resource-provider
dockerfile: ./docker/resource-provider/Dockerfile
- image: ghcr.io/Lilypad-Tech/solver
dockerfile: ./docker/solver/Dockerfile
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,12 +35,12 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/Lilypad-Tech/resource-provider
images: ${{ matrix.image}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/resource-provider/Dockerfile
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ ops/testnet/.terraform/providers
.run/
bin/
vendor/
./data/
/data/
.DS_Store
11 changes: 11 additions & 0 deletions docker/bacalhau/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM docker:dind as base

RUN apk update
RUN apk add wget
RUN apk add bash

ADD https://github.com/bacalhau-project/bacalhau/releases/download/v1.3.2/bacalhau_v1.3.2_linux_amd64.tar.gz .
RUN tar xfv bacalhau_v1.3.2_linux_amd64.tar.gz
RUN mv bacalhau /usr/local/bin

ENTRYPOINT [ "bacalhau" ]
79 changes: 79 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: lilypad
services:
chain:
image: offchainlabs/nitro-node:v2.3.4-b4cc111
container_name: chain
ports:
- 8547:8547
- 8548:8548
command:
[
"--init.dev-init",
"--init.dev-init-address",
$ADMIN_ADDRESS,
"--node.dangerous.no-l1-listener",
"--node.parent-chain-reader.enable=false",
"--parent-chain.id=1337",
"--chain.id=412346",
"--node.sequencer",
"--execution.sequencer.enable",
"--node.dangerous.no-sequencer-coordinator",
"--node.staker.enable=false",
"--init.empty=false",
"--http.port",
"8547",
"--http.addr",
"0.0.0.0",
"--ws.port",
"8548",
"--ws.addr",
"0.0.0.0",
]
volumes:
- ../data/chain:/home/user/.arbitrum
solver:
image: ghcr.io/lilypad-tech/solver
container_name: solver
depends_on:
- chain
build:
context: ..
dockerfile: ./docker/solver/Dockerfile
args:
- network=dev
extra_hosts:
- "localhost:host-gateway"
environment:
- DOPPLER_TOKEN=${DOPPLER_TOKEN_SOLVER}
ports:
- 8080:8080
job-creator:
image: ghcr.io/lilypad-tech/job-creator
container_name: job-creator
depends_on:
- solver
build:
context: ..
dockerfile: ./docker/job-creator/Dockerfile
args:
- network=dev
extra_hosts:
- "localhost:host-gateway"
environment:
- DOPPLER_TOKEN=${DOPPLER_TOKEN_JOB_CREATOR}
resource-provider:
image: ghcr.io/lilypad-tech/resource-provider
container_name: resource-provider
privileged: true
depends_on:
- chain
build:
context: ..
dockerfile: ./docker/resource-provider/Dockerfile
args:
- NETWORK=dev
extra_hosts:
- "localhost:host-gateway"
environment:
# - DOPPLER_TOKEN=${DOPPLER_TOKEN_RESOURCE_PROVIDER}
- WEB3_PRIVATE_KEY=0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a
2 changes: 1 addition & 1 deletion docker/job-creator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:latest as base
FROM golang:latest AS base
WORKDIR /usr/src/app

ARG network=dev
Expand Down
2 changes: 1 addition & 1 deletion docker/solver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG expose_via=local

FROM golang:latest as base
FROM golang:latest AS base
WORKDIR /usr/src/app

ARG arch=amd64
Expand Down
19 changes: 19 additions & 0 deletions stack
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OS_ARCH=$(uname -m | awk '{if ($0 ~ /arm64|aarch64/) print "arm64"; else if ($0 ~ /x86_64|amd64/) print "amd64"; else print "unsupported_arch"}')

############################################################################
# docker compose
############################################################################
function compose-init() {
chain-clean
rm -Rf ./data/chain
ADMIN_ADDRESS=${@:-"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"} \
docker compose -f ./docker/docker-compose.dev.yml up chain -d
chain-boot
}

function compose-up() {
ADMIN_ADDRESS=${@:-"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"} \
DOPPLER_TOKEN_SOLVER="$(doppler configs tokens create -p solver -c dev docker --max-age 1m --plain)" \
DOPPLER_TOKEN_JOB_CREATOR="$(doppler configs tokens create -p job-creator -c dev docker --max-age 1m --plain)" \
DOPPLER_TOKEN_RESOURCE_PROVIDER="$(doppler configs tokens create -p resource-provider -c dev docker --max-age 1m --plain)" \
docker compose -f ./docker/docker-compose.dev.yml up "$@"
}

############################################################################
# chain
############################################################################
Expand Down

0 comments on commit f69b4e5

Please sign in to comment.