Commit 52a9e3ec authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

remove the factories

Fix #185

- webapps are now located directly at the root of the registry
  (not in the /webapp subdir)

- factories are no longer stored in our registry, we directly reference
  images on the official docker registry
parent b0807974
......@@ -56,36 +56,6 @@ EOF
# generate the factories
# this function is run after the rails container is initialised because the
# list of factories is read from the database
# build the factories
for name in `echo 'select concat(name, ":", version) as img from docker_os order by img;' | docker exec -i dev-mysql mysql -uroot allgo | grep -v '^img$'`
if docker inspect --type image -- "$name" >/dev/null 2>/dev/null
echo "$name: already pulled"
(set -x
docker tag -- "$name" "$tag"
docker push -- "$tag"
docker rmi -- "$name" || true
echo "$name:"
(set -x
docker pull -- "$name"
docker tag -- "$name" "$tag"
docker push -- "$tag"
docker rmi -- "$name"
# remove container and its data
......@@ -196,11 +166,6 @@ do
init_container "$name"
# build the factories (if the rail container was initialised)
if [ -z "$NOBUILD" ] && echo "$TODO" | grep -q dev-rails ; then
# display running containers
......@@ -1561,7 +1561,7 @@ class DockerController:
return "%s-sandbox-%s" % (self.env, webapp.docker_name)
def gen_image_name(self, webapp):
return "%s/webapp/%s" % (self.registry, webapp.docker_name)
return "%s/%s" % (self.registry, webapp.docker_name)
def gen_job_name(self, job):
return "%s-job-%s-%d-%s" % (self.env,,, job.webapp.docker_name)
......@@ -1571,7 +1571,17 @@ class DockerController:
str(job.webapp_id), job.access_token)
def gen_factory_name(self, docker_os):
return "%s/factory/%s" % (self.registry, docker_os.docker_name)
# NOTE: factory names now refer to an image from the official docker
# registry. To enforce this (and avoid a user using an allgo image as
# the docker_os), we explicitely prepend "" in the
# repository name. Once the registry authentication is clarified and
# correctly secured we will be able to remove this restriction and
# allow using any docker images).
repo = docker_os.docker_name
if "/" not in repo:
repo = "library/" + repo
return ""+ repo
def inspect_job_container(self, client, job):
"""inspect the underlying container of a job + safety checks
......@@ -80,7 +80,7 @@ services:
- "/:/vol/host:ro"
ENV: "dev"
REGISTRY: "localhost:5000/allgo/dev"
REGISTRY: "localhost:5000"
DEBUG: "1"
networks: [dev]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment