Open ebeahan opened 1 year ago
One workaround is to create a long running service alongside the existing short running one.
$ cat _dev/deploy/docker/docker-compose.yml
version: '2.3'
services:
trendmicro-log-filestream:
image: alpine
volumes:
- ./sample_logs:/sample_logs:ro
- ${SERVICE_LOGS_DIR}:/var/log
command: /bin/sh -c "cp /sample_logs/* /var/log/"
trendmicro-log-udp:
image: docker.elastic.co/observability/stream:v0.8.0
volumes:
- ./sample_logs:/sample_logs:ro
command: log --start-signal=SIGHUP --delay=5s --addr elastic-agent:9514 -p=udp /sample_logs/*.log
May be related - https://github.com/docker/for-win/issues/13242
I have modified docker-compose to get this issue worked around even with single service
version: '2.3'
services:
trendmicro-log-filestream:
image: alpine
volumes:
- ./sample_logs:/sample_logs:ro
- ${SERVICE_LOGS_DIR}:/var/log
command: /bin/sh -c "cp /sample_logs/* /var/log/ && tail -F anything"
tail -F anything
is added to keep the container alive after executing the logs copy.
Summary
System tests fail unexpected for packages using the
docker-compose
service deployer if the container's lifetime is short, such as mounting a volume forfilestream
inputs.Packages experiencing this failure include
trendmicro
andmysql_enterprise
.Example
Using
trendmicro
package which deploys a single, short-lived container to mount a volume for system testing: https://github.com/elastic/integrations/blob/main/packages/trendmicro/_dev/deploy/docker/docker-compose.yml.Note missing value for container ID in
DEBUG Wait for healthy containers
andDEBUG output command: /usr/local/bin/docker inspect
Working comparison
Here's a working comparison ran within the
panw
package. Note, however, with four containers started by the Docker service deployer, only three report in thedocker inspect
. The longer livedudp
,tcp
, andtls
services prevent thedocker inspect
command from failing and testing continues.