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

[WIP] Adding mount options to functions. #309

Closed
wants to merge 4 commits into from

Conversation

alshabib
Copy link

@alshabib alshabib commented Oct 17, 2017

This allows functions to mount volumes and other
directories. It uses the same configuration as is
used by docker.

Signed-off-by: Ali Al-Shabibi [email protected]

Description

This change allows functions to mount volumes just as other containers running in a docker environment can. This pull request fixes #320.

Motivation and Context

Passing large amounts of data over the http/stdin isn't very efficient and can cause bottlenecks. Instead, functions can pick up data from known locations mounted into their running container.

How Has This Been Tested?

This has been manually tested by starting openfaas, creating a function over the REST API using the following json:

{
  "service": "nodeindo",
  "network": "functions",
  "image": "functions/nodeinfo",
  "mounts": [
    {
      "type" : "volume",
      "source" : "myvol",
      "target" : "/tmp"
    }
  ]
}

The resulting container was inspected to observe the volume was received and deployed by docker with the following output:

...
Mounts": [
            {
                "Type": "volume",
                "Name": "myvol",
                "Source": "/mnt/sda1/var/lib/docker/volumes/myvol/_data",
                "Destination": "/tmp",
                "Driver": "local",
                "Mode": "z",
                "RW": true,
                "Propagation": ""
            }
        ],
...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
    While this does not require new documentation, it would certainly benefit from it. I am happy to document it, if someone points me to the right documentation to update.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This allows functions to mouunt volumes and other
directories. It uses the same configuration as is
used by docker.

Signed-off-by: Ali Al-Shabibi <[email protected]>
@alexellis
Copy link
Member

Hi, thank you for your contribution. There should be a proposal raised for PRs. Please read the contribution guide which explains that a proposal is needed before carrying out work.

@alexellis alexellis changed the title Adding mount options to functions. [No proposal] Adding mount options to functions. Oct 20, 2017
@alexellis alexellis changed the title [No proposal] Adding mount options to functions. [Invalid] Adding mount options to functions. Oct 20, 2017
This allows functions to mouunt volumes and other
directories. It uses the same configuration as is
used by docker.

Fixes openfaas#320

Signed-off-by: Ali Al-Shabibi <[email protected]>
@alshabib
Copy link
Author

I added a proposal (#320). Let me know if I missed anything else.

@alshabib alshabib changed the title [Invalid] Adding mount options to functions. Adding mount options to functions. Oct 23, 2017
@open-derek
Copy link

open-derek bot commented Oct 23, 2017

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off.
That's something we need before your Pull Request can be merged. Please see our contributing guide.

@open-derek open-derek bot added the no-dco label Oct 23, 2017
This allows functions to mount volumes and other
directories. It uses the same configuration as is
used by docker.

Signed-off-by: Ali Al-Shabibi <[email protected]>
@alexellis alexellis changed the title Adding mount options to functions. [WIP] Adding mount options to functions. Oct 23, 2017
@alexellis alexellis closed this Nov 30, 2017
@alexellis
Copy link
Member

Please see comment one the linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Adding mount options to functions.
2 participants