elastic / elastic/elastic-package

Stack state is persisted across restarts

Open
#507 7 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
72
Forks
141
Avg merge
19h 42m
Merged PRs (30d)
55

Description

I'm using `elastic-package stack up -v` to boot the stack for testing purposes.

While working with integrations I noticed that the integration I've been working on was already installed across stack restarts.

My workflow is running (in shell A):
```
integrations $ elastic-package stack up -v
```
Then develop in shell B running:
```
integrations/package/gcp $ elastic-package build
integrations/package/gcp $ elastic-package stack up --services package-registry -d
```

To restart the stack I'm terminating the `up` process in shell a with `CTRL-c` the starting it again.

Once I install the `gcp` package though, it's reported as installed across restarts. This suggest the cluster state is being persisted.

This behaviour is at best counter intuitive, and I've not been able to understand which docker feature is producing it. The services do not have a volume attached for persistence, but running `elastic-package stack down` destroy the state, so the hypothesis is that it happens because volumes are destroyed by that command; see https://github.com/elastic/elastic-package/blob/9b5a0fa512e3de83f47545ae1b879d1f21720a2a/internal/stack/compose.go#L100-L104

By not using `-d` this behaviour is more visible because to stop containers is enough to `CTRL-c` the `up` process.
When using `-d` the easiest way to stop the stack is `elastic-package stack down`; using this workflow this behaviour is not observed.

OS: `elementary OS 5.1.7 Hera` (based on `Ubuntu 18.04.4 LTS)`
docker version:
```
Client: Docker Engine - Community
Version: 20.10.8
API version: 1.41
Go version: go1.16.6
Git commit: 3967b7d
Built: Fri Jul 30 19:54:08 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.8
API version: 1.41 (minimum version 1.12)
Go version: go1.16.6
Git commit: 75249d8
Built: Fri Jul 30 19:52:16 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.9
GitCommit: e25210fe30a0a703442421b0f60afac609f950a3
runc:
Version: 1.0.1
GitCommit: v1.0.1-0-g4144b63
docker-init:
Version: 0.19.0
GitCommit: de40ad0
```
docker-compose version:
```
docker-compose version 1.28.6, build unknown
docker-py version: 4.4.4
CPython version: 3.8.9
OpenSSL version: OpenSSL 1.1.1k 25 Mar 2021
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.