diff --git a/Dockerfile b/Dockerfile index d6063cb5..83f168b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ COPY . /cloud-game/ WORKDIR /cloud-game # Install server dependencies -RUN go install ./cmd +RUN go install ./cmd/overlord +RUN go install ./cmd/overworker EXPOSE 8000 diff --git a/Makefile b/Makefile index f4ea715c..495ab0a1 100644 --- a/Makefile +++ b/Makefile @@ -77,19 +77,12 @@ dev.run: dev.build-local -#dev.run: dev.build -# # Run coordinator first -# ./build/klog -overlordhost overlord & -# # Wait till overlord finish initialized -# # Run a worker connecting to overload -# ./build/klog -overlordhost ws://localhost:8000/wso - -#dev.run.docker: -# docker build . -t cloud-game-local -# docker stop cloud-game-local -# docker rm cloud-game-local -# # Overlord and worker should be run separately. Local is for demo purpose -# docker run --privileged -v $PWD/games:/cloud-game/games -d --name cloud-game-local -p 8000:8000 -p 9000:9000 cloud-game-local bash -c "cmd -overlordhost ws://localhost:8000/wso & cmd -overlordhost overlord" +dev.run-docker: + docker build . -t cloud-game-local + docker stop cloud-game-local + docker rm cloud-game-local + # Overlord and worker should be run separately. + docker run --privileged -v $PWD/games:/cloud-game/games -d --name cloud-game-local -p 8000:8000 -p 9000:9000 cloud-game-local bash -c "overlord --v=5 & overworker --overlordhost ws://localhost:8000/wso" #build: # go build -o build/cloudretro ./cmd diff --git a/README.md b/README.md index 5830135c..6ba8af06 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Screenshot | Screenshot ## Run on local by Docker -You try running the server yourself by running `make run-docker`. It will spawn a docker environment and you can access the service on `localhost:8000`. +You try running the server yourself by running `make dev.run-docker`. It will spawn a docker environment and you can access the service on `localhost:8000`. ## Development environment @@ -49,7 +49,7 @@ brew install libvpx pkg-config opus opusfile Because coordinator and workers needs to run simulateneously. Workers connects to coordinator. 1. Script - * `make run` + * `make dev.run` * The scripts spawns 2 processes one in background and one in foreground 2. Manual * Need to run coordinator and worker separately in two session