Add logging for slave container builds (#10628)

#### Why I did it

No logs currently exist for sonic-save-X containers which makes it difficult to debug.

#### How I did it

Altered Makefile.work to create logs in the sonic-slave-X folder while still displaying the log to the screen to prevent interfering with any existing tooling. 

#### How to verify it

Do `make configure` and verify that logs show up in `sonic-slave-buster/` and `sonic-slave-bullseye/`

#### Description for the changelog
Add logging for slave container builds

#### A picture of a cute animal (not mandatory but encouraged)
TBD
This commit is contained in:
Alexander Allen 2022-05-31 12:59:52 -04:00 committed by GitHub
parent c9b27cde71
commit b4bc051267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

3
.gitignore vendored
View File

@ -22,6 +22,9 @@ target/
*.img *.img
*.pyc *.pyc
# Slave docker log files
sonic-slave*/*.log
# Autogenerated Dockerfiles # Autogenerated Dockerfiles
sonic-slave*/Dockerfile sonic-slave*/Dockerfile
sonic-slave*/Dockerfile.user sonic-slave*/Dockerfile.user

View File

@ -294,12 +294,18 @@ endif
endif endif
SPLIT_LOG = | tee
DOCKER_BASE_LOG = $(SLAVE_DIR)/$(SLAVE_BASE_IMAGE)_$(SLAVE_BASE_TAG).log
DOCKER_LOG = $(SLAVE_DIR)/$(SLAVE_IMAGE)_$(SLAVE_TAG).log
DOCKER_BASE_BUILD = docker build --no-cache \ DOCKER_BASE_BUILD = docker build --no-cache \
-t $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) \ -t $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) \
--build-arg http_proxy=$(http_proxy) \ --build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \ --build-arg https_proxy=$(https_proxy) \
--build-arg no_proxy=$(no_proxy) \ --build-arg no_proxy=$(no_proxy) \
$(SLAVE_DIR) $(SLAVE_DIR) $(SPLIT_LOG) $(DOCKER_BASE_LOG)
DOCKER_BASE_PULL = docker pull \ DOCKER_BASE_PULL = docker pull \
$(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) $(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
@ -312,7 +318,7 @@ DOCKER_BUILD = docker build --no-cache \
--build-arg slave_base_tag_ref=$(SLAVE_BASE_TAG) \ --build-arg slave_base_tag_ref=$(SLAVE_BASE_TAG) \
-t $(SLAVE_IMAGE):$(SLAVE_TAG) \ -t $(SLAVE_IMAGE):$(SLAVE_TAG) \
-f $(SLAVE_DIR)/Dockerfile.user \ -f $(SLAVE_DIR)/Dockerfile.user \
$(SLAVE_DIR) $(SLAVE_DIR) $(SPLIT_LOG) $(DOCKER_LOG)
SONIC_BUILD_INSTRUCTION := make \ SONIC_BUILD_INSTRUCTION := make \
-f slave.mk \ -f slave.mk \