Skip to content

Commit

Permalink
Refactor DTS dockerfile and startup script to be used to run DAQ in a… (
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag6 authored Nov 17, 2021
1 parent 5f63bc1 commit 4432a4f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 12 deletions.
17 changes: 17 additions & 0 deletions bin/build_daq_container
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e

image_name="daq"

if [ "$1" == "dts" ]; then
image_name="dts"
shift
fi

bin/setup_remote faucet
bin/setup_remote forch

echo Starting $image_name build...

docker build . -f docker/modules/Dockerfile.daq --build-arg GIT_URL -t daqf/$image_name

echo Done with $image_name build.
25 changes: 25 additions & 0 deletions bin/start_daq_container
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -e

ROOT=$(realpath $(dirname $0)/..)
CONTAINER=daq_box
INSTDIR=$ROOT/inst
IMAGE=daqf/daq

docker_envs="\
--env BASE_CONFIG=/root/config/system/dts.yaml"

docker_volumes+="\
-v $INSTDIR:/root/inst"

grpc_port=50051

if [ -n "$prom_pt" ]; then
port_opts="-p $prom_pt:$PROM_TARGET"
echo $prom_pt > $INSTDIR/PROM_PORT.$PROM_TARGET
fi

cid=$(docker run -d --privileged --name $CONTAINER \
$docker_volumes $docker_envs \
-p $grpc_port:$grpc_port $IMAGE)

echo Container $CONTAINER started as $cid
5 changes: 4 additions & 1 deletion dts/start_service → docker/include/bin/start_daq
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ FORCH_ROOT=$ROOT/forch
VXLAN_IP=1.2.3.4
source $DAQ_ROOT/etc/FILES_MAPPING

BASE_CONFIG=/daq-config/dts-cluster.yaml
if [ -z "$BASE_CONFIG" ]; then
BASE_CONFIG=/daq-config/dts-cluster.yaml
fi
echo Base config used: $BASE_CONFIG
DYNAMIC_CONFIG=startup.conf

ls -ld /var/log/faucet
Expand Down
6 changes: 3 additions & 3 deletions dts/Dockerfile.dts → docker/modules/Dockerfile.daq
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Image name: daqf/dts
## Image name: daqf/daq

FROM ubuntu:focal

Expand Down Expand Up @@ -35,7 +35,7 @@ COPY daq/ daq/
COPY cmd/ cmd/
COPY config/ config/
COPY resources/ resources/
COPY dts/start_service bin/
COPY docker/include/bin/start_daq bin/
COPY subset/ subset/

CMD ["bin/start_service"]
CMD ["bin/start_daq"]
9 changes: 1 addition & 8 deletions dts/build_dts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#!/bin/bash -e

bin/setup_remote faucet
bin/setup_remote forch

echo Starting docker build...

docker build . -f dts/Dockerfile.dts --build-arg GIT_URL -t daqf/dts

echo Done with dts build.
bin/build_daq_container dts

0 comments on commit 4432a4f

Please sign in to comment.