Skip to content

Commit

Permalink
use volume for orderly root + git config
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Aug 8, 2024
1 parent fe662f7 commit 99a382a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ ENV REDIS_CONTAINER_NAME=orderly.runner_redis

COPY docker/bin /usr/local/bin/

RUN git config --global --add safe.directory /orderly-root
RUN echo ".packit" > /.gitignore
RUN git config --global core.excludesFile "/.gitignore"

# ENTRYPOINT for server is /usr/local/bin/orderly.runner.server
# ENTRYPOINT for worker is /usr/local/bin/orderly.runner.worker
17 changes: 15 additions & 2 deletions docker/test/clear-docker
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/usr/bin/env bash
set -x

docker kill orderly.runner_redis orderly.runner_server orderly.runner_worker
docker network rm orderly.runner_network
docker kill \
orderly.runner_redis \
orderly.runner_server \
orderly.runner_worker \
orderly.runner_debug

docker rm \
orderly.runner_redis \
orderly.runner_server \
orderly.runner_worker \
orderly.runner_debug

docker network rm orderly.runner_network

docker volume rm orderly-root-volume
16 changes: 12 additions & 4 deletions docker/test/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ set -ex
HERE=$(dirname $0)
ABSOLUTE_PATH=$(realpath $HERE)

$HERE/setup-test-repo

docker network create orderly.runner_network

docker run --rm -d \
Expand All @@ -13,19 +11,29 @@ docker run --rm -d \
-p 127.0.0.1:6379:6379 \
redis

docker volume create orderly-root-volume

docker run --rm -d --pull=missing \
--name=orderly.runner_debug \
-v orderly-root-volume:/orderly-root \
ubuntu \
sleep infinity

docker cp $ABSOLUTE_PATH/test-repo/. orderly.runner_view_root:/orderly-root

docker run --rm -d --pull=always \
--net=orderly.runner_network \
--name=orderly.runner_server \
--entrypoint="/usr/local/bin/orderly.runner.server" \
-p 127.0.0.1:8001:8001 \
-v $ABSOLUTE_PATH/test-repo:/orderly-root \
-v orderly-root-volume:/orderly-root \
ghcr.io/mrc-ide/orderly.runner:mrc-5146-container-gh-actions \
/orderly-root

docker run --rm -d --pull=always \
--net=orderly.runner_network \
--name=orderly.runner_worker \
--entrypoint="/usr/local/bin/orderly.runner.worker" \
-v $ABSOLUTE_PATH/test-repo:/orderly-root \
-v orderly-root-volume:/orderly-root \
ghcr.io/mrc-ide/orderly.runner:mrc-5146-container-gh-actions \
/orderly-root

0 comments on commit 99a382a

Please sign in to comment.