Skip to content

Commit

Permalink
[installer] update containers links and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonygego committed Jan 19, 2024
1 parent 9e7dffa commit 30937e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/admin_doc/install_doc/create_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,6 @@ To restrict container availability to *NVIDIA* (recommended), add the following
Share what you created
----------------------

If you created a Dockerfile for INGInious, feel free to make a pull request in the repository associated: https://github.com/UCL-INGI/INGInious-containers
If you created a Dockerfile for INGInious, feel free to make a pull request in the repository associated: https://github.com/INGInious/containers

.. _Docker: https://www.docker.com/
22 changes: 11 additions & 11 deletions inginious/frontend/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def select_containers_to_build(self):
docker_connection = docker.from_env()
for image in docker_connection.images.list():
for tag in image.attrs["RepoTags"]:
if re.match(r"^ingi/inginious-c-(base|default):v" + __version__, tag):
if re.match(r"^ghcr.io/inginious/env-(base|default):v" + __version__, tag):
stock_images.append(tag)
except:
self._display_info(FAIL + "Cannot connect to Docker!" + ENDC)
Expand All @@ -431,9 +431,9 @@ def select_containers_to_build(self):
dev = False
self._display_info("Downloading containers for version:" + containers_version)
self._retrieve_and_extract_tarball(tarball_url, tmpdirname)
self._build_container("ingi/inginious-c-base",
self._build_container("ghcr.io/inginious/env-base",
os.path.join(tmpdirname, "base-containers", "base"))
self._build_container("ingi/inginious-c-default",
self._build_container("ghcr.io/inginious/env-default",
os.path.join(tmpdirname, "base-containers", "default"))
if dev:
self._display_info("If you modified files in base-containers folder, don't forget to rebuild manually to make these changes effective !")
Expand All @@ -442,10 +442,10 @@ def select_containers_to_build(self):
with tempfile.TemporaryDirectory() as tmpdirname:
self._display_info("Downloading the other containers source directory...")
self._retrieve_and_extract_tarball(
"https://api.github.com/repos/UCL-INGI/INGInious-containers/tarball", tmpdirname)
"https://api.github.com/repos/INGInious/containers/tarball", tmpdirname)
# As the add_container function recursively calls itself before adding the entry,
# the wanted build order.
todo = ["ingi/inginious-c-base", "ingi/inginious-c-default"]
todo = ["ghcr.io/inginious/env-base", "ghcr.io/inginious/env-default"]
available_containers = set(os.listdir(os.path.join(tmpdirname, 'grading')))
self._display_info("Done.")

Expand All @@ -454,15 +454,15 @@ def __add_container(container):
Add container to the dict of container to build.
:param: container : The prefixed name of the container.
"""
if not container.startswith("ingi/inginious-c-"):
container = "ingi/inginious-c-" + container
if not container.startswith("ghcr.io/inginious/env-"):
container = "ghcr.io/inginious/env-" + container

if container in todo:
return
# getting name of supercontainer to see if need to build
line_from = \
[l for l in
open(os.path.join(tmpdirname, 'grading', container[17:], 'Dockerfile')).read().split("\n")
open(os.path.join(tmpdirname, 'grading', container[22:], 'Dockerfile')).read().split("\n")
if
l.startswith("FROM")][0]
supercontainer = line_from.strip()[4:].strip().split(":")[0]
Expand All @@ -487,12 +487,12 @@ def __add_container(container):
self._display_info("Ok, I'll build container {}".format(answer))
__add_container(answer)

todo.remove("ingi/inginious-c-base")
todo.remove("ingi/inginious-c-default")
todo.remove("ghcr.io/inginious/env-base")
todo.remove("ghcr.io/inginious/env-default")
for container in todo:
try:
self._build_container(container,
os.path.join(tmpdirname, 'grading', container[17:]))
os.path.join(tmpdirname, 'grading', container[22:]))
except BuildError:
self._display_error(
"An error occured while building the container. Please retry manually.")
Expand Down

0 comments on commit 30937e9

Please sign in to comment.