Skip to content

Commit

Permalink
Add Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
segeljakt committed Jan 27, 2023
1 parent 7bd087e commit 850397c
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/target
**/build
!build
21 changes: 21 additions & 0 deletions docker/Dockerfile.coordinator
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ubuntu:22.04

# Install system dependencies
RUN apt update
RUN apt upgrade
RUN apt install -y curl build-essential

# Install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:$PATH"
# RUN cargo install cross

WORKDIR /workspace
COPY arc-sys/ arc-sys/
# COPY arc-mlir/ arc-mlir/
# COPY build build
# RUN ./build
WORKDIR /workspace/arc-sys
RUN cargo build --package coordinator

CMD ./target/debug/coordinator
17 changes: 17 additions & 0 deletions docker/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:22.04

# Install system dependencies
RUN apt update
RUN apt upgrade
RUN apt install -y curl build-essential

# Install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:$PATH"

WORKDIR /workspace
COPY arc-sys/ arc-sys/
WORKDIR /workspace/arc-sys
RUN cargo build --package worker

CMD ./target/debug/worker --coordinator coordinator:8001
57 changes: 57 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Run using:
# $ docker swarm init
# $ docker stack deploy arc-stack --compose-file docker-compose.yaml
# $ docker service scale arc-stack_worker=N
# Stop with
# $ docker stack rm arc-stack
#
# or:
#
# $ docker compose build
# $ docker compose up
# $ docker service scale worker=N
# Stop with
# $ docker compose down
version: "3.0"
services:
# -----------------------------------------------------------------------------
worker:
image: segeljakt/arc-worker
build:
context: ../
dockerfile: docker/Dockerfile.worker
deploy:
replicas: 0
# -----------------------------------------------------------------------------
coordinator:
image: segeljakt/arc-coordinator
build:
context: ../
dockerfile: docker/Dockerfile.coordinator
ports:
- 8000:8000
hostname: coordinator
# # -----------------------------------------------------------------------------
# zookeeper:
# image: confluentinc/cp-zookeeper:7.3.0
# container_name: zookeeper
# environment:
# ZOOKEEPER_CLIENT_PORT: 2181
# ZOOKEEPER_TICK_TIME: 2000
# # -----------------------------------------------------------------------------
# broker:
# image: confluentinc/cp-kafka:7.3.0
# container_name: broker
# ports:
# - "9092:9092"
# depends_on:
# - zookeeper
# environment:
# KAFKA_BROKER_ID: 1
# KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
# KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
# KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
# KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
# KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
# # -----------------------------------------------------------------------------

0 comments on commit 850397c

Please sign in to comment.