Skip to content

Commit 850397c

Browse files
committed
Add Docker images
1 parent 7bd087e commit 850397c

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/target
2+
**/build
3+
!build

docker/Dockerfile.coordinator

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ubuntu:22.04
2+
3+
# Install system dependencies
4+
RUN apt update
5+
RUN apt upgrade
6+
RUN apt install -y curl build-essential
7+
8+
# Install Rust
9+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
10+
ENV PATH="/root/.cargo/bin:$PATH"
11+
# RUN cargo install cross
12+
13+
WORKDIR /workspace
14+
COPY arc-sys/ arc-sys/
15+
# COPY arc-mlir/ arc-mlir/
16+
# COPY build build
17+
# RUN ./build
18+
WORKDIR /workspace/arc-sys
19+
RUN cargo build --package coordinator
20+
21+
CMD ./target/debug/coordinator

docker/Dockerfile.worker

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:22.04
2+
3+
# Install system dependencies
4+
RUN apt update
5+
RUN apt upgrade
6+
RUN apt install -y curl build-essential
7+
8+
# Install Rust
9+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
10+
ENV PATH="/root/.cargo/bin:$PATH"
11+
12+
WORKDIR /workspace
13+
COPY arc-sys/ arc-sys/
14+
WORKDIR /workspace/arc-sys
15+
RUN cargo build --package worker
16+
17+
CMD ./target/debug/worker --coordinator coordinator:8001

docker/docker-compose.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Run using:
2+
# $ docker swarm init
3+
# $ docker stack deploy arc-stack --compose-file docker-compose.yaml
4+
# $ docker service scale arc-stack_worker=N
5+
# Stop with
6+
# $ docker stack rm arc-stack
7+
#
8+
# or:
9+
#
10+
# $ docker compose build
11+
# $ docker compose up
12+
# $ docker service scale worker=N
13+
# Stop with
14+
# $ docker compose down
15+
version: "3.0"
16+
services:
17+
# -----------------------------------------------------------------------------
18+
worker:
19+
image: segeljakt/arc-worker
20+
build:
21+
context: ../
22+
dockerfile: docker/Dockerfile.worker
23+
deploy:
24+
replicas: 0
25+
# -----------------------------------------------------------------------------
26+
coordinator:
27+
image: segeljakt/arc-coordinator
28+
build:
29+
context: ../
30+
dockerfile: docker/Dockerfile.coordinator
31+
ports:
32+
- 8000:8000
33+
hostname: coordinator
34+
# # -----------------------------------------------------------------------------
35+
# zookeeper:
36+
# image: confluentinc/cp-zookeeper:7.3.0
37+
# container_name: zookeeper
38+
# environment:
39+
# ZOOKEEPER_CLIENT_PORT: 2181
40+
# ZOOKEEPER_TICK_TIME: 2000
41+
# # -----------------------------------------------------------------------------
42+
# broker:
43+
# image: confluentinc/cp-kafka:7.3.0
44+
# container_name: broker
45+
# ports:
46+
# - "9092:9092"
47+
# depends_on:
48+
# - zookeeper
49+
# environment:
50+
# KAFKA_BROKER_ID: 1
51+
# KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
52+
# KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
53+
# KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
54+
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
55+
# KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
56+
# KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
57+
# # -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)