diff --git a/ix-dev/stable/ix-app/app.yaml b/ix-dev/stable/ix-app/app.yaml index 36c5ea90df..4dd3c57611 100644 --- a/ix-dev/stable/ix-app/app.yaml +++ b/ix-dev/stable/ix-app/app.yaml @@ -1,3 +1,5 @@ +annotations: + min_scale_version: '25.04' app_version: 1.0.0 capabilities: [] categories: @@ -19,4 +21,4 @@ screenshots: [] sources: [] title: iX App train: stable -version: 1.1.9 +version: 1.2.0 diff --git a/ix-dev/stable/ix-app/migrations.yaml b/ix-dev/stable/ix-app/migrations.yaml new file mode 100644 index 0000000000..ab3c445b0c --- /dev/null +++ b/ix-dev/stable/ix-app/migrations.yaml @@ -0,0 +1,4 @@ +migrations: + - file: ip_port_migration + target: + min_version: 1.2.0 diff --git a/ix-dev/stable/ix-app/migrations/ip_port_migration b/ix-dev/stable/ix-app/migrations/ip_port_migration new file mode 100755 index 0000000000..585633d2a6 --- /dev/null +++ b/ix-dev/stable/ix-app/migrations/ip_port_migration @@ -0,0 +1,32 @@ +#!/usr/bin/python3 + +import os +import sys +import yaml + + +def migrate(values): + new_ports = [] + for port in values.get("ports", []): + new_ports.append( + { + "bind_mode": "published", + "port_number": port["published"], + "container_port": port["target"], + "protocol": port["protocol"], + "host_ips": [], + } + ) + + values["ports"] = new_ports + + return values + + +if __name__ == "__main__": + if len(sys.argv) != 2: + exit(1) + + if os.path.exists(sys.argv[1]): + with open(sys.argv[1], "r") as f: + print(yaml.dump(migrate(yaml.safe_load(f.read())))) diff --git a/ix-dev/stable/ix-app/questions.yaml b/ix-dev/stable/ix-app/questions.yaml index 4fed9e2752..a5eca698f7 100644 --- a/ix-dev/stable/ix-app/questions.yaml +++ b/ix-dev/stable/ix-app/questions.yaml @@ -262,32 +262,61 @@ questions: schema: type: dict attrs: - - variable: target - label: Container Port + - variable: bind_mode + label: Port Bind Mode + description: | + The port bind mode.
+ - Publish: The port will be published on the host for external access.
+ - Expose: The port will be exposed for inter-container communication.
+ schema: + type: string + default: "published" + enum: + - value: "published" + description: Publish port on the host for external access + - value: "exposed" + description: Expose port for inter-container communication + - variable: port_number + label: Host Port schema: type: int required: true - min: 1 - max: 65535 - - variable: published - label: Host Port + $ref: + - definitions/port + - variable: container_port + label: Container Port schema: type: int - default: 15000 + min: 1 + max: 65535 required: true $ref: - - "definitions/port" + - definitions/port - variable: protocol label: Protocol schema: type: string - default: tcp required: true + default: "tcp" enum: - - value: tcp + - value: "tcp" description: TCP - - value: udp + - value: "udp" description: UDP + - variable: host_ips + label: Host IPs + description: IPs on the host to bind this port + schema: + type: list + default: [] + items: + - variable: host_ip + label: Host IP + schema: + type: string + required: true + $ref: + - definitions/node_bind_ip - variable: dns_config label: Custom DNS Setup diff --git a/ix-dev/stable/ix-app/templates/docker-compose.yaml b/ix-dev/stable/ix-app/templates/docker-compose.yaml index 64483ff5e6..eca73118c2 100644 --- a/ix-dev/stable/ix-app/templates/docker-compose.yaml +++ b/ix-dev/stable/ix-app/templates/docker-compose.yaml @@ -63,7 +63,7 @@ {% do c1.set_network_mode("host") %} {% else %} {% for port in values.ports %} - {% do c1.ports.add_port(port.published, port.target, {"protocol": port.protocol}) %} + {% do c1.add_port(port) %} {% endfor %} {% endif %}