ef24b500a80a7536beedcc63529a1999101a4ac4,mltsp/run_in_docker_container.py,,build_model_in_docker_container,#Any#Any#Any#,171

Before Change


        // stdout = client.logs(container=cont_id, stdout=True)
        // stderr = client.logs(container=cont_id, stderr=True)
        // run the docker container
        cmd = ["docker", "run",
                "-v", "%s:/home/mltsp" % cfg.PROJECT_PATH,
                "-v", "%s:%s" % (cfg.FEATURES_FOLDER, "/Data/features"),
                "-v", "%s:%s" % (cfg.UPLOAD_FOLDER, "/Data/flask_uploads"),
                "-v", "%s:%s" % (cfg.MODELS_FOLDER, "/Data/models"),
                "--name=%s" % container_name,
                "mltsp/build_model"]
        process = Popen(cmd, stdout=PIPE, stderr=PIPE)
        stdout, stderr = process.communicate()
        print("\n\ndocker container stdout:\n\n", str(stdout),
              "\n\ndocker container stderr:\n\n", str(stderr), "\n\n")

        // copy all necessary files produced in Docker container to host

After Change


            volumes={"/home/mltsp": "", "/Data": ""})["Id"]
        print(cont_id)
        // Start container
        client.start(cont_id,
                     binds={cfg.PROJECT_PATH: {"bind": "/home/mltsp"},
                            cfg.DATA_PATH: {"bind": "/Data"}})
        // 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
        path = "/tmp/%s_%s.pkl" % (featureset_key, model_type)
        print(cont_id)
        docker_copy(client, cont_id, path, target=cfg.MODELS_FOLDER)
        print(os.path.join(cfg.MODELS_FOLDER,
                           "%s_%s.pkl" % (featureset_key, model_type)),
              "copied to host machine.")
        print("Process complete.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 17

Instances


Project Name: cesium-ml/cesium
Commit Name: ef24b500a80a7536beedcc63529a1999101a4ac4
Time: 2015-02-27
Author: a.crellinquick@gmail.com
File Name: mltsp/run_in_docker_container.py
Class Name:
Method Name: build_model_in_docker_container


Project Name: cesium-ml/cesium
Commit Name: 5d6747f7a58c6cd088b70adbecfce05e9b8ca4f3
Time: 2015-02-24
Author: a.crellinquick@gmail.com
File Name: mltsp/run_in_docker_container.py
Class Name:
Method Name: featurize_in_docker_container


Project Name: cesium-ml/cesium
Commit Name: dd4ebd98a0026f626242f30cf9688d61b4798af1
Time: 2015-02-27
Author: a.crellinquick@gmail.com
File Name: mltsp/custom_feature_tools.py
Class Name:
Method Name: extract_feats_in_docker_container


Project Name: cesium-ml/cesium
Commit Name: ef24b500a80a7536beedcc63529a1999101a4ac4
Time: 2015-02-27
Author: a.crellinquick@gmail.com
File Name: mltsp/run_in_docker_container.py
Class Name:
Method Name: build_model_in_docker_container