Closed wagoodman closed 6 years ago
Needs a rebase since I merged your other PR...
@brendandburns : rebased. Do you have any opinions around providing a list of files via a list of rich objects (implemented in the PR) or by instead a simple dictionary (example given in the description)?
I think that nested is great actually, it looks more expressive to me.
Once this is fully ready and working, I'd be ok to merge.
Thanks! --brendan
Just to double check, @brendandburns, by "nested" do you mean the alternative example above:
@Containerize(
package={
'name': 'file-example',
'repository': 'docker.io/brendanburns',
'publish': False,
'additionalFiles': {
'./data.json': '/some/container/path',
'./get_data.sh': '/another/container/path',
}
}
)
or do you mean what's implemented in this PR? e.g.:
@Containerize(
package={
'name': 'file-example',
'repository': 'docker.io/brendanburns',
'publish': False,
'additionalFiles': [
PackageFile(src='./data.json', dest= '/some/container/path', mode='0400'),
PackageFile(src='./get_data.sh', dest='/another/container/path'),
]
}
)
Here's a rough cut at issue #2... once there is general agreement on this approach, I'll fill in some tests and start filling this out for other languages.
This example isn't working yet since the metaparticle lib within the container is unaware of the new functionality (specifically, the
PackageFile
is seen as a bad import)... otherwise this example appears to be working.I decided to go with an class over a simple dictionary of
{ dest: src}
because now it isHowever, I think it would be a good time to discuss having mixed objects in the
Containerize
definition or to instead always use dict/list primitives when possible... e.g. something like this instead: