dotnet / crank

Benchmarking infrastructure for applications
MIT License
970 stars 103 forks source link

Copy Files to Docker #726

Closed mrsharm closed 3 months ago

mrsharm commented 4 months ago

This PR implements the functionality of copying files to a docker container. Changes required to the current implementation include to create, copy the attached files and then start rather than simply running the container.

One caveat here was that the destination path should be the folder name where the files must go rather than the path to the files themselves (CC: @sebastienros). For example:

crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/containers.benchmarks.yml --scenario json_aspnet_current --profile local --profile noload --application.options.outputFiles "./docs/development.md;app/development.md"

doesn't work as it leads to the filename as: app\development.md\development.md image

Also, quotations around the source;[destination] are necessary unlike the typical case of simply uploading a file.

NOTE: The following uploads the file to the / folder:

crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/containers.benchmarks.yml --scenario json_aspnet_current --profile local --profile noload --application.options.outputFiles ./docs/development.md.

Testing

Run from the crank folder: crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/containers.benchmarks.yml --scenario json_aspnet_current --profile local --profile noload --application.options.outputFiles "./docs/*;app/"

Copied all the md files in doc folder to the container: image

sebastienros commented 3 months ago

We'll need a comment in the docs to explain that in docker the destination path is the final destination in the container.

sebastienros commented 3 months ago

@mrsharm do you want to merge this PR or are you waiting to add some more things?

mrsharm commented 3 months ago

Thanks - sorry for the delay. Merged now.