-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests and updates for compose generator (#86)
- Loading branch information
Showing
7 changed files
with
280 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,33 @@ | ||
--- | ||
{%- set global = global | default({}) -%} | ||
{%- set imageNamePrefix = global.imageNamePrefix | default('ghcr.io/cisco-open/') -%} | ||
{%- set imageNameSuffix = global.imageNameSuffix | default('latest') -%} | ||
{%- set serviceDefaultPort = global.serviceDefaultPort | default(80) -%} | ||
{# Ensure the variable always ends with a slash #} | ||
{%- set imageNamePrefix = imageNamePrefix if imageNamePrefix.endswith('/') else imageNamePrefix + '/' %} | ||
services: | ||
{%- if services is defined and services is mapping %} | ||
## services | ||
{%- for name, details in services.items() %} | ||
{%- for scope, scopeDetails in scopes.items() %} | ||
## {{ scope }} | ||
{%- for name, details in scopeDetails.items() %} | ||
{{ name }}: | ||
image: {{ imageNamePrefix }}app-simulator-services-{{ details.type }}:{{ imageNameSuffix }} | ||
image: {{ global.imageNamePrefix }}app-simulator-{{ scope }}-{{ details.type }}:{{global.imageNameSuffix }} | ||
{%- if details.port is defined %} | ||
ports: | ||
- "{{ details.port }}:8080" | ||
- "{{ details.port }}:{{ global.defaultPorts[scope] }}" | ||
{%- endif %} | ||
{%- if serviceDefaultPort != 8080 %} | ||
{%- if global.defaultPorts is defined -%} | ||
{%- if global.defaultPorts[scope] is defined and global.defaultPorts[scope] != global._defaultDefaultPorts[scope] %} | ||
environment: | ||
SERVICE_DEFAULT_PORT: "{{ serviceDefaultPort }}" | ||
{%- if serviceDefaultPort <= 1024 %} | ||
- {{ scope | singularize | upper }}_DEFAULT_PORT={{ global.defaultPorts[scope] }} | ||
{%- endif %} | ||
{%- if global.defaultPorts[scope] <= 1024 %} | ||
cap_add: | ||
- NET_BIND_SERVICE | ||
{%- endif %} | ||
- NET_BIND_SERVICE | ||
{%- endif %} | ||
{%- endif %} | ||
configs: | ||
- source: service_{{ name | replace("-", "_") }}_config | ||
target: /config.json | ||
{%- endfor %} | ||
{%- endif -%} | ||
{%- if databases is defined and databases is mapping %} | ||
## databases | ||
{%- for name, details in databases.items() %} | ||
{{ name }}: | ||
image: {{ imageNamePrefix }}app-simulator-databases-{{ details.type }}:{{ imageNameSuffix }} | ||
configs: | ||
- source: database_{{ name | replace("-", "_") }}_config | ||
target: /config.json | ||
{%- endfor %} | ||
{%- endif -%} | ||
{%- if loaders is defined and loaders is mapping %} | ||
## loaders | ||
{%- for name, details in loaders.items() %} | ||
{{ name }}: | ||
image: {{ imageNamePrefix }}app-simulator-loaders-{{ details.type }}:{{ imageNameSuffix }} | ||
configs: | ||
- source: loader_{{ name | replace("-", "_") }}_config | ||
- source: {{ scope }}_{{ name | replace("-", "_") | lower }}_config | ||
target: /config.json | ||
{%- endfor %} | ||
{%- endif %} | ||
{%- endfor %} | ||
configs: | ||
{%- if services is defined and services is mapping %} | ||
{%- for name, details in services.items() %} | ||
service_{{ name | replace("-", "_") }}_config: | ||
content: | | ||
{{ details | tojson }} | ||
{%- endfor -%} | ||
{%- endif %} | ||
{%- if databases is defined and databases is mapping %} | ||
{%- for name, details in databases.items() %} | ||
database_{{ name | replace("-", "_") }}_config: | ||
content: | | ||
{{ details | tojson }} | ||
{%- endfor -%} | ||
{%- endif %} | ||
{%- if loaders is defined and loaders is mapping %} | ||
{%- for name, details in loaders.items() %} | ||
loader_{{ name | replace("-", "_") }}_config: | ||
{%- for scope, scopeDetails in scopes.items() %} | ||
{%- for name, details in scopeDetails.items() %} | ||
{{ scope }}_{{ name | replace("-", "_") | lower }}_config: | ||
content: | | ||
{{ details | tojson }} | ||
{%- endfor -%} | ||
{%- endif %} | ||
{%- endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
deepmerge==2.0 | ||
inflect==7.5.0 | ||
Jinja2==3.1.4 | ||
opentelemetry-api==1.29.0 | ||
opentelemetry-sdk==1.29.0 | ||
PyYAML==6.0.2 | ||
pytest==8.3.4 |
Empty file.
Oops, something went wrong.