From 9ef1fd6cbf31fc74907b1dd71bb66b15b517d09c Mon Sep 17 00:00:00 2001 From: nrybowski Date: Thu, 20 Oct 2022 22:35:05 +0200 Subject: [PATCH 01/18] Add backend service --- backend.containerfile | 13 +++++++++++++ backend.setup | 13 +++++++++++++ docker-compose.yml | 11 +++++++++++ 3 files changed, 37 insertions(+) create mode 100644 backend.containerfile create mode 100644 backend.setup create mode 100644 docker-compose.yml diff --git a/backend.containerfile b/backend.containerfile new file mode 100644 index 0000000000..25beec23b0 --- /dev/null +++ b/backend.containerfile @@ -0,0 +1,13 @@ +FROM ubuntu:22.04 + +RUN apt-get update && apt-get -y install python3 python3-pip + +WORKDIR /inginious +COPY inginious/common/ inginious/common/ +COPY inginious/backend/ inginious/backend/ +COPY inginious-backend . + +COPY backend.setup setup.py +RUN pip3 install . + +CMD ["sh", "-c", "python3 inginious-backend ${AGENT} ${CLIENT}"] diff --git a/backend.setup b/backend.setup new file mode 100644 index 0000000000..d9fe299ab0 --- /dev/null +++ b/backend.setup @@ -0,0 +1,13 @@ +from setuptools import setup, find_packages + +install_requires = [ + "pyzmq>=15.3.0", + "msgpack >= 1.0.0", +] + +setup( + name="INGInious", + packages=find_packages(), + install_requires=install_requires, + include_package_data=True, +) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..d691b1a67d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + inginious-backend: + image: inginious-backend + build: + dockerfile: backend.containerfile + environment: + AGENT: "tcp://127.0.0.1:2001" + CLIENT: "tcp://127.0.0.1:2000" + expose: + - 2000 + - 2001 From 1f2c2a49509ab8c5b256d09a8c9723680926de94 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Thu, 20 Oct 2022 23:16:09 +0200 Subject: [PATCH 02/18] Add agent-docker service --- agent-docker.containerfile | 15 +++++++++++++++ agent-docker.setup | 17 +++++++++++++++++ docker-compose.yml | 36 ++++++++++++++++++++++++++---------- 3 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 agent-docker.containerfile create mode 100644 agent-docker.setup diff --git a/agent-docker.containerfile b/agent-docker.containerfile new file mode 100644 index 0000000000..075bfe94b0 --- /dev/null +++ b/agent-docker.containerfile @@ -0,0 +1,15 @@ +FROM ubuntu:22.04 + +RUN apt-get update && apt-get -y install python3 python3-pip + +WORKDIR /inginious +COPY inginious/common/ inginious/common/ +COPY inginious/agent/__init__.py inginious/agent/ +COPY inginious/agent/docker_agent/ inginious/agent/docker_agent/ +COPY inginious-agent-docker . + +COPY agent-docker.setup setup.py +RUN pip3 install . + + +CMD ["sh", "-c", "python3 inginious-agent-docker ${BACKEND}"] diff --git a/agent-docker.setup b/agent-docker.setup new file mode 100644 index 0000000000..0bbebf41f8 --- /dev/null +++ b/agent-docker.setup @@ -0,0 +1,17 @@ +from setuptools import setup, find_packages + +install_requires = [ + "pyzmq>=15.3.0", + "msgpack >= 1.0.0", + "docker>=2.5.0", + "zipstream >= 1.1.4", + "psutil >= 4.4.2", + "PyYAML>=3.11", +] + +setup( + name="INGInious", + packages=find_packages(), + install_requires=install_requires, + include_package_data=True, +) diff --git a/docker-compose.yml b/docker-compose.yml index d691b1a67d..ae613a1766 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,27 @@ services: - inginious-backend: - image: inginious-backend - build: - dockerfile: backend.containerfile - environment: - AGENT: "tcp://127.0.0.1:2001" - CLIENT: "tcp://127.0.0.1:2000" - expose: - - 2000 - - 2001 + + inginious-backend: + image: inginious-backend + build: + dockerfile: backend.containerfile + environment: + AGENT: "tcp://0.0.0.0:2001" + CLIENT: "tcp://0.0.0.0:2000" + networks: + - inginious + + inginious-agent-docker: + image: inginious-agent-docker + deploy: + replicas: 1 + build: + dockerfile: agent-docker.containerfile + environment: + BACKEND: "tcp://inginious-backend:2001" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + networks: + - inginious + +networks: + inginious: From 860978818b152f97d37b6fa5c7595f3350ef7a0c Mon Sep 17 00:00:00 2001 From: nrybowski Date: Thu, 20 Oct 2022 23:27:12 +0200 Subject: [PATCH 03/18] Add agent-mcq service --- agent-mcq.containerfile | 15 +++++++++++++++ agent-mcq.setup | 16 ++++++++++++++++ docker-compose.yml | 11 +++++++++++ 3 files changed, 42 insertions(+) create mode 100644 agent-mcq.containerfile create mode 100644 agent-mcq.setup diff --git a/agent-mcq.containerfile b/agent-mcq.containerfile new file mode 100644 index 0000000000..d1ddcddb0f --- /dev/null +++ b/agent-mcq.containerfile @@ -0,0 +1,15 @@ +FROM ubuntu:22.04 + +RUN apt-get update && apt-get -y install python3 python3-pip + +WORKDIR /inginious +COPY inginious/common/ inginious/common/ +COPY inginious/__init__.py inginious/ +COPY inginious/agent/__init__.py inginious/agent/ +COPY inginious/agent/mcq_agent/ inginious/agent/mcq_agent/ +COPY inginious-agent-mcq . + +COPY agent-mcq.setup setup.py +RUN pip3 install . + +CMD ["sh", "-c", "python3 inginious-agent-mcq ${BACKEND}"] diff --git a/agent-mcq.setup b/agent-mcq.setup new file mode 100644 index 0000000000..417e23dad8 --- /dev/null +++ b/agent-mcq.setup @@ -0,0 +1,16 @@ +from setuptools import setup, find_packages + +install_requires = [ + "pyzmq>=15.3.0", + "msgpack >= 1.0.0", + "docker>=2.5.0", + "zipstream >= 1.1.4", + "PyYAML>=3.11", +] + +setup( + name="INGInious", + packages=find_packages(), + install_requires=install_requires, + include_package_data=True, +) diff --git a/docker-compose.yml b/docker-compose.yml index ae613a1766..aa4c54f3df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,5 +23,16 @@ services: networks: - inginious + inginious-agent-mcq: + image: inginious-agent-mcq + deploy: + replicas: 1 + build: + dockerfile: agent-mcq.containerfile + environment: + BACKEND: "tcp://inginious-backend:2001" + networks: + - inginious + networks: inginious: From 963a2aee1075e05ddd927c4bbfa42cc246cee189 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Thu, 20 Oct 2022 23:54:01 +0200 Subject: [PATCH 04/18] Add mongo-db container --- docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index aa4c54f3df..9d7e9abded 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,10 @@ services: + inginious-db: + image: mongo:6.0.2 + networks: + - inginious + inginious-backend: image: inginious-backend build: @@ -12,6 +17,8 @@ services: inginious-agent-docker: image: inginious-agent-docker + depends_on: + - inginious-backend deploy: replicas: 1 build: @@ -25,6 +32,8 @@ services: inginious-agent-mcq: image: inginious-agent-mcq + depends_on: + - inginious-backend deploy: replicas: 1 build: From 2bffa3683a337bfa67041951ef42d6c9f2f5adb7 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Sat, 22 Oct 2022 00:00:47 +0200 Subject: [PATCH 05/18] Layered services images --- backend.containerfile | 13 ------------- .../agent-docker.containerfile | 9 ++------- agent-docker.setup => deploy/agent-docker.setup | 0 .../agent-mcq.containerfile | 9 ++------- agent-mcq.setup => deploy/agent-mcq.setup | 0 deploy/backend.containerfile | 9 +++++++++ backend.setup => deploy/backend.setup | 0 deploy/inginious-base.containerfile | 7 +++++++ docker-compose.yml | 12 ++++++------ 9 files changed, 26 insertions(+), 33 deletions(-) delete mode 100644 backend.containerfile rename agent-docker.containerfile => deploy/agent-docker.containerfile (56%) rename agent-docker.setup => deploy/agent-docker.setup (100%) rename agent-mcq.containerfile => deploy/agent-mcq.containerfile (51%) rename agent-mcq.setup => deploy/agent-mcq.setup (100%) create mode 100644 deploy/backend.containerfile rename backend.setup => deploy/backend.setup (100%) create mode 100644 deploy/inginious-base.containerfile diff --git a/backend.containerfile b/backend.containerfile deleted file mode 100644 index 25beec23b0..0000000000 --- a/backend.containerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ubuntu:22.04 - -RUN apt-get update && apt-get -y install python3 python3-pip - -WORKDIR /inginious -COPY inginious/common/ inginious/common/ -COPY inginious/backend/ inginious/backend/ -COPY inginious-backend . - -COPY backend.setup setup.py -RUN pip3 install . - -CMD ["sh", "-c", "python3 inginious-backend ${AGENT} ${CLIENT}"] diff --git a/agent-docker.containerfile b/deploy/agent-docker.containerfile similarity index 56% rename from agent-docker.containerfile rename to deploy/agent-docker.containerfile index 075bfe94b0..2ed9685834 100644 --- a/agent-docker.containerfile +++ b/deploy/agent-docker.containerfile @@ -1,15 +1,10 @@ -FROM ubuntu:22.04 +FROM inginious/inginious-base -RUN apt-get update && apt-get -y install python3 python3-pip - -WORKDIR /inginious -COPY inginious/common/ inginious/common/ COPY inginious/agent/__init__.py inginious/agent/ COPY inginious/agent/docker_agent/ inginious/agent/docker_agent/ COPY inginious-agent-docker . -COPY agent-docker.setup setup.py +COPY deploy/agent-docker.setup setup.py RUN pip3 install . - CMD ["sh", "-c", "python3 inginious-agent-docker ${BACKEND}"] diff --git a/agent-docker.setup b/deploy/agent-docker.setup similarity index 100% rename from agent-docker.setup rename to deploy/agent-docker.setup diff --git a/agent-mcq.containerfile b/deploy/agent-mcq.containerfile similarity index 51% rename from agent-mcq.containerfile rename to deploy/agent-mcq.containerfile index d1ddcddb0f..d36b15cd9a 100644 --- a/agent-mcq.containerfile +++ b/deploy/agent-mcq.containerfile @@ -1,15 +1,10 @@ -FROM ubuntu:22.04 +FROM inginious/inginious-base -RUN apt-get update && apt-get -y install python3 python3-pip - -WORKDIR /inginious -COPY inginious/common/ inginious/common/ -COPY inginious/__init__.py inginious/ COPY inginious/agent/__init__.py inginious/agent/ COPY inginious/agent/mcq_agent/ inginious/agent/mcq_agent/ COPY inginious-agent-mcq . -COPY agent-mcq.setup setup.py +COPY deploy/agent-mcq.setup setup.py RUN pip3 install . CMD ["sh", "-c", "python3 inginious-agent-mcq ${BACKEND}"] diff --git a/agent-mcq.setup b/deploy/agent-mcq.setup similarity index 100% rename from agent-mcq.setup rename to deploy/agent-mcq.setup diff --git a/deploy/backend.containerfile b/deploy/backend.containerfile new file mode 100644 index 0000000000..ce5f8d07c5 --- /dev/null +++ b/deploy/backend.containerfile @@ -0,0 +1,9 @@ +FROM inginious/inginious-base + +COPY inginious/backend/ inginious/backend/ +COPY inginious-backend . + +COPY deploy/backend.setup setup.py +RUN pip3 install . + +CMD ["sh", "-c", "python3 inginious-backend ${AGENT} ${CLIENT}"] diff --git a/backend.setup b/deploy/backend.setup similarity index 100% rename from backend.setup rename to deploy/backend.setup diff --git a/deploy/inginious-base.containerfile b/deploy/inginious-base.containerfile new file mode 100644 index 0000000000..49ef94348d --- /dev/null +++ b/deploy/inginious-base.containerfile @@ -0,0 +1,7 @@ +FROM ubuntu:22.04 + +RUN apt-get update && apt-get -y install python3 python3-pip + +WORKDIR /inginious +COPY inginious/common/ inginious/common/ +COPY inginious/__init__.py inginious/ diff --git a/docker-compose.yml b/docker-compose.yml index 9d7e9abded..1f047f155c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,9 +6,9 @@ services: - inginious inginious-backend: - image: inginious-backend + image: inginious/inginious-backend build: - dockerfile: backend.containerfile + dockerfile: deploy/backend.containerfile environment: AGENT: "tcp://0.0.0.0:2001" CLIENT: "tcp://0.0.0.0:2000" @@ -16,13 +16,13 @@ services: - inginious inginious-agent-docker: - image: inginious-agent-docker + image: inginious/inginious-agent-docker depends_on: - inginious-backend deploy: replicas: 1 build: - dockerfile: agent-docker.containerfile + dockerfile: deploy/agent-docker.containerfile environment: BACKEND: "tcp://inginious-backend:2001" volumes: @@ -31,13 +31,13 @@ services: - inginious inginious-agent-mcq: - image: inginious-agent-mcq + image: inginious/inginious-agent-mcq depends_on: - inginious-backend deploy: replicas: 1 build: - dockerfile: agent-mcq.containerfile + dockerfile: deploy/agent-mcq.containerfile environment: BACKEND: "tcp://inginious-backend:2001" networks: From a133a85b7619e9d7940426322c040eb1fc83314c Mon Sep 17 00:00:00 2001 From: nrybowski Date: Sat, 22 Oct 2022 17:08:26 +0200 Subject: [PATCH 06/18] Add frontend service --- configuration.deploy.yaml | 16 ++++++++++ deploy/agent-docker.containerfile | 2 +- deploy/frontend.containerfile | 12 ++++++++ deploy/frontend.setup | 50 +++++++++++++++++++++++++++++++ docker-compose.yml | 32 +++++++++++++++++++- inginious/frontend/arch_helper.py | 7 +++-- 6 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 configuration.deploy.yaml create mode 100644 deploy/frontend.containerfile create mode 100644 deploy/frontend.setup diff --git a/configuration.deploy.yaml b/configuration.deploy.yaml new file mode 100644 index 0000000000..0860e696c4 --- /dev/null +++ b/configuration.deploy.yaml @@ -0,0 +1,16 @@ +backend: tcp://inginious-backend:2000 +backup_directory: /inginious/backups +local-config: {} +mongo_opt: + database: INGInious + host: inginious-db +plugins: [] +session_parameters: + ignore_change_ip: false + secret_key: 96f4628a2e4d0ce26b6352713f8ac8359b838f4800f1972790622899664bd0f4 + secure: false + timeout: 86400 +superadmins: +- superadmin +tasks_directory: /inginious/tasks +use_minified_js: true diff --git a/deploy/agent-docker.containerfile b/deploy/agent-docker.containerfile index 2ed9685834..f9834904b3 100644 --- a/deploy/agent-docker.containerfile +++ b/deploy/agent-docker.containerfile @@ -7,4 +7,4 @@ COPY inginious-agent-docker . COPY deploy/agent-docker.setup setup.py RUN pip3 install . -CMD ["sh", "-c", "python3 inginious-agent-docker ${BACKEND}"] +CMD ["sh", "-c", "python3 inginious-agent-docker ${BACKEND} --tmpdir=/tmp/agent_data/"] diff --git a/deploy/frontend.containerfile b/deploy/frontend.containerfile new file mode 100644 index 0000000000..d1a8680159 --- /dev/null +++ b/deploy/frontend.containerfile @@ -0,0 +1,12 @@ +FROM inginious/inginious-base + +COPY inginious/frontend inginious/frontend/ +COPY inginious/client inginious/client/ +COPY inginious-webapp . + +COPY deploy/frontend.setup setup.py +RUN pip3 install . + +RUN apt-get install -y git + +CMD ["sh", "-c", "python3 inginious-webapp"] diff --git a/deploy/frontend.setup b/deploy/frontend.setup new file mode 100644 index 0000000000..95d5dae8bc --- /dev/null +++ b/deploy/frontend.setup @@ -0,0 +1,50 @@ +from setuptools import setup, find_packages + +install_requires = [ + "pyzmq>=15.3.0", + "msgpack >= 1.0.0", + "Werkzeug >= 1.0.0", + "PyYAML>=3.11", + "Flask >= 1.1.0", + "Flask-Mail >= 0.9.1", + "pymongo>=3.2.2", + "oauth2>=1.9.0.post1", + + #"docker>=2.5.0", + #"docutils>=0.14", + "pymongo>=3.2.2", + "PyYAML>=3.11", + "Jinja2 >= 2.10", + "lti>=0.9.0", + "oauth2>=1.9.0.post1", + "httplib2>=0.9", + "watchdog >= 0.8.3", + "msgpack >= 1.0.0", + "pyzmq >= 15.3.0", + "natsort >= 5.0.1", + "psutil >= 4.4.2", + "zipstream >= 1.1.4", + "WsgiDAV >= 3.0.0", + "Werkzeug >= 1.0.0", + "itsdangerous >= 1.1.0", + "Flask >= 1.1.0", + "Flask-Mail >= 0.9.1", + "importlib_metadata >= 3.7.0", + 'dataclasses >= 0.8; python_version < "3.7.0"', + "pytidylib>=0.2.4", + "sphinx-autodoc-typehints>=1.12.0", + "sh" +] + +setup( + name="INGInious", + packages=find_packages(), + install_requires=install_requires, + include_package_data=True, + extras_require={ + "cgi": ["flup>=1.0.3.dev"], + "ldap": ["ldap3"], + "saml2": ["python3-saml"], + "uwsgi": ["uwsgi"], + }, +) diff --git a/docker-compose.yml b/docker-compose.yml index 1f047f155c..4573e80930 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,12 @@ services: environment: BACKEND: "tcp://inginious-backend:2001" volumes: - - /var/run/docker.sock:/var/run/docker.sock + - /var/run/docker.sock:/var/run/docker.sock + # See https://github.com/UCL-INGI/INGInious/issues/352 + - ./tasks/:/inginious/tasks + - ./backups/:/inginious/backups + # See https://github.com/UCL-INGI/INGInious/issues/799 + - /tmp/agent_data/:/tmp/agent_data/ networks: - inginious @@ -40,6 +45,31 @@ services: dockerfile: deploy/agent-mcq.containerfile environment: BACKEND: "tcp://inginious-backend:2001" + volumes: + # See https://github.com/UCL-INGI/INGInious/issues/352 + - ./tasks/:/inginious/tasks + - ./backups/:/inginious/backups + # See https://github.com/UCL-INGI/INGInious/issues/799 + - /tmp/agent_data/:/tmp/agent_data/ + networks: + - inginious + + inginious-frontend: + image: inginious/inginious-frontend + build: + dockerfile: deploy/frontend.containerfile + depends_on: + - inginious-backend + - inginious-agent-docker + - inginious-agent-mcq + environment: + - INGINIOUS_WEBAPP_HOST=0.0.0.0 + volumes: + - ./configuration.deploy.yaml:/inginious/configuration.yaml + - ./tasks/:/inginious/tasks + - ./backups/:/inginious/backups + ports: + - 9000:8080 networks: - inginious diff --git a/inginious/frontend/arch_helper.py b/inginious/frontend/arch_helper.py index 6015fdf0ac..51d9b71973 100644 --- a/inginious/frontend/arch_helper.py +++ b/inginious/frontend/arch_helper.py @@ -10,9 +10,6 @@ from zmq.asyncio import ZMQEventLoop, Context -from inginious.agent.docker_agent import DockerAgent -from inginious.agent.mcq_agent import MCQAgent -from inginious.backend.backend import Backend from inginious.client.client import Client def start_asyncio_and_zmq(debug_asyncio=False): @@ -88,6 +85,10 @@ def create_arch(configuration, tasks_fs, context, course_factory): else: debug_ports = range(64100, 64111) + from inginious.agent.docker_agent import DockerAgent + from inginious.agent.mcq_agent import MCQAgent + from inginious.backend.backend import Backend + client = Client(context, "inproc://backend_client") backend = Backend(context, "inproc://backend_agent", "inproc://backend_client") agent_docker = DockerAgent(context, "inproc://backend_agent", "Docker - Local agent", concurrency, tasks_fs, debug_host, debug_ports, tmp_dir, ssh_allowed=True) From b28f93767e5159f7f6d67005ae3d55195c5dd9b0 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 11 Jan 2023 22:02:48 +0100 Subject: [PATCH 07/18] [deploy] From Ubuntu to Rocky8 --- deploy/agent-docker.containerfile | 2 ++ deploy/frontend.containerfile | 4 ++-- deploy/inginious-base.containerfile | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy/agent-docker.containerfile b/deploy/agent-docker.containerfile index f9834904b3..8dae4dcec4 100644 --- a/deploy/agent-docker.containerfile +++ b/deploy/agent-docker.containerfile @@ -4,6 +4,8 @@ COPY inginious/agent/__init__.py inginious/agent/ COPY inginious/agent/docker_agent/ inginious/agent/docker_agent/ COPY inginious-agent-docker . +RUN dnf install -y gcc python39-devel + COPY deploy/agent-docker.setup setup.py RUN pip3 install . diff --git a/deploy/frontend.containerfile b/deploy/frontend.containerfile index d1a8680159..72ca411df7 100644 --- a/deploy/frontend.containerfile +++ b/deploy/frontend.containerfile @@ -4,9 +4,9 @@ COPY inginious/frontend inginious/frontend/ COPY inginious/client inginious/client/ COPY inginious-webapp . +RUN dnf install -y git gcc python39-devel + COPY deploy/frontend.setup setup.py RUN pip3 install . -RUN apt-get install -y git - CMD ["sh", "-c", "python3 inginious-webapp"] diff --git a/deploy/inginious-base.containerfile b/deploy/inginious-base.containerfile index 49ef94348d..51c16d8679 100644 --- a/deploy/inginious-base.containerfile +++ b/deploy/inginious-base.containerfile @@ -1,6 +1,7 @@ -FROM ubuntu:22.04 +FROM rockylinux:8 -RUN apt-get update && apt-get -y install python3 python3-pip +RUN dnf update -y && dnf install -y python39 python39-pip +RUN pip3 install importlib-metadata WORKDIR /inginious COPY inginious/common/ inginious/common/ From 11d50241a2e0a72a25f1da6e77458a031dc588ce Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 11 Jan 2023 22:29:47 +0100 Subject: [PATCH 08/18] [deploy] Update README --- README.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.rst b/README.rst index 6580ea00a6..3ae2719597 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,17 @@ INGInious can be used as an external grader for EDX. The course `Paradigms of Co .. _Docker: https://www.docker.com/ .. _Paradigms of Computer Programming - Fundamentals: https://www.edx.org/course/louvainx/louvainx-louv1-1x-paradigms-computer-2751 +How to install? +--------------- + +Simply run: + +.. code-block:: + + $ docker-compose up --build + +And access http://localhost:9000 in your browser. + Documentation ------------- From a3b2d854a627789a63430ac68664367d04c7585b Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 11 Jan 2023 23:33:30 +0100 Subject: [PATCH 09/18] [deploy] Add initial MongoDB setup --- deploy/db_setup.py | 50 +++++++++++++++++++++++++++++++++++ deploy/frontend.containerfile | 4 ++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 deploy/db_setup.py diff --git a/deploy/db_setup.py b/deploy/db_setup.py new file mode 100644 index 0000000000..5884627e11 --- /dev/null +++ b/deploy/db_setup.py @@ -0,0 +1,50 @@ +from pymongo import MongoClient +from gridfs import GridFS + +from inginious.frontend.user_manager import UserManager + +def try_mongodb_opts(host="localhost", database_name='INGInious'): + """ Try MongoDB configuration """ + try: + mongo_client = MongoClient(host=host) + # Effective access only occurs when we call a method on the connexion + mongo_version = str(mongo_client.server_info()['version']) + print("Found mongodb server running version %s on %s." % (mongo_version, host)) + except Exception as e: + print("Cannot connect to MongoDB on host %s: %s" % (host, str(e))) + return None + + try: + database = mongo_client[database_name] + # Effective access only occurs when we call a method on the database. + database.list_collection_names() + except Exception as e: + print("Cannot access database %s: %s" % (database_name, str(e))) + return None + + try: + # Effective access only occurs when we call a method on the gridfs object. + GridFS(database).find_one() + except Exception as e: + print("Cannot access gridfs %s: %s" % (database_name, str(e))) + return None + + return database + +if __name__ == '__main__': + username = "superadmin" + realname = "INGInious superadmin" + email = "superadmin@inginious.org" + password = "superadmin" + + print('Initial DB setup.') + + database = try_mongodb_opts('inginious-db') + + database.users.insert_one({"username": username, + "realname": realname, + "email": email, + "password": UserManager.hash_password(password), + "bindings": {}, + "language": "en"}) + print('Superadmin user added!') diff --git a/deploy/frontend.containerfile b/deploy/frontend.containerfile index 72ca411df7..1b313bded5 100644 --- a/deploy/frontend.containerfile +++ b/deploy/frontend.containerfile @@ -9,4 +9,6 @@ RUN dnf install -y git gcc python39-devel COPY deploy/frontend.setup setup.py RUN pip3 install . -CMD ["sh", "-c", "python3 inginious-webapp"] +COPY deploy/db_setup.py /tmp/db_setup.py + +CMD ["sh", "-c", "python3 /tmp/db_setup.py; python3 inginious-webapp"] From 9b3c93d0cfafebfd195631fd0714b86277226cc0 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 11 Jan 2023 23:45:59 +0100 Subject: [PATCH 10/18] [deploy] Update INGInious stack doc --- README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 3ae2719597..10f40aa9a0 100644 --- a/README.rst +++ b/README.rst @@ -38,6 +38,23 @@ Simply run: And access http://localhost:9000 in your browser. +*The default user and login are "superadmin".* + +You can add new courses to your fresh INGInious instance by installing them in the "tasks" folder. + +For example, the INGInious tutorial course is installed with the following commands: + +.. code-block:: + + $ git clone https://github.com/UCL-INGI/INGInious-demo-tasks.git + $ mv INGInious-demo-tasks/tutorial tasks/ + +*If you encounter permission errors, you should run the following command:* + +.. code-block:: + + $ sudo chown -R : tasks + Documentation ------------- From 2d9e3fdff5291a9e43ad83e167d8bfc9a86a88cf Mon Sep 17 00:00:00 2001 From: nrybowski Date: Fri, 1 Sep 2023 23:59:18 +0200 Subject: [PATCH 11/18] [deploy] Rebase and update documentation --- README.rst | 14 ++++++++++++-- inginious/frontend/arch_helper.py | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 10f40aa9a0..3f10cd813f 100644 --- a/README.rst +++ b/README.rst @@ -38,9 +38,11 @@ Simply run: And access http://localhost:9000 in your browser. -*The default user and login are "superadmin".* +*The default login and password are "superadmin".* -You can add new courses to your fresh INGInious instance by installing them in the "tasks" folder. +Docker-compose will create a "tasks" folder if it does not exist already. + +You can then add new courses to your fresh INGInious instance by installing them in the "tasks" folder. For example, the INGInious tutorial course is installed with the following commands: @@ -55,6 +57,14 @@ For example, the INGInious tutorial course is installed with the following comma $ sudo chown -R : tasks +*This can happen when the tasks directory is created by docker-compose.* + +Note that the `configuration.deploy.yaml` file provided is a sample configuration, the secret key **must** be changed by administrators in production deployments. + +.. _Manual installation: https://docs.inginious.org/en/latest/admin_doc/install_doc/installation.html + +`Manual installation`_ is also possible with pip. + Documentation ------------- diff --git a/inginious/frontend/arch_helper.py b/inginious/frontend/arch_helper.py index 51d9b71973..295366d544 100644 --- a/inginious/frontend/arch_helper.py +++ b/inginious/frontend/arch_helper.py @@ -85,6 +85,9 @@ def create_arch(configuration, tasks_fs, context, course_factory): else: debug_ports = range(64100, 64111) + """ Those imports are required in pip-based installation but are not available in + docker-compose based ones. """ + from inginious.agent.docker_agent import DockerAgent from inginious.agent.mcq_agent import MCQAgent from inginious.backend.backend import Backend From 3295b97bb978ff02ee239f166e0bc64d87bfb393 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Sat, 2 Sep 2023 02:30:33 +0200 Subject: [PATCH 12/18] [deploy] Revert setup sub-division --- README.rst | 2 +- configuration.deploy.yaml | 4 +-- deploy/agent-docker.containerfile | 10 ++++-- deploy/agent-docker.setup | 17 ---------- deploy/agent-mcq.containerfile | 10 ++++-- deploy/agent-mcq.setup | 16 --------- deploy/backend.containerfile | 10 ++++-- deploy/backend.setup | 13 -------- deploy/db_setup.py | 2 +- deploy/frontend.containerfile | 10 ++++-- deploy/frontend.setup | 50 ----------------------------- deploy/inginious-base.containerfile | 9 +++++- docker-compose.yml | 44 ++++++++++++++++--------- setup.py | 28 ++++++++-------- 14 files changed, 82 insertions(+), 143 deletions(-) delete mode 100644 deploy/agent-docker.setup delete mode 100644 deploy/agent-mcq.setup delete mode 100644 deploy/backend.setup delete mode 100644 deploy/frontend.setup diff --git a/README.rst b/README.rst index 3f10cd813f..014bdee353 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,7 @@ Simply run: .. code-block:: - $ docker-compose up --build + $ REGISTRY=ghcr.io VERSION=latest docker-compose up --build And access http://localhost:9000 in your browser. diff --git a/configuration.deploy.yaml b/configuration.deploy.yaml index 0860e696c4..6907600061 100644 --- a/configuration.deploy.yaml +++ b/configuration.deploy.yaml @@ -1,9 +1,9 @@ -backend: tcp://inginious-backend:2000 +backend: tcp://backend:2000 backup_directory: /inginious/backups local-config: {} mongo_opt: database: INGInious - host: inginious-db + host: db plugins: [] session_parameters: ignore_change_ip: false diff --git a/deploy/agent-docker.containerfile b/deploy/agent-docker.containerfile index 8dae4dcec4..abe1a78de3 100644 --- a/deploy/agent-docker.containerfile +++ b/deploy/agent-docker.containerfile @@ -1,4 +1,7 @@ -FROM inginious/inginious-base +ARG VERSION=latest +ARG REGISTRY + +FROM ${REGISTRY}/inginious/core-base:${VERSION} COPY inginious/agent/__init__.py inginious/agent/ COPY inginious/agent/docker_agent/ inginious/agent/docker_agent/ @@ -6,7 +9,8 @@ COPY inginious-agent-docker . RUN dnf install -y gcc python39-devel -COPY deploy/agent-docker.setup setup.py -RUN pip3 install . +# See https://github.com/pypa/setuptools_scm/#usage-from-docker +RUN --mount=source=.git,target=.git,type=bind \ + pip3 install --no-cache-dir -e . CMD ["sh", "-c", "python3 inginious-agent-docker ${BACKEND} --tmpdir=/tmp/agent_data/"] diff --git a/deploy/agent-docker.setup b/deploy/agent-docker.setup deleted file mode 100644 index 0bbebf41f8..0000000000 --- a/deploy/agent-docker.setup +++ /dev/null @@ -1,17 +0,0 @@ -from setuptools import setup, find_packages - -install_requires = [ - "pyzmq>=15.3.0", - "msgpack >= 1.0.0", - "docker>=2.5.0", - "zipstream >= 1.1.4", - "psutil >= 4.4.2", - "PyYAML>=3.11", -] - -setup( - name="INGInious", - packages=find_packages(), - install_requires=install_requires, - include_package_data=True, -) diff --git a/deploy/agent-mcq.containerfile b/deploy/agent-mcq.containerfile index d36b15cd9a..292e3de85b 100644 --- a/deploy/agent-mcq.containerfile +++ b/deploy/agent-mcq.containerfile @@ -1,10 +1,14 @@ -FROM inginious/inginious-base +ARG VERSION=latest +ARG REGISTRY + +FROM ${REGISTRY}/inginious/core-base:${VERSION} COPY inginious/agent/__init__.py inginious/agent/ COPY inginious/agent/mcq_agent/ inginious/agent/mcq_agent/ COPY inginious-agent-mcq . -COPY deploy/agent-mcq.setup setup.py -RUN pip3 install . +# See https://github.com/pypa/setuptools_scm/#usage-from-docker +RUN --mount=source=.git,target=.git,type=bind \ + pip3 install --no-cache-dir -e . CMD ["sh", "-c", "python3 inginious-agent-mcq ${BACKEND}"] diff --git a/deploy/agent-mcq.setup b/deploy/agent-mcq.setup deleted file mode 100644 index 417e23dad8..0000000000 --- a/deploy/agent-mcq.setup +++ /dev/null @@ -1,16 +0,0 @@ -from setuptools import setup, find_packages - -install_requires = [ - "pyzmq>=15.3.0", - "msgpack >= 1.0.0", - "docker>=2.5.0", - "zipstream >= 1.1.4", - "PyYAML>=3.11", -] - -setup( - name="INGInious", - packages=find_packages(), - install_requires=install_requires, - include_package_data=True, -) diff --git a/deploy/backend.containerfile b/deploy/backend.containerfile index ce5f8d07c5..0d15fa9f5f 100644 --- a/deploy/backend.containerfile +++ b/deploy/backend.containerfile @@ -1,9 +1,13 @@ -FROM inginious/inginious-base +ARG VERSION=latest +ARG REGISTRY + +FROM ${REGISTRY}/inginious/core-base:${VERSION} COPY inginious/backend/ inginious/backend/ COPY inginious-backend . -COPY deploy/backend.setup setup.py -RUN pip3 install . +# See https://github.com/pypa/setuptools_scm/#usage-from-docker +RUN --mount=source=.git,target=.git,type=bind \ + pip3 install --no-cache-dir -e . CMD ["sh", "-c", "python3 inginious-backend ${AGENT} ${CLIENT}"] diff --git a/deploy/backend.setup b/deploy/backend.setup deleted file mode 100644 index d9fe299ab0..0000000000 --- a/deploy/backend.setup +++ /dev/null @@ -1,13 +0,0 @@ -from setuptools import setup, find_packages - -install_requires = [ - "pyzmq>=15.3.0", - "msgpack >= 1.0.0", -] - -setup( - name="INGInious", - packages=find_packages(), - install_requires=install_requires, - include_package_data=True, -) diff --git a/deploy/db_setup.py b/deploy/db_setup.py index 5884627e11..04f424ad85 100644 --- a/deploy/db_setup.py +++ b/deploy/db_setup.py @@ -39,7 +39,7 @@ def try_mongodb_opts(host="localhost", database_name='INGInious'): print('Initial DB setup.') - database = try_mongodb_opts('inginious-db') + database = try_mongodb_opts('db') database.users.insert_one({"username": username, "realname": realname, diff --git a/deploy/frontend.containerfile b/deploy/frontend.containerfile index 1b313bded5..6d9edad332 100644 --- a/deploy/frontend.containerfile +++ b/deploy/frontend.containerfile @@ -1,4 +1,7 @@ -FROM inginious/inginious-base +ARG VERSION=latest +ARG REGISTRY + +FROM ${REGISTRY}/inginious/core-base:${VERSION} COPY inginious/frontend inginious/frontend/ COPY inginious/client inginious/client/ @@ -6,8 +9,9 @@ COPY inginious-webapp . RUN dnf install -y git gcc python39-devel -COPY deploy/frontend.setup setup.py -RUN pip3 install . +# See https://github.com/pypa/setuptools_scm/#usage-from-docker +RUN --mount=source=.git,target=.git,type=bind \ + pip3 install --no-cache-dir -e . COPY deploy/db_setup.py /tmp/db_setup.py diff --git a/deploy/frontend.setup b/deploy/frontend.setup deleted file mode 100644 index 95d5dae8bc..0000000000 --- a/deploy/frontend.setup +++ /dev/null @@ -1,50 +0,0 @@ -from setuptools import setup, find_packages - -install_requires = [ - "pyzmq>=15.3.0", - "msgpack >= 1.0.0", - "Werkzeug >= 1.0.0", - "PyYAML>=3.11", - "Flask >= 1.1.0", - "Flask-Mail >= 0.9.1", - "pymongo>=3.2.2", - "oauth2>=1.9.0.post1", - - #"docker>=2.5.0", - #"docutils>=0.14", - "pymongo>=3.2.2", - "PyYAML>=3.11", - "Jinja2 >= 2.10", - "lti>=0.9.0", - "oauth2>=1.9.0.post1", - "httplib2>=0.9", - "watchdog >= 0.8.3", - "msgpack >= 1.0.0", - "pyzmq >= 15.3.0", - "natsort >= 5.0.1", - "psutil >= 4.4.2", - "zipstream >= 1.1.4", - "WsgiDAV >= 3.0.0", - "Werkzeug >= 1.0.0", - "itsdangerous >= 1.1.0", - "Flask >= 1.1.0", - "Flask-Mail >= 0.9.1", - "importlib_metadata >= 3.7.0", - 'dataclasses >= 0.8; python_version < "3.7.0"', - "pytidylib>=0.2.4", - "sphinx-autodoc-typehints>=1.12.0", - "sh" -] - -setup( - name="INGInious", - packages=find_packages(), - install_requires=install_requires, - include_package_data=True, - extras_require={ - "cgi": ["flup>=1.0.3.dev"], - "ldap": ["ldap3"], - "saml2": ["python3-saml"], - "uwsgi": ["uwsgi"], - }, -) diff --git a/deploy/inginious-base.containerfile b/deploy/inginious-base.containerfile index 51c16d8679..31b53f1f42 100644 --- a/deploy/inginious-base.containerfile +++ b/deploy/inginious-base.containerfile @@ -1,8 +1,15 @@ FROM rockylinux:8 -RUN dnf update -y && dnf install -y python39 python39-pip +ENV INGINIOUS_COMPOSE=1 + +RUN dnf update -y && dnf install -y python39 python39-pip git RUN pip3 install importlib-metadata WORKDIR /inginious +COPY setup.py README.rst ./ COPY inginious/common/ inginious/common/ COPY inginious/__init__.py inginious/ + +# See https://github.com/pypa/setuptools_scm/#usage-from-docker +RUN --mount=source=.git,target=.git,type=bind \ + pip3 install --no-cache-dir -e . diff --git a/docker-compose.yml b/docker-compose.yml index 4573e80930..affd3163f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,30 +1,36 @@ services: - inginious-db: + db: image: mongo:6.0.2 networks: - inginious - inginious-backend: - image: inginious/inginious-backend + backend: + image: ${REGISTRY}/inginious/core-backend:${VERSION} build: dockerfile: deploy/backend.containerfile + args: + - VERSION=${VERSION} + - REGISTRY=${REGISTRY} environment: AGENT: "tcp://0.0.0.0:2001" CLIENT: "tcp://0.0.0.0:2000" networks: - inginious - inginious-agent-docker: - image: inginious/inginious-agent-docker + agent-docker: + image: ${REGISTRY}/inginious/core-agent_docker:${VERSION} depends_on: - - inginious-backend + - backend deploy: replicas: 1 build: dockerfile: deploy/agent-docker.containerfile + args: + - VERSION=${VERSION} + - REGISTRY=${REGISTRY} environment: - BACKEND: "tcp://inginious-backend:2001" + BACKEND: "tcp://backend:2001" volumes: - /var/run/docker.sock:/var/run/docker.sock # See https://github.com/UCL-INGI/INGInious/issues/352 @@ -35,16 +41,19 @@ services: networks: - inginious - inginious-agent-mcq: - image: inginious/inginious-agent-mcq + agent-mcq: + image: ${REGISTRY}/inginious/core-agent_mcq:${VERSION} depends_on: - - inginious-backend + - backend deploy: replicas: 1 build: dockerfile: deploy/agent-mcq.containerfile + args: + - VERSION=${VERSION} + - REGISTRY=${REGISTRY} environment: - BACKEND: "tcp://inginious-backend:2001" + BACKEND: "tcp://backend:2001" volumes: # See https://github.com/UCL-INGI/INGInious/issues/352 - ./tasks/:/inginious/tasks @@ -54,14 +63,17 @@ services: networks: - inginious - inginious-frontend: - image: inginious/inginious-frontend + frontend: + image: ${REGISTRY}/inginious/core-frontend:${VERSION} build: dockerfile: deploy/frontend.containerfile + args: + - VERSION=${VERSION} + - REGISTRY=${REGISTRY} depends_on: - - inginious-backend - - inginious-agent-docker - - inginious-agent-mcq + - backend + - agent-docker + - agent-mcq environment: - INGINIOUS_WEBAPP_HOST=0.0.0.0 volumes: diff --git a/setup.py b/setup.py index d16428ebbd..6b3dea6de4 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,19 @@ else: install_requires += ["sh>=1.11"] +scripts = [] if os.environ.get("INGINIOUS_COMPOSE") else [ + 'inginious-agent-docker', + 'inginious-agent-mcq', + 'inginious-backend', + 'inginious-webapp', + 'inginious-webdav', + 'inginious-install', + 'inginious-autotest', + 'utils/sync/inginious-synchronize', + 'utils/container_update/inginious-container-update', + 'utils/database_updater/inginious-database-update' +] + # Setup setup( name="INGInious", @@ -69,20 +82,7 @@ "test": test_requires, "doc": test_requires + doc_requires }, - - scripts=[ - 'inginious-agent-docker', - 'inginious-agent-mcq', - 'inginious-backend', - 'inginious-webapp', - 'inginious-webdav', - 'inginious-install', - 'inginious-autotest', - 'utils/sync/inginious-synchronize', - 'utils/container_update/inginious-container-update', - 'utils/database_updater/inginious-database-update' - ], - + scripts=scripts, include_package_data=True, test_suite='nose.collector', author="INGInious contributors", From 6b35ca4d2e9051822083c3c879facae83e60b307 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Sat, 2 Sep 2023 02:48:36 +0200 Subject: [PATCH 13/18] [deploy] Add core containers build to CI --- .github/workflows/core_containers.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/core_containers.yml diff --git a/.github/workflows/core_containers.yml b/.github/workflows/core_containers.yml new file mode 100644 index 0000000000..7fdce19c5c --- /dev/null +++ b/.github/workflows/core_containers.yml @@ -0,0 +1,20 @@ +name: Build and push core containers + +on: + push: + branches: [master] + + workflow_dispatch: + +jobs: + containers_build_and_push: + uses: INGInious/.github/.github/workflows/containers.yml@6506916a602fc6bf47d6e8f34586732d3c8e1502 + with: + working-directory: base-containers + context-path: context.yml + compose-path: compose.yml + registry: ghcr.io + container_type: core + secrets: + GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }} + GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }} From ad431c6b12d41898de7c7bb40647badb70a2dca1 Mon Sep 17 00:00:00 2001 From: Nicolas Rybowski Date: Thu, 21 Sep 2023 14:00:55 +0200 Subject: [PATCH 14/18] Use code escape in documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested changes by @anthonygego Co-authored-by: Anthony Gégo --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 014bdee353..35293236eb 100644 --- a/README.rst +++ b/README.rst @@ -38,11 +38,11 @@ Simply run: And access http://localhost:9000 in your browser. -*The default login and password are "superadmin".* +*The default login and password are ``superadmin``.* -Docker-compose will create a "tasks" folder if it does not exist already. +Docker-compose will create a ``tasks`` folder if it does not exist already. -You can then add new courses to your fresh INGInious instance by installing them in the "tasks" folder. +You can then add new courses to your fresh INGInious instance by installing them in the ``tasks`` folder. For example, the INGInious tutorial course is installed with the following commands: From 9c4c16dd74618e6572041c937ecbcf816b15b368 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Tue, 10 Oct 2023 21:12:51 +0200 Subject: [PATCH 15/18] [deploy/compose] Build base image in stack deploy --- docker-compose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index affd3163f1..c0fb7ec9b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,14 @@ services: + base: + image: ${REGISTRY}/inginious/core-base:${VERSION} + build: + dockerfile: deploy/inginious-base.containerfile + args: + - VERSION=${VERSION} + - REGISTRY=${REGISTRY} + command: /bin/true + db: image: mongo:6.0.2 networks: @@ -7,6 +16,8 @@ services: backend: image: ${REGISTRY}/inginious/core-backend:${VERSION} + depends_on: + - base build: dockerfile: deploy/backend.containerfile args: From 3a1e0d2b25bca4d1c8971af357d979fde0cd4d4b Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 11 Oct 2023 08:14:45 +0200 Subject: [PATCH 16/18] [deploy] Update doc about core containers build --- README.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 35293236eb..91f37fb3b4 100644 --- a/README.rst +++ b/README.rst @@ -36,9 +36,13 @@ Simply run: $ REGISTRY=ghcr.io VERSION=latest docker-compose up --build + And access http://localhost:9000 in your browser. -*The default login and password are ``superadmin``.* +*The default login and password are* ``superadmin``. + +The ``--build`` argument is optional, use it if you want to rebuild locally the core containers. +If you want to simply pull them from the project's registry, this argument is not required. Docker-compose will create a ``tasks`` folder if it does not exist already. @@ -55,7 +59,7 @@ For example, the INGInious tutorial course is installed with the following comma .. code-block:: - $ sudo chown -R : tasks + $ sudo chown -R : tasks *This can happen when the tasks directory is created by docker-compose.* From 3fcac7a945fdde9e70f071170bd64209f5e0432b Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 11 Oct 2023 08:24:33 +0200 Subject: [PATCH 17/18] [deploy/base] Document the containerfile --- deploy/inginious-base.containerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/inginious-base.containerfile b/deploy/inginious-base.containerfile index 31b53f1f42..1eaf7b4852 100644 --- a/deploy/inginious-base.containerfile +++ b/deploy/inginious-base.containerfile @@ -1,3 +1,4 @@ +# Base core container. This is not a service per-se but is used as a common layer for the core services. FROM rockylinux:8 ENV INGINIOUS_COMPOSE=1 From 861d608a39807d13df20996be71105fb70d5b151 Mon Sep 17 00:00:00 2001 From: nrybowski Date: Wed, 6 Dec 2023 12:59:19 +0100 Subject: [PATCH 18/18] [deploy] Update review comments - Add .env file with defaults values for REGISTRY and VERSION variables - Fix "docker compose" syntax for modern deployements --- .env | 2 ++ README.rst | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000000..04db84fb55 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +REGISTRY=ghcr.io +VERSION=latest diff --git a/README.rst b/README.rst index 91f37fb3b4..91e520cbe0 100644 --- a/README.rst +++ b/README.rst @@ -34,8 +34,10 @@ Simply run: .. code-block:: - $ REGISTRY=ghcr.io VERSION=latest docker-compose up --build + $ docker compose up --build +> Note that you can override the registry and containers version by setting the `REGISTRY` and +> `VERSION` environment variables. And access http://localhost:9000 in your browser.