From 30937e9cf5ae8607df7a9cba39396de19e9dff73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anthony=20G=C3=A9go?= Date: Fri, 19 Jan 2024 16:33:18 +0100 Subject: [PATCH] [installer] update containers links and tags --- .../install_doc/create_container.rst | 2 +- inginious/frontend/installer.py | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/admin_doc/install_doc/create_container.rst b/doc/admin_doc/install_doc/create_container.rst index ae0f6bc9b..7c0e796bf 100644 --- a/doc/admin_doc/install_doc/create_container.rst +++ b/doc/admin_doc/install_doc/create_container.rst @@ -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/ diff --git a/inginious/frontend/installer.py b/inginious/frontend/installer.py index 9b516fd43..e08bad756 100644 --- a/inginious/frontend/installer.py +++ b/inginious/frontend/installer.py @@ -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) @@ -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 !") @@ -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.") @@ -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] @@ -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.")