statically allocate app container IPs

We removed httpPort with the assumption that docker allocated IPs
and kept them as long as the container is around. This turned out
to be not true because the IP changes on even container restart.

So we now allocate IPs statically. The iprange makes sure we don't
overlap with addons and other CI app or JupyterHub apps.

https://github.com/moby/moby/issues/6743
https://github.com/moby/moby/pull/19001
This commit is contained in:
Girish Ramakrishnan
2020-11-20 14:13:16 -08:00
parent 64af278f39
commit c0b0029935
13 changed files with 165 additions and 59 deletions

View File

@@ -85,6 +85,7 @@ CREATE TABLE IF NOT EXISTS apps(
taskId INTEGER, // current task
errorJson TEXT,
servicesConfigJson TEXT, // app services configuration
containerIp VARCHAR(16) UNIQUE, // this is not-null because of ip allocation fails, user can 'repair'
FOREIGN KEY(mailboxDomain) REFERENCES domains(domain),
FOREIGN KEY(taskId) REFERENCES tasks(id),