-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for to choose the mount point of the app #26
Conversation
It was also unsafe this way.
deepomatic/dmake/deepobuild.py
Outdated
@@ -223,10 +211,28 @@ class HTMLReportSerializer(YAML2PipelineSerializer): | |||
class DockerLinkSerializer(YAML2PipelineSerializer): | |||
image_name = FieldSerializer("string", example = "mongo:3.2", help_text = "Name and tag of the image to launch.") | |||
link_name = FieldSerializer("string", example = "mongo", help_text = "Link name.") | |||
deployed_options = FieldSerializer("string", default = "", example = "-v /mnt:/data", help_text = "Additional Docker options when deployed.") | |||
volumes = FieldSerializer("array", child = "string", default = [], help_text = "For the 'shell' command only. The list of volumes to mount on the link. It must be in the form ./host/path:/absolute/container/path. Host path is relative to the dmake file.") | |||
#deployed_options = FieldSerializer("string", default = "", example = "-v /mnt:/data", help_text = "Additional Docker options when deployed.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove instead of comment?
deepomatic/dmake/deepobuild.py
Outdated
variable = v[0] | ||
value = '='.join(v[1:]) | ||
env.append(variable + '=' + common.wrap_cmd(value)) | ||
env = ' '.join(env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed to cache 'source ' + self.source
result; it should not be that costly.
Furthermore, the current way is not safe: variable + '=' + common.wrap_cmd(value)
is not a valid bash serialization.
Example error:
deepomatic.dmake.common.ShellError: bash: BASH_FUNC_declare_grep_exclude_arguments%%=() { local __grep_exclude_arguments=();: command not found
bash: [[: command not found
bash: =: command not found
bash: [[: command not found
bash: =: command not found
I'll inline 'source ' + self.source
.
deepomatic/dmake/deepobuild.py
Outdated
cmd.append(delimitor) | ||
variables = dict(self.variables.items() + additional_variables.items()) | ||
for var, value in variables.items(): | ||
replaced_variables[var] = common.run_shell_command(env + ' && echo %s' % common.wrap_cmd(value)).replace('\n', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace('\n', '')
is only OK for json values, which is the use-case now.
It's hard to do better because docker run --env-file
does not support multiline values (nor Dockerfile
) (see moby/moby#12997 and moby/moby#19906).
I'll add a comment.
To do:
|
raise Exception('Unknown type: %s' % str(t)) | ||
for tt in t: | ||
if not tt in self.allowed_types: | ||
raise Exception('Unknown type: %s' % str(tt)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely spoted: it was the reminiscence of a hacky attempt for doing something, that I gave up. I forgot to undo this change as well.
if not isinstance(t, tuple): | ||
raise Exception('Unknown type: %s' % str(t)) | ||
for tt in t: | ||
if not tt in self.allowed_types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E713 test for membership should be 'not in'
Vesta services are mounted into various locations. Instead of changing all the docker-compose files, one could change the mount point (
/app
by default) in dmake.