Skip to content

Commit b3eefc7

Browse files
authored
New configuration values to disable entrypoint (#85)
1 parent d97b211 commit b3eefc7

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "riptide-lib"
7-
version = "0.9.0"
7+
version = "0.9.1"
88
description = "Tool to manage development environments for web applications using containers - Library Package"
99
readme = "README.rst"
1010
requires-python = ">=3.8"

riptide/config/document/command.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ def schema_in_service(cls):
168168
If enabled, the container uses network mode `host`. Overrides network and port settings
169169
Default: False
170170
171+
[ignore_original_entrypoint]: bool
172+
If true, Riptide will not run the original entrypoint of the OCI image, but instead run the
173+
command directly, as if no entrypoint was defined in the image.
174+
Note that engines might ignore this setting, if they don't support it.
175+
176+
Default: False
177+
171178
**Example Document:**
172179
173180
.. code-block:: yaml
@@ -185,6 +192,7 @@ def schema_in_service(cls):
185192
Optional('environment'): {str: str},
186193
Optional('read_env_file'): bool,
187194
Optional('use_host_network'): bool,
195+
Optional('ignore_original_entrypoint'): bool
188196
})
189197

190198
@classmethod
@@ -215,6 +223,9 @@ def _initialize_data_after_variables(self, data: dict) -> dict:
215223

216224
if "read_env_file" not in self:
217225
data["read_env_file"] = True
226+
227+
if "ignore_original_entrypoint" not in data:
228+
data["ignore_original_entrypoint"] = False
218229
return data
219230

220231
def get_project(self) -> 'Project':

riptide/config/document/service.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import warnings
22
from collections import OrderedDict
33

4-
from typing import List
5-
4+
from configcrunch import ConfigcrunchError
5+
from configcrunch import variable_helper
66
from dotenv import dotenv_values
77
from schema import Schema, Optional, Or
88

9-
from configcrunch import YamlConfigDocument, ConfigcrunchError
10-
from configcrunch import variable_helper
119
from riptide.config.document.common_service_command import ContainerDefinitionYamlConfigDocument
1210
from riptide.config.errors import RiptideDeprecationWarning
1311
from riptide.config.files import CONTAINER_SRC_PATH
1412
from riptide.config.service.config_files import *
1513
from riptide.config.service.logging import *
16-
1714
# todo: validate actual schema values -> better schema | ALL documents
1815
from riptide.config.service.ports import get_additional_port
1916
from riptide.config.service.volumes import process_additional_volumes
@@ -262,7 +259,6 @@ def schema(cls) -> Schema:
262259
or image default. Default is 'auto' which means the value of `run_as_current_user`
263260
will be used.
264261
265-
266262
[allow_full_memlock]: bool
267263
Whether to set memlock ulimit to -1:-1 (soft:hard).
268264
This is required for some database services, such as Elasticsearch.
@@ -274,6 +270,13 @@ def schema(cls) -> Schema:
274270
If enabled, read the environment variables in the env-files defined in the project (``env_files``).
275271
Default: True
276272
273+
[ignore_original_entrypoint]: bool
274+
If true, Riptide will not run the original entrypoint of the OCI image, but instead run the
275+
command directly, as if no entrypoint was defined in the image.
276+
Note that engines might ignore this setting, if they don't support it.
277+
278+
Default: False
279+
277280
**Example Document:**
278281
279282
.. code-block:: yaml
@@ -344,7 +347,8 @@ def schema(cls) -> Schema:
344347
Optional('config'): {
345348
str: {
346349
'from': str,
347-
'$source': str, # Path to the document that "from" references. Is added durinng loading of service
350+
'$source': str,
351+
# Path to the document that "from" references. Is added durinng loading of service
348352
'to': str,
349353
Optional('force_recreate'): bool
350354
}
@@ -383,7 +387,8 @@ def schema(cls) -> Schema:
383387
'name': str,
384388
'config': any # defined by driver
385389
},
386-
Optional('read_env_file'): bool
390+
Optional('read_env_file'): bool,
391+
Optional('ignore_original_entrypoint'): bool
387392
}
388393
)
389394

@@ -427,6 +432,9 @@ def _initialize_data_after_merge(self, data):
427432
if "read_env_file" not in data:
428433
data["read_env_file"] = True
429434

435+
if "ignore_original_entrypoint" not in data:
436+
data["ignore_original_entrypoint"] = False
437+
430438
if "additional_subdomains" not in data:
431439
data["additional_subdomains"] = []
432440

@@ -736,8 +744,10 @@ def domain(self) -> str:
736744
something: 'https://project--service.riptide.local'
737745
"""
738746
if "main" in self.internal_get("roles"):
739-
return self.get_project().internal_get("name") + "." + self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]
740-
return self.get_project().internal_get("name") + DOMAIN_PROJECT_SERVICE_SEP + self.internal_get("$name") + "." + self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]
747+
return self.get_project().internal_get("name") + "." + \
748+
self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]
749+
return self.get_project().internal_get("name") + DOMAIN_PROJECT_SERVICE_SEP + self.internal_get("$name") + "." + \
750+
self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]
741751

742752
@variable_helper
743753
def additional_domains(self) -> Dict[str, str]:
@@ -760,7 +770,9 @@ def additional_domains(self) -> Dict[str, str]:
760770
second: 'https://seccond.project--service.riptide.local'
761771
"""
762772
if "main" in self.internal_get("roles"):
763-
return {subdomain: f'{subdomain}.{self.get_project().internal_get("name")}.{self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]}'
764-
for subdomain in self.internal_get("additional_subdomains")}
765-
return {subdomain: f'{subdomain}.{self.get_project().internal_get("name")}{DOMAIN_PROJECT_SERVICE_SEP}{self.internal_get("$name")}.{self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]}'
773+
return {
774+
subdomain: f'{subdomain}.{self.get_project().internal_get("name")}.{self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]}'
766775
for subdomain in self.internal_get("additional_subdomains")}
776+
return {
777+
subdomain: f'{subdomain}.{self.get_project().internal_get("name")}{DOMAIN_PROJECT_SERVICE_SEP}{self.internal_get("$name")}.{self.parent_doc.parent_doc.parent_doc.internal_get("proxy")["url"]}'
778+
for subdomain in self.internal_get("additional_subdomains")}

0 commit comments

Comments
 (0)