Content-Length: 419220 | pFad | http://github.com/Deepomatic/dmake/pull/26

EE Add support for to choose the mount point of the app by vdel · Pull Request #26 · Deepomatic/dmake · GitHub
Skip to content
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

Merged
merged 24 commits into from
Sep 14, 2017
Merged

Conversation

vdel
Copy link
Contributor

@vdel vdel commented Aug 31, 2017

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.

@@ -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.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove instead of comment?

variable = v[0]
value = '='.join(v[1:])
env.append(variable + '=' + common.wrap_cmd(value))
env = ' '.join(env)
Copy link
Contributor

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.

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', '')
Copy link
Contributor

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.

@thomas-riccardi
Copy link
Contributor

thomas-riccardi commented Sep 13, 2017

To do:

  • test shell, build, run
  • test aws deployment
  • review by Vincent of my additional changes

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))
Copy link
Contributor

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 ?

Copy link
Contributor Author

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:
Copy link
Contributor

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'

@vdel vdel merged commit 1d7b3b2 into master Sep 14, 2017
@thomas-riccardi thomas-riccardi deleted the mount_point branch September 14, 2017 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Deepomatic/dmake/pull/26

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy