f09bc87a441887d53b66f5292ecfd1a9836a3839,mltsp/run_in_docker_container.py,,build_model_in_docker_container,#Any#Any#Any#,174
Before Change
pickle.dump(arguments, f, protocol=2)
try:
// Instantiate Docker client
client = Client(base_url="unix://var/run/docker.sock",
version="1.14")
// Create container
cont_id = client.create_container(
"mltsp/build_model",
volumes={"/home/mltsp": ""})["Id"]
print(cont_id)
// Start container
client.start(cont_id,
binds={cfg.PROJECT_PATH: {"bind": "/home/mltsp"}})
// Wait for process to complete
client.wait(cont_id)
stdout = client.logs(container=cont_id, stdout=True)
stderr = client.logs(container=cont_id, stderr=True)
print("\n\ndocker container stdout:\n\n", str(stdout),
"\n\ndocker container stderr:\n\n", str(stderr), "\n\n")
// copy model object produced in Docker container to host
After Change
with open(function_args_path, "wb") as f:
pickle.dump(args_dict, f, protocol=2)
try:
client , cont_id = spin_up_and_run_container("mltsp/build_model",
copied_data_dir)
// copy model object produced in Docker container to host
path = "/tmp/%s_%s.pkl" % (featureset_key, model_type)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: cesium-ml/cesium
Commit Name: f09bc87a441887d53b66f5292ecfd1a9836a3839
Time: 2015-04-15
Author: a.crellinquick@gmail.com
File Name: mltsp/run_in_docker_container.py
Class Name:
Method Name: build_model_in_docker_container
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: syntax_file
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: syntax_text