Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Conversation

@bboreham
Copy link
Contributor

@bboreham bboreham commented Apr 6, 2016

Instead of persisting inside the weave container, use another data-only container weavedb.

Fixes #2031 and fixes #2077.

We cannot use the same data-only container as we use for weavewait, as it needs to change when Weave is upgraded. I did choose to use the same image (i.e. weaveworks/weaveexec); nothing from the image is used so this should be unimportant.

We have to move the location of the DB file(s) to a specific directory so we can mount a volume on top of that directory. This has the effect of making docker run weave fail unless you supply such a volume, or a different --db-prefix.

@bboreham bboreham added this to the 1.5.0 milestone Apr 6, 2016
@bboreham bboreham changed the title Use a data volume container for Weave persistence of IPAM etc. Use a data volume container for persistence of IPAM etc. Apr 6, 2016
@awh awh self-assigned this Apr 8, 2016
@awh
Copy link
Contributor

awh commented Apr 11, 2016

Looks good - I wonder whether we should create a minimal image to serve as the base for this volume container though? Otherwise we'll be keeping an old version (currently ~70mb) of the weavexec image lying around. A minimal image is only 28 bytes:

vagrant@vagrant-ubuntu-wily-64:~/minvol$ cat Dockerfile 
FROM scratch
ADD . /weavedb
vagrant@vagrant-ubuntu-wily-64:~/minvol$ docker build -t foo/bar .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM scratch
 ---> 
Step 2 : ADD . /weavedb
 ---> Using cache
 ---> 7367c98030d5
Successfully built 7367c98030d5
vagrant@vagrant-ubuntu-wily-64:~/minvol$ docker images foo/bar
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
foo/bar             latest              7367c98030d5        9 minutes ago       28 B

@awh awh removed their assignment Apr 11, 2016
@awh
Copy link
Contributor

awh commented Apr 11, 2016

Do we need to put anything in the docs for this now? I'm going to mention it when talking about persistence in the operational guide, does it need to go anywhere else? (make sure you rebase on recent master if you do because I restructured all the docs for wordepress)

@bboreham
Copy link
Contributor Author

That's a good point about the old image. I was following the Docker page on volumes where they note that using the same image doesn't cost any disk space because the layers are shared with the containers we do use, but that won't be true after an upgrade.

@brb
Copy link
Contributor

brb commented Apr 11, 2016

Might be irrelevant, but when we do weave reset, do we want to get rid of the data container?

@awh
Copy link
Contributor

awh commented Apr 11, 2016

Might be irrelevant, but when we do weave reset, do we want to get rid of the data container?

Already implemented!

@bboreham bboreham self-assigned this Apr 11, 2016
@bboreham
Copy link
Contributor Author

I added a minimal image as suggested. Don't think you wanted to do ADD . /weavedb

Docs: I'll wait and see what you put in the operational guide.

@bboreham bboreham removed their assignment Apr 12, 2016
mflag.StringVar(&datapathName, []string{"-datapath"}, "", "ODP datapath name")
mflag.StringVar(&trustedSubnetStr, []string{"-trusted-subnets"}, "", "comma-separated list of trusted subnets in CIDR notation")
mflag.StringVar(&dbPrefix, []string{"-db-prefix"}, "weave", "pathname/prefix of filename to store data")
mflag.StringVar(&dbPrefix, []string{"-db-prefix"}, "/weavedb/weave", "pathname/prefix of filename to store data")

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@brb
Copy link
Contributor

brb commented Apr 13, 2016

LGTM, just maybe commits can be squashed.

@bboreham bboreham force-pushed the issues/2031-persistence-volume branch from 6cee179 to 484789c Compare April 13, 2016 12:36
@bboreham
Copy link
Contributor Author

Rebased/squashed. The two commits cover separate concerns.

@bboreham bboreham self-assigned this Apr 13, 2016
@awh
Copy link
Contributor

awh commented Apr 13, 2016

@bboreham and I just had a discussion about how peers specified to weave launch will always be ignored after the first launch now we have decoupled the persistence - proposals to fix are

  • Use the union of CLI peers and what is persisted
  • Support a --replace argument to weave launch

@rade thoughts?

@rade
Copy link
Member

rade commented Apr 13, 2016

I'd like "weave launch x y z" be equivalent to "weave launch; weave connect x; weave connect y; weave connect z" as much as possible.

So I think we want the union.

We already have a "connect --replace" iirc, so adding a "launch --replace" seems logical.

@bboreham bboreham removed their assignment Apr 13, 2016
We provide a very small image to use for this container.
Also we add an empty weavedata.db file to weave image so it doesn't crash when run without volume override
@bboreham bboreham force-pushed the issues/2031-persistence-volume branch from 8493df4 to 0eee97b Compare April 13, 2016 15:11
@bboreham
Copy link
Contributor Author

See #2160 for union and --replace

@awh awh merged commit 31ca8f9 into master Apr 14, 2016
@awh awh deleted the issues/2031-persistence-volume branch April 14, 2016 12:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain persisted information across upgrades IPAM persistence data should not be lost on change of target peer list

5 participants