From 4dc391ad13bb3eb857c438924caa674f941947ef Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Wed, 24 May 2023 12:55:41 +0100 Subject: [PATCH 1/9] add packit to deployment --- config/basic/orderly-web.yml | 2 +- config/breaking/orderly-web.yml | 2 +- config/complete/orderly-web.yml | 16 +++- config/customcss/orderly-web.yml | 2 +- config/montagu/orderly-web.yml | 5 +- config/packit/orderly-web.yml | 148 +++++++++++++++++++++++++++++++ orderly_web/config.py | 61 ++++++++++--- orderly_web/constellation.py | 94 +++++++++++++++++--- proxy/bin/orderly-web-proxy | 10 ++- proxy/nginx.conf | 8 ++ test/test_config.py | 27 ++++-- test/test_integration.py | 21 +++-- 12 files changed, 347 insertions(+), 49 deletions(-) create mode 100644 config/packit/orderly-web.yml diff --git a/config/basic/orderly-web.yml b/config/basic/orderly-web.yml index ed27ae6..63bfc68 100644 --- a/config/basic/orderly-web.yml +++ b/config/basic/orderly-web.yml @@ -122,4 +122,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: master + tag: mrc-4255 diff --git a/config/breaking/orderly-web.yml b/config/breaking/orderly-web.yml index 8d4a736..5241183 100644 --- a/config/breaking/orderly-web.yml +++ b/config/breaking/orderly-web.yml @@ -52,4 +52,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: master + tag: mrc-4255 diff --git a/config/complete/orderly-web.yml b/config/complete/orderly-web.yml index 3b417d6..8dc7250 100644 --- a/config/complete/orderly-web.yml +++ b/config/complete/orderly-web.yml @@ -69,15 +69,27 @@ volumes: # Optional: to migrate the underlying orderly metadata to outpack metadata outpack: + repo: mrcide server: - repo: mrcide name: outpack_server tag: main migrate: - repo: mrcide name: outpack.orderly tag: main +# Optional: include Packit app +packit: + repo: mrcide + api: + name: packit-api + tag: main + app: + name: packit + tag: mrc-4261 + db: + name: packit-db + tag: main + ## Redis configuration redis: image: diff --git a/config/customcss/orderly-web.yml b/config/customcss/orderly-web.yml index c472342..4818b4e 100644 --- a/config/customcss/orderly-web.yml +++ b/config/customcss/orderly-web.yml @@ -110,4 +110,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: master + tag: mrc-4255 diff --git a/config/montagu/orderly-web.yml b/config/montagu/orderly-web.yml index e186c9a..399c511 100644 --- a/config/montagu/orderly-web.yml +++ b/config/montagu/orderly-web.yml @@ -21,12 +21,11 @@ volumes: # Optional: to migrate the underlying orderly metadata to outpack metadata outpack: + repo: mrcide server: - repo: mrcide name: outpack_server tag: main migrate: - repo: mrcide name: outpack.orderly tag: main @@ -116,4 +115,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: master + tag: mrc-4255 diff --git a/config/packit/orderly-web.yml b/config/packit/orderly-web.yml new file mode 100644 index 0000000..50381f4 --- /dev/null +++ b/config/packit/orderly-web.yml @@ -0,0 +1,148 @@ +## Prefix for container names; we'll use {container_prefix}_(orderly,web) +container_prefix: orderly_web + +## The name of the docker network that containers will be attached to. +## If you want to proxy OrderlyWeb to the host, you will need to +## arrange a proxy on this network, or use dev_mode in the web section +## below. +network: orderly_web_network + +## Names of the docker volumes to use: +## +## orderly: stores the orderly archive +## proxy_logs: stores logs from the reverse proxy (only used if proxy is given) +## documents: stores static documentation available through the web app +## +## (More volumes are anticipated as the tool develops) +volumes: + orderly: orderly_web_volume + proxy_logs: orderly_web_proxy_logs + documents: orderly_web_documents + redis: orderly_web_redis_data + outpack: orderly_web_outpack + +## Redis configuration +redis: + image: + name: redis + tag: "5.0" + volume: orderly_web_redis_data + + +## Orderly configuration +orderly: + ## Image to use for orderly. This should build off of + ## vimc/orderly.server but can be extended to use whatever packages + ## you need. The components repo, image and tag will be assembled as + ## /: for the full docker image reference. + image: + repo: vimc + name: orderly.server + tag: master + worker_name: orderly.server + ## Initial data source for the orderly reports. This section is + ## optional - if not present, it is up to you to initialise the + ## orderly volume (in the volumes section above) with appropriate + ## data (if data is not present, orderly will not start). This + ## section only has an effect if the volume is empty. + initial: + ## Source must be one of "clone" or "demo" + source: clone + ## If source is "clone", then "url" must be given. If using a + ## private repo, then use an ssh url and provide ssh keys in the + ## "ssh" section. + url: https://github.com/reside-ic/orderly-example + ## Number of workers to create to run orderly jobs + workers: 1 + expose: true + env: + ORDERLY_API_SERVER_IDENTITY: production + +## Api and Website configuration +web: + ## Image to use for the web components. As for the orderly + ## configuration these will be assembled as /:. In + ## addition, a second image with the database migration support will + ## be used as /:. It is not expected (unlike + ## the orderly image) that the 'name' and 'migrate' will need to be + ## changed often, and it is expected that a web image will go + ## together with corresponding migration and admin images. + image: + repo: vimc + name: orderly-web + tag: master + migrate: orderlyweb-migrate + admin: orderly-web-user-cli + ## Public-facing url for the whole web service, including protocol + ## (ideally https://), hostname and port (if not using standard + ## ports). Here, we're going to use the same as for the proxy but + ## if you are using an external proxy then you'd use its hostname + ## and port. + url: https://localhost + ## If dev_mode is true then the port is exposed to the host (as + ## plain http). Do not use in production. The port is attached + ## only to the localhost and will not be available from other + ## machines + dev_mode: true + ## Port to use for the web service + port: 8888 + ## Name of the web service (affects the UI) + name: OrderlyWeb + ## Email address of the web service + email: admin@example.com + ## Authentication configuration + auth: + ## Name of the github organisation if using github auth + github_org: vimc + ## Name of the team within this github organisation if using + ## github auth (cuurrently must be "" - VIMC + github_team: "" + ## If using github auth you will need to register a github oauth app + ## https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/ + ## The "Authorization callback URL" must be set to the public facing url + ## that you configured above + github_oauth: + id: "notarealid" + secret: "notarealsecret" + ## Enable or disable fine grained permissions + fine_grained: true + ## Enable montagu authentication provider + montagu: false + +# Optional: to notify a Slack channel during deployment, provide a webhook url +slack: + webhook_url: https://hooks.slack.com/services/T000/B000/XXXX + +## If running a proxy directly, fill this section in. Otherwise you +## are responsible for proxying the application out of the docker +## network +proxy: + enabled: true + hostname: localhost + port_http: 80 + port_https: 443 + image: + repo: vimc + name: orderly-web-proxy + tag: mrc-4255 + +outpack: + repo: mrcide + server: + name: outpack_server + tag: main + migrate: + name: outpack.orderly + tag: main + +packit: + repo: mrcide + api: + name: packit-api + tag: mrc-4255 + app: + name: packit + tag: mrc-4261 + db: + name: packit-db + tag: main diff --git a/orderly_web/config.py b/orderly_web/config.py index 6d614c1..93d5d9d 100644 --- a/orderly_web/config.py +++ b/orderly_web/config.py @@ -85,7 +85,7 @@ def fetch(self): with docker_client() as cl: name = self.containers[PATH_CONFIG["container"]] container = cl.containers.get( - "{}_{}".format(self.container_prefix, name)) + "{}-{}".format(self.container_prefix, name)) except docker.errors.NotFound: return None path = PATH_CONFIG["path"] @@ -163,14 +163,14 @@ def __init__(self, path, dat): self.containers = { "redis": "redis", "orderly": "orderly", - "orderly_worker": "orderly_worker", + "orderly-worker": "orderly-worker", "web": "web" } self.images = { "redis": self.redis_ref, "orderly": self.orderly_ref, - "orderly_worker": self.orderly_worker_ref, + "orderly-worker": self.orderly_worker_ref, "web": self.web_ref, "admin": self.admin_ref, "migrate": self.migrate_ref @@ -182,7 +182,7 @@ def __init__(self, path, dat): self.volumes["outpack"] = config.config_string(dat, ["volumes", "outpack"]) self.outpack_repo = config.config_string( - dat, ["outpack", "server", "repo"]) + dat, ["outpack", "repo"]) self.outpack_name = config.config_string( dat, ["outpack", "server", "name"]) self.outpack_tag = config.config_string( @@ -191,20 +191,57 @@ def __init__(self, path, dat): self.outpack_repo, self.outpack_name, self.outpack_tag) - self.outpack_migrate_repo = config.config_string( - dat, ["outpack", "migrate", "repo"]) self.outpack_migrate_name = config.config_string( dat, ["outpack", "migrate", "name"]) self.outpack_migrate_tag = config.config_string( dat, ["outpack", "migrate", "tag"]) self.outpack_migrate_ref = constellation.ImageReference( - self.outpack_migrate_repo, self.outpack_migrate_name, + self.outpack_repo, self.outpack_migrate_name, self.outpack_migrate_tag) - self.containers["outpack_server"] = "outpack_server" - self.images["outpack_server"] = self.outpack_ref - self.containers["outpack_migrate"] = "outpack_migrate" - self.images["outpack_migrate"] = self.outpack_migrate_ref + self.containers["outpack-server"] = "outpack-server" + self.images["outpack-server"] = self.outpack_ref + self.containers["outpack-migrate"] = "outpack-migrate" + self.images["outpack-migrate"] = self.outpack_migrate_ref + + # 8. Packit + if "packit" in dat and not self.outpack_enabled: + print("Ignoring Packit configuration as outpack is not enabled") + self.packit_enabled = "packit" in dat and self.outpack_enabled + if self.packit_enabled: + self.packit_repo = config.config_string( + dat, ["packit", "repo"]) + + self.packit_db_name = config.config_string( + dat, ["packit", "db", "name"]) + self.packit_db_tag = config.config_string( + dat, ["packit", "db", "tag"]) + self.packit_db_ref = constellation.ImageReference( + self.packit_repo, self.packit_db_name, + self.packit_db_tag) + + self.packit_api_name = config.config_string( + dat, ["packit", "api", "name"]) + self.packit_api_tag = config.config_string( + dat, ["packit", "api", "tag"]) + self.packit_api_ref = constellation.ImageReference( + self.packit_repo, self.packit_api_name, + self.packit_api_tag) + + self.packit_app_name = config.config_string( + dat, ["packit", "app", "name"]) + self.packit_app_tag = config.config_string( + dat, ["packit", "app", "tag"]) + self.packit_app_ref = constellation.ImageReference( + self.packit_repo, self.packit_app_name, + self.packit_app_tag) + + self.containers["packit-db"] = "packit-db" + self.images["packit-db"] = self.packit_db_ref + self.containers["packit-api"] = "packit-api" + self.images["packit-api"] = self.packit_api_ref + self.containers["packit"] = "packit" + self.images["packit"] = self.packit_app_ref self.non_constellation_images = { "admin": self.admin_ref, @@ -346,7 +383,7 @@ def save(self): def get_container(self, name): with docker_client() as cl: - return cl.containers.get("{}_{}".format(self.container_prefix, + return cl.containers.get("{}-{}".format(self.container_prefix, self.containers[name])) def resolve_secrets(self): diff --git a/orderly_web/constellation.py b/orderly_web/constellation.py index 3fbc6fc..ded1898 100644 --- a/orderly_web/constellation.py +++ b/orderly_web/constellation.py @@ -17,16 +17,27 @@ def orderly_constellation(cfg): web = web_container(cfg) containers = [redis, orderly, worker, web] - if cfg.proxy_enabled: - proxy = proxy_container(cfg, web) - containers.append(proxy) - if cfg.outpack_enabled: outpack_migrate = outpack_migrate_container(cfg) containers.append(outpack_migrate) outpack_server = outpack_server_container(cfg) containers.append(outpack_server) + if cfg.packit_enabled: + packit_db = packit_db_container(cfg) + containers.append(packit_db) + packit_api = packit_api_container(cfg) + containers.append(packit_api) + packit = packit_container(cfg) + containers.append(packit) + + if cfg.proxy_enabled: + if cfg.packit_enabled: + proxy = proxy_container(cfg, web, packit_api, packit) + else: + proxy = proxy_container(cfg, web) + containers.append(proxy) + obj = constellation.Constellation("orderly-web", cfg.container_prefix, containers, cfg.network, cfg.volumes, data=cfg, vault_config=cfg.vault) @@ -34,7 +45,7 @@ def orderly_constellation(cfg): def outpack_server_container(cfg): - name = cfg.containers["outpack_server"] + name = cfg.containers["outpack-server"] mounts = [constellation.ConstellationMount("outpack", "/outpack")] outpack_server = constellation.ConstellationContainer( name, cfg.outpack_ref, mounts=mounts) @@ -42,7 +53,7 @@ def outpack_server_container(cfg): def outpack_migrate_container(cfg): - name = cfg.containers["outpack_migrate"] + name = cfg.containers["outpack-migrate"] mounts = [constellation.ConstellationMount("outpack", "/outpack"), constellation.ConstellationMount("orderly", "/orderly")] args = ["/orderly", "/outpack", "--minutes=5"] @@ -51,6 +62,50 @@ def outpack_migrate_container(cfg): return outpack_migrate +def packit_db_container(cfg): + name = cfg.containers["packit-db"] + packit_db = constellation.ConstellationContainer( + name, cfg.packit_db_ref, configure=packit_db_configure) + return packit_db + + +def packit_db_configure(container, cfg): + docker_util.exec_safely(container, ["wait-for-db"]) + docker_util.exec_safely(container, + ["psql", "-U", "packituser", "-d", "packit", "-a", "-f", "/packit-schema/schema.sql"]) + + +def packit_api_container(cfg): + name = cfg.containers["packit-api"] + packit_api = constellation.ConstellationContainer( + name, cfg.packit_api_ref, configure=packit_api_configure) + return packit_api + + +def packit_api_configure(container, cfg): + print("[web] Configuring Packit API container") + outpack_container = cfg.containers["outpack-server"] + packit_db_container = cfg.containers["packit-db"] + opts = { + "db.url": "jdbc:postgresql://{}-{}:5432/packit?stringtype=unspecified".format(cfg.container_prefix, + packit_db_container), + "db.user": "packituser", + "db.password": "changeme", + "outpack.server.url": "http://{}-{}:8000".format(cfg.container_prefix, + outpack_container) + } + txt = "".join(["{}={}\n".format(k, v) for k, v in opts.items()]) + docker_util.string_into_container( + txt, container, "/etc/packit/config.properties") + + +def packit_container(cfg): + name = cfg.containers["packit"] + packit = constellation.ConstellationContainer( + name, cfg.packit_app_ref) + return packit + + def redis_container(cfg): redis_name = cfg.containers["redis"] redis_mounts = [constellation.ConstellationMount("redis", "/data")] @@ -156,7 +211,7 @@ def orderly_start(container): def worker_container(cfg, redis_container): - worker_name = cfg.containers["orderly_worker"] + worker_name = cfg.containers["orderly-worker"] worker_args = ["--go-signal", "/go_signal"] worker_mounts = [constellation.ConstellationMount("orderly", "/orderly")] worker_entrypoint = "/usr/local/bin/orderly_worker" @@ -253,7 +308,7 @@ def web_container_config(container, cfg): "auth.github_team": cfg.web_auth_github_team or "", "auth.fine_grained": str(cfg.web_auth_fine_grained).lower(), "auth.provider": "montagu" if cfg.web_auth_montagu else "github", - "orderly.server": "http://{}_{}:8321".format(cfg.container_prefix, + "orderly.server": "http://{}-{}:8321".format(cfg.container_prefix, orderly_container) } if cfg.logo_name is not None: @@ -265,9 +320,9 @@ def web_container_config(container, cfg): opts["auth.github_key"] = cfg.web_auth_github_app["id"] opts["auth.github_secret"] = cfg.web_auth_github_app["secret"] if cfg.outpack_enabled: - outpack_container = cfg.containers["outpack_server"] + outpack_container = cfg.containers["outpack-server"] opts["outpack.server"] = \ - "http://{}_{}:8000".format(cfg.container_prefix, + "http://{}-{}:8000".format(cfg.container_prefix, outpack_container) txt = "".join(["{}={}\n".format(k, v) for k, v in opts.items()]) docker_util.exec_safely(container, ["mkdir", "-p", "/etc/orderly/web"]) @@ -288,13 +343,26 @@ def web_start(container): docker_util.exec_safely(container, ["touch", "/etc/orderly/web/go_signal"]) -def proxy_container(cfg, web_container): +def proxy_container(cfg, web, packit_api=None, packit=None): print("[proxy] Creating proxy container") proxy_name = cfg.containers["proxy"] web_addr = "{}:{}".format( - web_container.name_external(cfg.container_prefix), cfg.web_port) + web.name_external(cfg.container_prefix), cfg.web_port) + if packit_api is not None: + packit_api_addr = "{}:8080".format( + packit_api.name_external(cfg.container_prefix)) + else: + # this is a bit hacky, but if Packit not available, just pass + # the OW address. this will just result in all proxy routes + # being mapped to OW and is easier than writing conditional logic + # in the nginx proxy scripts + packit_api_addr = web_addr + if packit is not None: + packit_addr = packit.name_external(cfg.container_prefix) + else: + packit_addr = web_addr proxy_args = [cfg.proxy_hostname, str(cfg.proxy_port_http), - str(cfg.proxy_port_https), web_addr] + str(cfg.proxy_port_https), web_addr, packit_api_addr, packit_addr] proxy_mounts = [constellation.ConstellationMount( "proxy_logs", "/var/log/nginx")] proxy_ports = [cfg.proxy_port_http, cfg.proxy_port_https] diff --git a/proxy/bin/orderly-web-proxy b/proxy/bin/orderly-web-proxy index 1b439a0..422ffef 100755 --- a/proxy/bin/orderly-web-proxy +++ b/proxy/bin/orderly-web-proxy @@ -1,21 +1,23 @@ #!/usr/bin/env bash set -eu -if [ "$#" -eq 4 ]; then +if [ "$#" -eq 6 ]; then export HTTP_HOST=$1 export HTTP_PORT=$2 export HTTPS_PORT=$3 export ORDERLY_WEB=$4 + export PACKIT_API=$5 + export PACKIT=$6 else - echo "Usage: HOSTNAME PORT_HTTP PORT_HTTPS ORDERLY_WEB" - echo "e.g. docker run ... montagu.vaccineimpact.org 80 443 orderly" + echo "Usage: HOSTNAME PORT_HTTP PORT_HTTPS ORDERLY_WEB PACKIT_API PACKIT" + echo "e.g. docker run ... montagu.vaccineimpact.org 80 443 orderly packit_api packit" exit 1 fi echo "We will listen on ports $HTTP_PORT (http) and $HTTPS_PORT (https)" echo "with hostname $HTTP_HOST, proxying orderly web from $ORDERLY_WEB" -envsubst '$HTTP_HOST,$HTTP_PORT,$HTTPS_PORT,$ORDERLY_WEB' \ +envsubst '$HTTP_HOST,$HTTP_PORT,$HTTPS_PORT,$ORDERLY_WEB, $PACKIT_API, $PACKIT' \ < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf # These paths must match the paths as used in the nginx.conf diff --git a/proxy/nginx.conf b/proxy/nginx.conf index 81e17e2..4dc1f70 100644 --- a/proxy/nginx.conf +++ b/proxy/nginx.conf @@ -68,6 +68,14 @@ http { root /usr/share/nginx/html; + location /packit/api/ { + proxy_pass http://${PACKIT_API}/; + } + + location /packit/ { + proxy_pass http://${PACKIT}/; + } + location / { proxy_pass http://${ORDERLY_WEB}/; } diff --git a/test/test_config.py b/test/test_config.py index 6de507c..6ea9df5 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -3,9 +3,7 @@ import pytest import shutil import tempfile -import vault_dev import yaml -import os from orderly_web.config import * @@ -56,7 +54,7 @@ def test_example_config(): assert cfg.proxy_enabled assert cfg.proxy_ssl_self_signed - assert str(cfg.images["proxy"]) == "vimc/orderly-web-proxy:master" + assert str(cfg.images["proxy"]) == "vimc/orderly-web-proxy:mrc-4255" assert cfg.orderly_expose assert cfg.orderly_initial_source == "clone" @@ -263,11 +261,10 @@ def test_outpack_volume_required_if_enabled(): def test_outpack_config(): - options = {"outpack": {"migrate": {"repo": "mrcide", - "name": "outpack.orderly", + options = {"outpack": {"repo": "mrcide", + "migrate": {"name": "outpack.orderly", "tag": "main"}, - "server": {"repo": "mrcide", - "name": "outpack_server", + "server": {"name": "outpack_server", "tag": "main"} }, "volumes": {"outpack": "outpack_vol"}} @@ -285,6 +282,22 @@ def test_outpack_disabled_if_no_config(): assert cfg.outpack_enabled is False +def test_packit_config(): + cfg = build_config("config/packit") + assert cfg.packit_api_ref is not None + assert cfg.containers["packit_api"] == "packit_api" + assert cfg.packit_db_ref is not None + assert cfg.containers["packit_db"] == "packit_db" + assert cfg.packit_app_ref is not None + assert cfg.containers["packit"] == "packit" + assert cfg.packit_enabled is True + + +def test_packit_disabled_if_no_config(): + cfg = build_config("config/basic") + assert cfg.packit_enabled is False + + def read_file(path): with open(path, "r") as f: return f.read() diff --git a/test/test_integration.py b/test/test_integration.py index 91fc0e0..a88aef1 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -132,7 +132,7 @@ def test_start_with_custom_styles(): logo = docker_util.bytes_from_container(web, expected_destination) assert len(logo) > 0 res = requests.get("http://localhost:8888") - assert """ Date: Wed, 24 May 2023 14:53:13 +0100 Subject: [PATCH 2/9] Update config, tests, version of constellation --- config/basic/orderly-web.yml | 6 +++--- config/breaking/orderly-web.yml | 4 ++-- config/complete/orderly-web.yml | 6 +++--- config/customcss/orderly-web.yml | 6 +++--- config/montagu/orderly-web.yml | 6 +++--- config/noproxy/orderly-web.yml | 6 +++--- config/packit/orderly-web.yml | 6 +++--- config/vault/orderly-web.yml | 6 +++--- requirements.txt | 2 +- test/test_cli.py | 4 ++-- test/test_config.py | 22 +++++++++++----------- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/config/basic/orderly-web.yml b/config/basic/orderly-web.yml index 63bfc68..163fc85 100644 --- a/config/basic/orderly-web.yml +++ b/config/basic/orderly-web.yml @@ -1,11 +1,11 @@ -## Prefix for container names; we'll use {container_prefix}_(orderly,web) -container_prefix: orderly_web +## Prefix for container names; we'll use {container_prefix}-{container_name) +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/config/breaking/orderly-web.yml b/config/breaking/orderly-web.yml index 5241183..02b9619 100644 --- a/config/breaking/orderly-web.yml +++ b/config/breaking/orderly-web.yml @@ -1,6 +1,6 @@ -container_prefix: orderly_web +container_prefix: orderly-web -network: orderly_web_network +network: orderly-web-network volumes: orderly: orderly_web_volume diff --git a/config/complete/orderly-web.yml b/config/complete/orderly-web.yml index 8dc7250..779bfde 100644 --- a/config/complete/orderly-web.yml +++ b/config/complete/orderly-web.yml @@ -32,7 +32,7 @@ vault: args: token: ~ -## Prefix for container names; we'll use {container_prefix}_(orderly,web) +## Prefix for container names; we'll use {container_prefix}-(container_name) ## ## This is an important configuration option because it cannot be ## overridden by a patch file or by passing options in. @@ -41,13 +41,13 @@ vault: ## OrderlyWeb, then change the prefix, then start it back up. ## Otherwise OrderlyWeb will not take down the required containers ## before starting back up. -container_prefix: orderly_web +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/config/customcss/orderly-web.yml b/config/customcss/orderly-web.yml index 4818b4e..fba232c 100644 --- a/config/customcss/orderly-web.yml +++ b/config/customcss/orderly-web.yml @@ -1,11 +1,11 @@ -## Prefix for container names; we'll use {container_prefix}_(orderly,web) -container_prefix: orderly_web +## Prefix for container names; we'll use {container_prefix}-(container_name) +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/config/montagu/orderly-web.yml b/config/montagu/orderly-web.yml index 399c511..f98e883 100644 --- a/config/montagu/orderly-web.yml +++ b/config/montagu/orderly-web.yml @@ -1,11 +1,11 @@ -## Prefix for container names; we'll use {container_prefix}_(orderly,web) -container_prefix: orderly_web +## Prefix for container names; we'll use {container_prefix}-(container_name) +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/config/noproxy/orderly-web.yml b/config/noproxy/orderly-web.yml index 6d9a726..14a4862 100644 --- a/config/noproxy/orderly-web.yml +++ b/config/noproxy/orderly-web.yml @@ -1,11 +1,11 @@ -## Prefix for container names; we'll use {container_prefix}_(orderly,web) -container_prefix: orderly_web +## Prefix for container names; we'll use {container_prefix}-(container_name) +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/config/packit/orderly-web.yml b/config/packit/orderly-web.yml index 50381f4..12cf4aa 100644 --- a/config/packit/orderly-web.yml +++ b/config/packit/orderly-web.yml @@ -1,11 +1,11 @@ -## Prefix for container names; we'll use {container_prefix}_(orderly,web) -container_prefix: orderly_web +## Prefix for container names; we'll use {container_prefix}-(container_name) +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/config/vault/orderly-web.yml b/config/vault/orderly-web.yml index 49168b4..619ecc5 100644 --- a/config/vault/orderly-web.yml +++ b/config/vault/orderly-web.yml @@ -14,14 +14,14 @@ vault: ## azure, github, gcp, kubernetes, ldap, mfa, okta method: github -## Prefix for container names; we'll use {container_prefix}_(orderly,web) -container_prefix: orderly_web +## Prefix for container names; we'll use {container_prefix}-(container_name) +container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly_web_network +network: orderly-web-network ## Names of the docker volumes to use: ## diff --git a/requirements.txt b/requirements.txt index bc9053d..a9020f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -constellation==0.0.12 +constellation==1.0.0 docker docopt hvac diff --git a/test/test_cli.py b/test/test_cli.py index 657aef9..8b01363 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -14,9 +14,9 @@ def test_cli_basic_usage(): orderly_web.cli.main(["status", path]) out = f.getvalue() - assert "Network:\n - orderly_web_network: created" in out + assert "Network:\n - orderly-web-network: created" in out assert "Volumes:\n - redis (orderly_web_redis_data): created" in out - assert "- web (orderly_web_web): running" in out + assert "- web (orderly-web-web): running" in out stop_args = ["stop", path, "--kill", "--volumes", "--network"] orderly_web.cli.main(stop_args) diff --git a/test/test_config.py b/test/test_config.py index 6ea9df5..bbd3e1c 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -13,13 +13,13 @@ def test_example_config(): cfg = build_config("config/basic") - assert cfg.network == "orderly_web_network" + assert cfg.network == "orderly-web-network" assert cfg.volumes["orderly"] == "orderly_web_volume" assert cfg.volumes["redis"] == "orderly_web_redis_data" - assert cfg.container_prefix == "orderly_web" + assert cfg.container_prefix == "orderly-web" assert cfg.containers["redis"] == "redis" assert cfg.containers["orderly"] == "orderly" - assert cfg.containers["orderly_worker"] == "orderly_worker" + assert cfg.containers["orderly-worker"] == "orderly-worker" assert cfg.containers["web"] == "web" assert cfg.workers == 1 @@ -30,10 +30,10 @@ def test_example_config(): assert cfg.images["orderly"].name == "orderly.server" assert cfg.images["orderly"].tag == "master" assert str(cfg.images["orderly"]) == "vimc/orderly.server:master" - assert cfg.images["orderly_worker"].repo == "vimc" - assert cfg.images["orderly_worker"].name == "orderly.server" - assert cfg.images["orderly_worker"].tag == "master" - assert str(cfg.images["orderly_worker"]) == \ + assert cfg.images["orderly-worker"].repo == "vimc" + assert cfg.images["orderly-worker"].name == "orderly.server" + assert cfg.images["orderly-worker"].tag == "master" + assert str(cfg.images["orderly-worker"]) == \ "vimc/orderly.server:master" assert cfg.web_dev_mode assert cfg.web_port == 8888 @@ -270,9 +270,9 @@ def test_outpack_config(): "volumes": {"outpack": "outpack_vol"}} cfg = build_config("config/basic", options=options) assert cfg.outpack_migrate_ref is not None - assert cfg.containers["outpack_migrate"] == "outpack_migrate" + assert cfg.containers["outpack-migrate"] == "outpack-migrate" assert cfg.outpack_ref is not None - assert cfg.containers["outpack_server"] == "outpack_server" + assert cfg.containers["outpack-server"] == "outpack-server" assert cfg.volumes["outpack"] == "outpack_vol" assert cfg.outpack_enabled is True @@ -285,9 +285,9 @@ def test_outpack_disabled_if_no_config(): def test_packit_config(): cfg = build_config("config/packit") assert cfg.packit_api_ref is not None - assert cfg.containers["packit_api"] == "packit_api" + assert cfg.containers["packit-api"] == "packit-api" assert cfg.packit_db_ref is not None - assert cfg.containers["packit_db"] == "packit_db" + assert cfg.containers["packit-db"] == "packit-db" assert cfg.packit_app_ref is not None assert cfg.containers["packit"] == "packit" assert cfg.packit_enabled is True From a2c7ec2a3f489c700469c8e9de645f80805d40fb Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Wed, 24 May 2023 15:19:39 +0100 Subject: [PATCH 3/9] more fixes --- orderly_web/config.py | 2 +- test/test_integration.py | 80 ++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/orderly_web/config.py b/orderly_web/config.py index 93d5d9d..c0c1181 100644 --- a/orderly_web/config.py +++ b/orderly_web/config.py @@ -69,7 +69,7 @@ def __init__(self, path): self.containers = { "redis": "redis", "orderly": "orderly", - "orderly_worker": "orderly_worker", + "orderly-worker": "orderly-worker", "web": "web" } diff --git a/test/test_integration.py b/test/test_integration.py index a88aef1..4287919 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -38,15 +38,15 @@ def test_start_and_stop(): assert docker_util.volume_exists(cfg.volumes["orderly"]) assert docker_util.volume_exists(cfg.volumes["documents"]) assert docker_util.volume_exists(cfg.volumes["redis"]) - assert docker_util.container_exists("orderly_web_web") - assert docker_util.container_exists("orderly_web_orderly") - assert docker_util.container_exists("orderly_web_proxy") - assert docker_util.container_exists("orderly_web_redis") + assert docker_util.container_exists("orderly-web-web") + assert docker_util.container_exists("orderly-web-orderly") + assert docker_util.container_exists("orderly-web-proxy") + assert docker_util.container_exists("orderly-web-redis") names = [] for container in containers: names.append(container.name) - assert any(re.match(r"orderly_web_orderly_worker_\w+", name) + assert any(re.match(r"orderly-web-orderly-worker-\w+", name) for name in names) web = cfg.get_container("web") @@ -56,7 +56,7 @@ def test_start_and_stop(): assert "app.url=https://localhost" in web_config assert "auth.github_key=notarealid" in web_config assert "auth.github_secret=notarealsecret" in web_config - assert "orderly.server=http://orderly_web_orderly:8321" in web_config + assert "orderly.server=http://orderly-web-orderly:8321" in web_config # Trivial check that the proxy container works too: proxy = cfg.get_container("proxy") @@ -82,10 +82,10 @@ def test_start_and_stop(): assert not docker_util.volume_exists(cfg.volumes["orderly"]) assert not docker_util.volume_exists(cfg.volumes["documents"]) assert not docker_util.volume_exists(cfg.volumes["redis"]) - assert not docker_util.container_exists("orderly_web_web") - assert not docker_util.container_exists("orderly_web_orderly") - assert not docker_util.container_exists("orderly_web_proxy") - assert not docker_util.container_exists("orderly_web_redis") + assert not docker_util.container_exists("orderly-web-web") + assert not docker_util.container_exists("orderly-web-orderly") + assert not docker_util.container_exists("orderly-web-proxy") + assert not docker_util.container_exists("orderly-web-redis") finally: orderly_web.stop(path, kill=True, volumes=True, network=True) @@ -101,14 +101,14 @@ def test_start_with_custom_styles(): assert docker_util.network_exists(cfg.network) assert docker_util.volume_exists(cfg.volumes["css"]) - assert docker_util.container_exists("orderly_web_web") - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-web") + assert docker_util.container_exists("orderly-web-orderly") assert not docker_util.volume_exists("documents") # check that the style volume is really mounted cl = docker.client.from_env() api_client = cl.api - details = api_client.inspect_container("orderly_web_web") + details = api_client.inspect_container("orderly-web-web") assert len(details['Mounts']) == 2 css_volume = [v for v in details['Mounts'] if v['Type'] == "volume" and @@ -159,10 +159,10 @@ def test_stop_broken_orderly_web(): assert stop_failed - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-orderly") finally: orderly_web.stop(path, force=True, network=True, volumes=True) - assert not docker_util.container_exists("orderly_web_orderly") + assert not docker_util.container_exists("orderly-web-orderly") def test_stop_broken_orderly_web_with_option(): @@ -177,13 +177,13 @@ def test_stop_broken_orderly_web_with_option(): assert start_failed - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-orderly") assert docker_util.network_exists("ow_broken_test") finally: orderly_web.stop(path, force=True, network=True, volumes=True, options=options) - assert not docker_util.container_exists("orderly_web_orderly") + assert not docker_util.container_exists("orderly-web-orderly") assert not docker_util.network_exists("ow_broken_test") @@ -198,12 +198,12 @@ def test_stop_broken_orderly_web_with_extra(): start_failed = True assert start_failed - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-orderly") assert docker_util.network_exists("ow_broken_extra_test") finally: orderly_web.stop(path, force=True, network=True, volumes=True, extra=extra) - assert not docker_util.container_exists("orderly_web_orderly") + assert not docker_util.container_exists("orderly-web-orderly") assert not docker_util.network_exists("ow_broken_extra_test") @@ -216,8 +216,8 @@ def test_start_with_montagu_config(): cfg = fetch_config(path) assert docker_util.network_exists(cfg.network) - assert docker_util.container_exists("orderly_web_web") - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-web") + assert docker_util.container_exists("orderly-web-orderly") web = cfg.get_container("web") web_config = docker_util.string_from_container( @@ -296,8 +296,8 @@ def test_without_github_app_for_montagu(): assert res cfg = fetch_config(path) assert docker_util.network_exists(cfg.network) - assert docker_util.container_exists("orderly_web_web") - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-web") + assert docker_util.container_exists("orderly-web-orderly") orderly_web.stop(path, kill=True, volumes=True, network=True) @@ -440,13 +440,13 @@ def test_can_start_with_outpack(): cfg = build_config(path, options=options) try: orderly_web.start(path, options=options) - assert docker_util.container_exists("orderly_web_outpack_migrate") - assert docker_util.container_exists("orderly_web_outpack_server") + assert docker_util.container_exists("orderly-web-outpack-migrate") + assert docker_util.container_exists("orderly-web-outpack-server") assert docker_util.volume_exists("outpack_vol") web = cfg.get_container("web") web_config = docker_util.string_from_container( web, "/etc/orderly/web/config.properties").split("\n") - expected = "outpack.server=http://orderly_web_outpack_server:8000" + expected = "outpack.server=http://orderly-web-outpack-server:8000" assert expected in web_config finally: orderly_web.stop(path, kill=True, volumes=True, network=True) @@ -457,9 +457,9 @@ def test_can_start_with_packit(): cfg = build_config(path) try: orderly_web.start(path) - assert docker_util.container_exists("orderly_web_packit_db") - assert docker_util.container_exists("orderly_web_packit_api") - assert docker_util.container_exists("orderly_web_packit") + assert docker_util.container_exists("orderly-web-packit-db") + assert docker_util.container_exists("orderly-web-packit-api") + assert docker_util.container_exists("orderly-web-packit") finally: orderly_web.stop(path, kill=True, volumes=True, network=True) @@ -498,10 +498,10 @@ def test_start_and_stop_multiple_workers(): try: res = orderly_web.start(path, options=options) assert res - assert docker_util.container_exists("orderly_web_web") - assert docker_util.container_exists("orderly_web_orderly") - assert docker_util.container_exists("orderly_web_proxy") - assert docker_util.container_exists("orderly_web_redis") + assert docker_util.container_exists("orderly-web-web") + assert docker_util.container_exists("orderly-web-orderly") + assert docker_util.container_exists("orderly-web-proxy") + assert docker_util.container_exists("orderly-web-redis") cl = docker.client.from_env() containers = cl.containers.list() @@ -510,7 +510,7 @@ def test_start_and_stop_multiple_workers(): for container in containers: names.append(container.name) workers = list(filter(lambda name: re.match( - r"orderly_web_orderly_worker_\w+", name), names)) + r"orderly-web-orderly-worker-\w+", name), names)) assert len(workers) == 2 # Bring the whole lot down: @@ -526,10 +526,10 @@ def test_wait_for_redis_exists(): try: res = orderly_web.start(path) assert res - assert docker_util.container_exists("orderly_web_web") - assert docker_util.container_exists("orderly_web_orderly") - assert docker_util.container_exists("orderly_web_proxy") - assert docker_util.container_exists("orderly_web_redis") + assert docker_util.container_exists("orderly-web-web") + assert docker_util.container_exists("orderly-web-orderly") + assert docker_util.container_exists("orderly-web-proxy") + assert docker_util.container_exists("orderly-web-redis") cfg = fetch_config(path) container = cfg.get_container("redis") @@ -545,7 +545,7 @@ def test_remote_identity_set(): try: res = orderly_web.start(path) assert res - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-orderly") # Remote identity is set via env var ORDERLY_API_SERVER_IDENTITY # This matches config from orderly_config.yml which sets @@ -564,7 +564,7 @@ def test_orderly_server_not_exposed_to_host(): try: res = orderly_web.start(path) assert res - assert docker_util.container_exists("orderly_web_orderly") + assert docker_util.container_exists("orderly-web-orderly") try: json.loads(http_get("http://localhost:8321/run-metadata")) From 1f6d9a51dae8faf29b2736c1e7ab4b1f4c92eb8e Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Wed, 24 May 2023 17:32:02 +0100 Subject: [PATCH 4/9] try upgrade python on ci --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c862fd..d46cd09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: "3.10" - name: Install dependencies # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#installing-dependencies From 07aec2c8d05b38b07a06a7fdbe44dbe12cf237ac Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Thu, 25 May 2023 19:30:03 +0100 Subject: [PATCH 5/9] fix merge --- config/basic/orderly-web.yml | 6 +----- config/breaking/orderly-web.yml | 2 +- config/complete/orderly-web.yml | 2 +- config/customcss/orderly-web.yml | 2 +- config/montagu/orderly-web.yml | 2 +- config/noproxy/orderly-web.yml | 2 +- config/packit/orderly-web.yml | 2 +- config/vault/orderly-web.yml | 2 +- test/test_cli.py | 2 +- test/test_config.py | 2 +- 10 files changed, 10 insertions(+), 14 deletions(-) diff --git a/config/basic/orderly-web.yml b/config/basic/orderly-web.yml index f58099a..8080ec2 100644 --- a/config/basic/orderly-web.yml +++ b/config/basic/orderly-web.yml @@ -1,15 +1,11 @@ -<<<<<<< HEAD -## Prefix for container names; we'll use {container_prefix}-{container_name) -======= ## Prefix for container names; we'll use {container_prefix}-(orderly,web) ->>>>>>> master container_prefix: orderly-web ## The name of the docker network that containers will be attached to. ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/config/breaking/orderly-web.yml b/config/breaking/orderly-web.yml index 02b9619..2f75938 100644 --- a/config/breaking/orderly-web.yml +++ b/config/breaking/orderly-web.yml @@ -1,6 +1,6 @@ container_prefix: orderly-web -network: orderly-web-network +network: orderly_web_network volumes: orderly: orderly_web_volume diff --git a/config/complete/orderly-web.yml b/config/complete/orderly-web.yml index c9f217f..6ab9f38 100644 --- a/config/complete/orderly-web.yml +++ b/config/complete/orderly-web.yml @@ -47,7 +47,7 @@ container_prefix: orderly-web ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/config/customcss/orderly-web.yml b/config/customcss/orderly-web.yml index 8b4dd93..0d07d28 100644 --- a/config/customcss/orderly-web.yml +++ b/config/customcss/orderly-web.yml @@ -5,7 +5,7 @@ container_prefix: orderly-web ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/config/montagu/orderly-web.yml b/config/montagu/orderly-web.yml index d7caa83..bcfbf98 100644 --- a/config/montagu/orderly-web.yml +++ b/config/montagu/orderly-web.yml @@ -5,7 +5,7 @@ container_prefix: orderly-web ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/config/noproxy/orderly-web.yml b/config/noproxy/orderly-web.yml index 8b9dad3..ca3521a 100644 --- a/config/noproxy/orderly-web.yml +++ b/config/noproxy/orderly-web.yml @@ -4,7 +4,7 @@ container_prefix: orderly-web ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/config/packit/orderly-web.yml b/config/packit/orderly-web.yml index 12cf4aa..458adef 100644 --- a/config/packit/orderly-web.yml +++ b/config/packit/orderly-web.yml @@ -5,7 +5,7 @@ container_prefix: orderly-web ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/config/vault/orderly-web.yml b/config/vault/orderly-web.yml index be99ff2..21ff2dc 100644 --- a/config/vault/orderly-web.yml +++ b/config/vault/orderly-web.yml @@ -21,7 +21,7 @@ container_prefix: orderly-web ## If you want to proxy OrderlyWeb to the host, you will need to ## arrange a proxy on this network, or use dev_mode in the web section ## below. -network: orderly-web-network +network: orderly_web_network ## Names of the docker volumes to use: ## diff --git a/test/test_cli.py b/test/test_cli.py index 8b01363..62e37c3 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -14,7 +14,7 @@ def test_cli_basic_usage(): orderly_web.cli.main(["status", path]) out = f.getvalue() - assert "Network:\n - orderly-web-network: created" in out + assert "Network:\n - orderly_web_network: created" in out assert "Volumes:\n - redis (orderly_web_redis_data): created" in out assert "- web (orderly-web-web): running" in out diff --git a/test/test_config.py b/test/test_config.py index bbd3e1c..4199fbe 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -13,7 +13,7 @@ def test_example_config(): cfg = build_config("config/basic") - assert cfg.network == "orderly-web-network" + assert cfg.network == "orderly_web_network" assert cfg.volumes["orderly"] == "orderly_web_volume" assert cfg.volumes["redis"] == "orderly_web_redis_data" assert cfg.container_prefix == "orderly-web" From 38fe26c148a9c0e31477f7038a2e961c07ec4feb Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 30 May 2023 13:01:34 +0100 Subject: [PATCH 6/9] update vault proxy --- config/vault/orderly-web.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/vault/orderly-web.yml b/config/vault/orderly-web.yml index 21ff2dc..c760e2a 100644 --- a/config/vault/orderly-web.yml +++ b/config/vault/orderly-web.yml @@ -119,4 +119,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-211 + tag: mrc-4255 From f0b504712c6d2bc096183f018b833e97778f6f8b Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 30 May 2023 13:30:17 +0100 Subject: [PATCH 7/9] line length --- orderly_web/constellation.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/orderly_web/constellation.py b/orderly_web/constellation.py index ded1898..69e4bd0 100644 --- a/orderly_web/constellation.py +++ b/orderly_web/constellation.py @@ -72,7 +72,9 @@ def packit_db_container(cfg): def packit_db_configure(container, cfg): docker_util.exec_safely(container, ["wait-for-db"]) docker_util.exec_safely(container, - ["psql", "-U", "packituser", "-d", "packit", "-a", "-f", "/packit-schema/schema.sql"]) + ["psql", "-U", "packituser", "-d", + "packit", "-a", "-f", + "/packit-schema/schema.sql"]) def packit_api_container(cfg): @@ -86,9 +88,10 @@ def packit_api_configure(container, cfg): print("[web] Configuring Packit API container") outpack_container = cfg.containers["outpack-server"] packit_db_container = cfg.containers["packit-db"] + url = "jdbc:postgresql://{}-{}:5432/packit?stringtype=unspecified" opts = { - "db.url": "jdbc:postgresql://{}-{}:5432/packit?stringtype=unspecified".format(cfg.container_prefix, - packit_db_container), + "db.url": url.format(cfg.container_prefix, + packit_db_container), "db.user": "packituser", "db.password": "changeme", "outpack.server.url": "http://{}-{}:8000".format(cfg.container_prefix, @@ -354,15 +357,16 @@ def proxy_container(cfg, web, packit_api=None, packit=None): else: # this is a bit hacky, but if Packit not available, just pass # the OW address. this will just result in all proxy routes - # being mapped to OW and is easier than writing conditional logic - # in the nginx proxy scripts + # being mapped to OW and is easier than writing conditional + # logic in the nginx proxy scripts packit_api_addr = web_addr if packit is not None: packit_addr = packit.name_external(cfg.container_prefix) else: packit_addr = web_addr proxy_args = [cfg.proxy_hostname, str(cfg.proxy_port_http), - str(cfg.proxy_port_https), web_addr, packit_api_addr, packit_addr] + str(cfg.proxy_port_https), web_addr, packit_api_addr, + packit_addr] proxy_mounts = [constellation.ConstellationMount( "proxy_logs", "/var/log/nginx")] proxy_ports = [cfg.proxy_port_http, cfg.proxy_port_https] From a76e232d5d003472ba597afc431eb39019101c5e Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Tue, 30 May 2023 16:05:55 +0100 Subject: [PATCH 8/9] increment version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8bcfac6..172f53c 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ "Pillow"] setup(name="orderly_web", - version="0.2.2", + version="1.0.0", description="Deploy scripts for OrderlyWeb", long_description=long_description, classifiers=[ From 47ad6644bfb4236b6ee45ff95398b2a55d96e90f Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Tue, 6 Jun 2023 14:31:15 +0100 Subject: [PATCH 9/9] revert branch pins --- config/basic/orderly-web.yml | 2 +- config/breaking/orderly-web.yml | 2 +- config/customcss/orderly-web.yml | 2 +- config/montagu/orderly-web.yml | 2 +- config/packit/orderly-web.yml | 4 ++-- config/vault/orderly-web.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/basic/orderly-web.yml b/config/basic/orderly-web.yml index 8080ec2..0c6cff8 100644 --- a/config/basic/orderly-web.yml +++ b/config/basic/orderly-web.yml @@ -122,4 +122,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-4255 + tag: master diff --git a/config/breaking/orderly-web.yml b/config/breaking/orderly-web.yml index 2f75938..43baa67 100644 --- a/config/breaking/orderly-web.yml +++ b/config/breaking/orderly-web.yml @@ -52,4 +52,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-4255 + tag: master diff --git a/config/customcss/orderly-web.yml b/config/customcss/orderly-web.yml index 0d07d28..a22de6c 100644 --- a/config/customcss/orderly-web.yml +++ b/config/customcss/orderly-web.yml @@ -110,4 +110,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-4255 + tag: master diff --git a/config/montagu/orderly-web.yml b/config/montagu/orderly-web.yml index bcfbf98..999c3c6 100644 --- a/config/montagu/orderly-web.yml +++ b/config/montagu/orderly-web.yml @@ -115,4 +115,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-4255 + tag: master diff --git a/config/packit/orderly-web.yml b/config/packit/orderly-web.yml index 458adef..ca17a72 100644 --- a/config/packit/orderly-web.yml +++ b/config/packit/orderly-web.yml @@ -124,7 +124,7 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-4255 + tag: master outpack: repo: mrcide @@ -139,7 +139,7 @@ packit: repo: mrcide api: name: packit-api - tag: mrc-4255 + tag: master app: name: packit tag: mrc-4261 diff --git a/config/vault/orderly-web.yml b/config/vault/orderly-web.yml index c760e2a..8d386da 100644 --- a/config/vault/orderly-web.yml +++ b/config/vault/orderly-web.yml @@ -119,4 +119,4 @@ proxy: image: repo: vimc name: orderly-web-proxy - tag: mrc-4255 + tag: master