Skip to content
Snippets Groups Projects
Commit 2585211c authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-897: Reduce docker context by copying files through Make

parent 73bc311f
Branches
Tags
1 merge request!400L2SS-897: Reduce docker context by copying files through Make
Showing
with 47 additions and 38 deletions
...@@ -28,3 +28,4 @@ tangostationcontrol/docs/build ...@@ -28,3 +28,4 @@ tangostationcontrol/docs/build
**/.eggs **/.eggs
docker-compose/alerta-web/alerta-secrets.json docker-compose/alerta-web/alerta-secrets.json
docker-compose/tmp
...@@ -31,8 +31,11 @@ if [[ $TANGOSTATIONCONTROL ]]; then ...@@ -31,8 +31,11 @@ if [[ $TANGOSTATIONCONTROL ]]; then
exit 2 exit 2
else else
# Install the package, exit 1 if it fails # Install the package, exit 1 if it fails
cd tangostationcontrol || exit 1 # pip install ./ will _NOT_ install dependencies in requirements.txt!
pip install --upgrade --force-reinstall ./ rm -rf /tmp/tangostationcontrol
cp -R /opt/lofar/tango/tangostationcontrol /tmp/
cd /tmp/tangostationcontrol || exit 1
pip -vvv install --upgrade --force-reinstall ./
fi fi
# Return to the stored the directory, this preserves the working_dir argument in # Return to the stored the directory, this preserves the working_dir argument in
......
...@@ -153,7 +153,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ ...@@ -153,7 +153,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
DOCKER_GID=$(DOCKER_GID) DOCKER_GID=$(DOCKER_GID)
.PHONY: up down minimal run integration start stop restart build build-nocache status clean pull help .PHONY: up down minimal context run integration start stop restart build build-nocache status clean pull help
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
pull: ## pull the images from the Docker hub pull: ## pull the images from the Docker hub
...@@ -183,13 +183,18 @@ ifneq ($(NETWORK_MODE),host) ...@@ -183,13 +183,18 @@ ifneq ($(NETWORK_MODE),host)
docker network inspect 9000-$(NETWORK_MODE) &> /dev/null && ([ $$? -eq 0 ] && docker network rm 9000-$(NETWORK_MODE)) || true docker network inspect 9000-$(NETWORK_MODE) &> /dev/null && ([ $$? -eq 0 ] && docker network rm 9000-$(NETWORK_MODE)) || true
endif endif
minimal: ## start the base TANGO system minimal: context ## start the base TANGO system
ifneq ($(NETWORK_MODE),host) ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create $(NETWORK_MODE)) docker network inspect $(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create $(NETWORK_MODE))
docker network inspect 9000-$(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create 9000-$(NETWORK_MODE) -o com.docker.network.driver.mtu=9000) docker network inspect 9000-$(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create 9000-$(NETWORK_MODE) -o com.docker.network.driver.mtu=9000)
endif endif
$(DOCKER_COMPOSE_ARGS) docker-compose -f tango.yml -f networks.yml up --no-recreate -d $(DOCKER_COMPOSE_ARGS) docker-compose -f tango.yml -f networks.yml up --no-recreate -d
context: ## Move the necessary files to create minimal docker context
@mkdir -p tmp
@cp ../tangostationcontrol/requirements.txt tmp/
bootstrap: pull build # first start, initialise from scratch bootstrap: pull build # first start, initialise from scratch
$(MAKE) start elk-configure-host # configure host kernel for elk container $(MAKE) start elk-configure-host # configure host kernel for elk container
$(MAKE) start dsconfig # boot up containers to load configurations $(MAKE) start dsconfig # boot up containers to load configurations
......
...@@ -19,8 +19,8 @@ services: ...@@ -19,8 +19,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-antennafield container_name: ${CONTAINER_NAME_PREFIX}device-antennafield
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-apsct container_name: ${CONTAINER_NAME_PREFIX}device-apsct
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-apspu container_name: ${CONTAINER_NAME_PREFIX}device-apspu
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-beamlet container_name: ${CONTAINER_NAME_PREFIX}device-beamlet
......
...@@ -17,8 +17,8 @@ services: ...@@ -17,8 +17,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-boot container_name: ${CONTAINER_NAME_PREFIX}device-boot
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-bst container_name: ${CONTAINER_NAME_PREFIX}device-bst
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-digitalbeam container_name: ${CONTAINER_NAME_PREFIX}device-digitalbeam
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-docker container_name: ${CONTAINER_NAME_PREFIX}device-docker
......
...@@ -17,8 +17,8 @@ services: ...@@ -17,8 +17,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-observation-control container_name: ${CONTAINER_NAME_PREFIX}device-observation-control
......
...@@ -16,8 +16,8 @@ services: ...@@ -16,8 +16,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-observation container_name: ${CONTAINER_NAME_PREFIX}device-observation
......
...@@ -13,8 +13,8 @@ services: ...@@ -13,8 +13,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-pcon container_name: ${CONTAINER_NAME_PREFIX}device-pcon
......
...@@ -13,8 +13,8 @@ services: ...@@ -13,8 +13,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-psoc container_name: ${CONTAINER_NAME_PREFIX}device-psoc
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-recv container_name: ${CONTAINER_NAME_PREFIX}device-recv
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-sdp container_name: ${CONTAINER_NAME_PREFIX}device-sdp
......
...@@ -18,8 +18,8 @@ services: ...@@ -18,8 +18,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-sst container_name: ${CONTAINER_NAME_PREFIX}device-sst
......
...@@ -13,8 +13,8 @@ services: ...@@ -13,8 +13,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-temperature-manager container_name: ${CONTAINER_NAME_PREFIX}device-temperature-manager
......
...@@ -13,8 +13,8 @@ services: ...@@ -13,8 +13,8 @@ services:
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
context: .. context: .
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-tilebeam container_name: ${CONTAINER_NAME_PREFIX}device-tilebeam
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment