Skip to content

Commit

Permalink
feat: change for three worker
Browse files Browse the repository at this point in the history
  • Loading branch information
leejiwon1125 committed Nov 27, 2023
1 parent ae9ec83 commit 8dd3d3c
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 1,541 deletions.
24 changes: 20 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,30 @@ services:
dockerfile: docker/master/Dockerfile
args:
- NUMBER_OF_WORKERS=2
worker:
worker1:
build:
context: .
dockerfile: docker/worker/Dockerfile
dockerfile: docker/worker1/Dockerfile
args:
- MASTER_HOST=master
- MASTER_PORT=50051
deploy:
replicas: 2
depends_on:
- master
worker2:
build:
context: .
dockerfile: docker/worker2/Dockerfile
args:
- MASTER_HOST=master
- MASTER_PORT=50051
depends_on:
- master
worker3:
build:
context: .
dockerfile: docker/worker3/Dockerfile
args:
- MASTER_HOST=master
- MASTER_PORT=50051
depends_on:
- master
256 changes: 0 additions & 256 deletions docker/worker/data/0/0

This file was deleted.

256 changes: 0 additions & 256 deletions docker/worker/data/0/1

This file was deleted.

256 changes: 0 additions & 256 deletions docker/worker/data/1/2

This file was deleted.

256 changes: 0 additions & 256 deletions docker/worker/data/1/3

This file was deleted.

256 changes: 0 additions & 256 deletions docker/worker/data/2/4

This file was deleted.

256 changes: 0 additions & 256 deletions docker/worker/data/2/5

This file was deleted.

2 changes: 1 addition & 1 deletion docker/worker/Dockerfile → docker/worker1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ COPY . .

RUN sbt --batch compile

ENTRYPOINT sbt --batch -v "worker/run ${MASTER_HOST}:${MASTER_PORT} -I /data/0 /data/1 /data/2 -O /output/"
ENTRYPOINT sbt --batch -v "worker/run ${MASTER_HOST}:${MASTER_PORT} -I /data/input1 /data/input2 -O /output/"
35 changes: 35 additions & 0 deletions docker/worker2/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-20.0.2_9_1.9.6_2.13.12

ARG MASTER_HOST
ARG MASTER_PORT

ENV MASTER_HOST=${MASTER_HOST}
ENV MASTER_PORT=${MASTER_PORT}

ENV SBT_OPTS="-Xmx2G -Xss2M"

RUN mkdir -p /app /data /output

COPY docker/worker/data /data

WORKDIR /app

COPY build.sbt log4j2.properties ./
COPY core/build.sbt ./core/
COPY master/build.sbt ./master/
COPY rpc/build.sbt ./rpc/
COPY utils/build.sbt ./utils/
COPY worker/build.sbt ./worker/
COPY project/build.properties project/plugins.sbt project/scalapb.sbt ./project/

RUN sbt --batch compile

COPY rpc/src/main/protobuf ./rpc/src/main/protobuf

RUN sbt --batch compile

COPY . .

RUN sbt --batch compile

ENTRYPOINT sbt --batch -v "worker/run ${MASTER_HOST}:${MASTER_PORT} -I /data/input1 /data/input2 -O /output/"
35 changes: 35 additions & 0 deletions docker/worker3/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-20.0.2_9_1.9.6_2.13.12

ARG MASTER_HOST
ARG MASTER_PORT

ENV MASTER_HOST=${MASTER_HOST}
ENV MASTER_PORT=${MASTER_PORT}

ENV SBT_OPTS="-Xmx2G -Xss2M"

RUN mkdir -p /app /data /output

COPY docker/worker/data /data

WORKDIR /app

COPY build.sbt log4j2.properties ./
COPY core/build.sbt ./core/
COPY master/build.sbt ./master/
COPY rpc/build.sbt ./rpc/
COPY utils/build.sbt ./utils/
COPY worker/build.sbt ./worker/
COPY project/build.properties project/plugins.sbt project/scalapb.sbt ./project/

RUN sbt --batch compile

COPY rpc/src/main/protobuf ./rpc/src/main/protobuf

RUN sbt --batch compile

COPY . .

RUN sbt --batch compile

ENTRYPOINT sbt --batch -v "worker/run ${MASTER_HOST}:${MASTER_PORT} -I /data/input1 /data/input2 -O /output/"

0 comments on commit 8dd3d3c

Please sign in to comment.