modelfoxdotdev / modelfox

ModelFox makes it easy to train, deploy, and monitor machine learning models.
Other
1.46k stars 63 forks source link

Support piping training data through stdin #59

Closed comunidadio closed 2 years ago

comunidadio commented 2 years ago
$ cat heart_disease.csv | tangram train --target diagnosis
error: panicked at 'internal error: entered unreachable code', crates/core/train.rs:85:18
   0: backtrace::capture::Backtrace::new
   1: tangram::train::train::{{closure}}
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::begin_panic_handler::{{closure}}
   4: std::sys_common::backtrace::__rust_end_short_backtrace
   5: _rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::panicking::panic
   8: tangram_core::train::Trainer::prepare
   9: tangram::main
  10: std::sys_common::backtrace::__rust_begin_short_backtrace
  11: _main

Not sure this is actually supported, but since stdin works for "tangram predict" it would be less surprising to support stdin for train as well.

Also allows training integration in other software without having to write temporary CSV file to disk or passing compressed CSV directly (gunzip heart_disease.csv.gz | tangram train --target diagnosis) or transform CSV on the fly (eg. https://github.com/tangramdotdev/tangram/issues/35#issuecomment-913948443)

nitsky commented 2 years ago

Hi @comunidadio thanks for opening this issue. At the moment we do not support piping training data with stdin. I jumped to the line in the code and found an unreachable!() there. As a first pass, I have improved the error message. I will leave this issue open until we implement support for piping training data with stdin.

comunidadio commented 2 years ago

Thanks @nitsky. Renaming the issue accordingly

deciduously commented 2 years ago

Hi @comunidadio - this feature is implemented on the main branch. You need to pass the --stdin flag, as well as provide an output file name, as there's no input file to infer it from:

$ cat heart_disease.csv | tangram train --target diagnosis --stdin --output stdin_heart_disease.tangram
comunidadio commented 2 years ago

That's great. Thank you very much!

Sadly having issues trying to build from main branch (first time building a rust binary so not sure what am I doing wrong), hopefully will be in a release or point release soon 😆

nitsky commented 2 years ago

@comunidadio can you paste the error message here?

comunidadio commented 2 years ago

with "cargo build --release": error: failed to run custom build command fortangram_www v0.0.0 (/Users/c/dev/stack/tangram/crates/www) with just "cargo build":

  = note: Undefined symbols for architecture x86_64:
            "_PyLong_FromUnsignedLongLong", referenced from:
                pyo3::types::num::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$u64$GT$::into_py::h5c784c777a2e8f49 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.9.rcgu.o)
            "_PyNumber_Index", referenced from:
                pyo3::types::num::_$LT$impl$u20$pyo3..conversion..FromPyObject$u20$for$u20$u8$GT$::extract::h04feafce37dd9c1d in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.9.rcgu.o)
            "_PyObject_Str", referenced from:
                pyo3::types::any::PyAny::str::hb99066e9a49c1dab in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyFloat_FromDouble", referenced from:
                pyo3::types::floatob::PyFloat::new::h35286d7d780669a4 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyObject_Repr", referenced from:
                pyo3::types::any::PyAny::repr::hbf8ae690997df593 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyObject_SetAttr", referenced from:
                pyo3::types::any::PyAny::setattr::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h95586c56131e79ed in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
                pyo3::types::any::PyAny::setattr::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hac4ccaa19a4843ba in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyLong_AsLong", referenced from:
                pyo3::types::num::_$LT$impl$u20$pyo3..conversion..FromPyObject$u20$for$u20$u8$GT$::extract::h04feafce37dd9c1d in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.9.rcgu.o)
            "_PyObject_GetAttr", referenced from:
                pyo3::types::any::PyAny::getattr::_$u7b$$u7b$closure$u7d$$u7d$::h63a41307082493e3 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyExc_ConnectionRefusedError", referenced from:
                _$LT$pyo3..exceptions..PyConnectionRefusedError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::hd4e3d133b8e75d69 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_ConnectionAbortedError", referenced from:
                _$LT$pyo3..exceptions..PyConnectionAbortedError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h2355cb23348ec254 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_BrokenPipeError", referenced from:
                _$LT$pyo3..exceptions..PyBrokenPipeError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h6ab17ad915bb5f33 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_BlockingIOError", referenced from:
                _$LT$pyo3..exceptions..PyBlockingIOError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h3578bd2ca14d0e1b in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_ValueError", referenced from:
                _$LT$pyo3..exceptions..PyValueError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h27de34922262f5d4 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_FileNotFoundError", referenced from:
                _$LT$pyo3..exceptions..PyFileNotFoundError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::hf5c86efe98ff1ba2 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_SystemError", referenced from:
                _$LT$pyo3..exceptions..PySystemError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h53a254a04af3c6ff in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_OverflowError", referenced from:
                _$LT$pyo3..exceptions..PyOverflowError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h9d33a15880348ede in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_OSError", referenced from:
                _$LT$pyo3..exceptions..PyOSError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h267e317259b0cd12 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_AttributeError", referenced from:
                _$LT$pyo3..exceptions..PyAttributeError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h43fe835fcf57dff7 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyExc_BaseException", referenced from:
                _$LT$pyo3..exceptions..PyBaseException$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h2548ae5397559455 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyErr_Print", referenced from:
                pyo3::err::panic_after_error::h1116d26b635ae38c in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyErr_PrintEx", referenced from:
                pyo3::err::PyErr::print::hb6c79f3282a1cce4 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyExc_RuntimeError", referenced from:
                _$LT$pyo3..exceptions..PyRuntimeError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::ha617fe5c95fd38c0 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyEval_ThreadsInitialized", referenced from:
                pyo3::gil::GILGuard::acquire::_$u7b$$u7b$closure$u7d$$u7d$::h9943f8e311f73cb1 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyErr_Occurred", referenced from:
                pyo3::err::PyErr::occurred::h9830cb770c8a69b5 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyBaseObject_Type", referenced from:
                _$LT$pyo3..types..any..PyAny$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::h8a98bd6fd30a491d in tangram_python.24sghxibd3albr2.rcgu.o
                _$LT$pyo3..pycell..PyCellBase$LT$U$GT$$u20$as$u20$pyo3..pycell..PyCellLayout$LT$T$GT$$GT$::tp_dealloc::h8a4c804dfeb10a6c in tangram_python.252gkdfakwcezkj9.rcgu.o
                _$LT$pyo3..pyclass_init..PyNativeTypeInitializer$LT$T$GT$$u20$as$u20$pyo3..pyclass_init..PyObjectInit$LT$T$GT$$GT$::into_new_object::h9eab3f964088bdcb in tangram_python.4aparfd8124upn5b.rcgu.o
            "_PyImport_Import", referenced from:
                pyo3::types::module::PyModule::import::hda366db0f2ced713 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.13.rcgu.o)
            "_PySequence_Check", referenced from:
                _$LT$pyo3..types..sequence..PySequence$u20$as$u20$pyo3..conversion..PyTryFrom$GT$::try_from::he86c2cfede2c1e8b in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.8.rcgu.o)
            "_PyList_Append", referenced from:
                pyo3::types::list::PyList::append::_$u7b$$u7b$closure$u7d$$u7d$::hfb8936905d133e1e in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyUnicode_FromStringAndSize", referenced from:
                pyo3::types::string::PyString::new::he0ce39a2c420cfb2 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.8.rcgu.o)
            "_PyImport_AddModule", referenced from:
                pyo3::python::Python::run_code::hcc46486a5e422c59 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyGILState_Release", referenced from:
                _$LT$pyo3..gil..GILGuard$u20$as$u20$core..ops..drop..Drop$GT$::drop::h850dfe284c3a87d7 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyGILState_Ensure", referenced from:
                pyo3::gil::GILGuard::acquire_unchecked::h5899e2f7d51504ae in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyDict_New", referenced from:
                pyo3::types::dict::PyDict::new::h953cf7d73c348d8c in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_Py_CompileString", referenced from:
                pyo3::python::Python::run_code::hcc46486a5e422c59 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_Py_IsInitialized", referenced from:
                pyo3::gil::GILGuard::acquire::_$u7b$$u7b$closure$u7d$$u7d$::h9943f8e311f73cb1 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyTuple_GetItem", referenced from:
                pyo3::types::tuple::PyTuple::get_item::h405c600c5abab5b0 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.14.rcgu.o)
            "_PyExc_ConnectionResetError", referenced from:
                _$LT$pyo3..exceptions..PyConnectionResetError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::hfe6ce245e937876d in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyTuple_Size", referenced from:
                pyo3::types::tuple::PyTuple::len::h9777b46688da2be6 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.14.rcgu.o)
            "_PyType_GetFlags", referenced from:
                pyo3::ffi::object::PyType_HasFeature::hd0973a31645390cb in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PySequence_Size", referenced from:
                pyo3::types::sequence::PySequence::len::h3f2406340ea6c568 in tangram_python.2itxr8vm196ocrbq.rcgu.o
            "_PyObject_GetItem", referenced from:
                pyo3::types::any::PyAny::get_item::_$u7b$$u7b$closure$u7d$$u7d$::h373b89947831bfad in tangram_python.zvibp762ydk5ehv.rcgu.o
                pyo3::types::any::PyAny::get_item::_$u7b$$u7b$closure$u7d$$u7d$::h5beb951cf5c72688 in tangram_python.zvibp762ydk5ehv.rcgu.o
                pyo3::types::any::PyAny::get_item::_$u7b$$u7b$closure$u7d$$u7d$::h94adf2e688dc6196 in tangram_python.zvibp762ydk5ehv.rcgu.o
            "_PyModule_Create2", referenced from:
                pyo3::ffi::modsupport::PyModule_Create::h5f916b271be4cd23 in tangram_python.4xc43i4tagf74yac.rcgu.o
            "_PyErr_Fetch", referenced from:
                pyo3::err::PyErr::fetch::h6e1def4d7a34e87f in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyUnicode_AsUTF8String", referenced from:
                pyo3::types::string::PyString::to_str::hf1ce96ed68d2a8e3 in tangram_python.490x792t9s5aevvd.rcgu.o
                pyo3::types::string::PyString::to_str::h4ad0cf2396a931ba in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.8.rcgu.o)
            "_PyBytes_AsString", referenced from:
                pyo3::types::bytes::PyBytes::as_bytes::h0bb0f73451acfa5c in tangram_python.27tp0hkn015agkr3.rcgu.o
                pyo3::types::bytes::PyBytes::as_bytes::hcc50abd48c7a2df8 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.5.rcgu.o)
            "_PyErr_Restore", referenced from:
                pyo3::err::PyErr::restore::heb6d579033e3981d in tangram_python.53f1dmfgjgn4a0zp.rcgu.o
                pyo3::err::PyErr::restore::hacfd4c82cb4c8636 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyIter_Next", referenced from:
                _$LT$$RF$pyo3..types..iterator..PyIterator$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h2681858c42164ff4 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "__Py_Dealloc", referenced from:
                pyo3::ffi::object::Py_DECREF::h8dcc674e80aa5eb6 in tangram_python.1qxwhqktk1xippab.rcgu.o
                pyo3::ffi::object::Py_DECREF::h56934a1ecd445aba in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyBytes_Size", referenced from:
                pyo3::types::bytes::PyBytes::as_bytes::h0bb0f73451acfa5c in tangram_python.27tp0hkn015agkr3.rcgu.o
                pyo3::types::bytes::PyBytes::as_bytes::hcc50abd48c7a2df8 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.5.rcgu.o)
            "_PyType_GenericAlloc", referenced from:
                _$LT$pyo3..pyclass_init..PyNativeTypeInitializer$LT$T$GT$$u20$as$u20$pyo3..pyclass_init..PyObjectInit$LT$T$GT$$GT$::into_new_object::h9eab3f964088bdcb in tangram_python.4aparfd8124upn5b.rcgu.o
            "_PyUnicode_AsEncodedString", referenced from:
                pyo3::types::string::PyString::to_string_lossy::h02fef581587a404e in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.8.rcgu.o)
            "_PyExc_TimeoutError", referenced from:
                _$LT$pyo3..exceptions..PyTimeoutError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::hdf3b7c45f4648fc4 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyDict_SetItem", referenced from:
                pyo3::types::dict::PyDict::set_item::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h8e190f77452441b5 in tangram_python.2uvl99t2rtg693q3.rcgu.o
                pyo3::types::dict::PyDict::set_item::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hce7418405135f8fa in tangram_python.2uvl99t2rtg693q3.rcgu.o
            "_PyExc_TypeError", referenced from:
                _$LT$pyo3..exceptions..PyTypeError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::hb546fb7e7b6ead59 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyErr_NewException", referenced from:
                pyo3::err::PyErr::new_type::h184fe897bcfe2af1 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "__Py_TrueStruct", referenced from:
                pyo3::ffi::boolobject::Py_True::hcb8b76715f773fb9 in tangram_python.49vduc2lfm9a1w8j.rcgu.o
                pyo3::ffi::boolobject::Py_True::h056e3f086f7075b2 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.14.rcgu.o)
            "_PyModule_GetDict", referenced from:
                pyo3::python::Python::run_code::_$u7b$$u7b$closure$u7d$$u7d$::hcd6945508a9e6d3d in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyList_New", referenced from:
                pyo3::types::list::new_from_iter::h0dbc16e7322bef1e in tangram_python.2lqpkbze2zrtwfsy.rcgu.o
                pyo3::types::list::new_from_iter::h86409fecc8cc1831 in tangram_python.2lqpkbze2zrtwfsy.rcgu.o
                pyo3::types::list::new_from_iter::hc7229805ec71f2f9 in tangram_python.2lqpkbze2zrtwfsy.rcgu.o
                pyo3::types::list::PyList::empty::h82926fb68573cbc0 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyType_GetSlot", referenced from:
                pyo3::type_object::get_tp_free::h3c237c1b05002569 in tangram_python.3q1yq6jzzrvjov06.rcgu.o
                pyo3::type_object::get_tp_alloc::hd3dd242b2e6dd00b in tangram_python.3q1yq6jzzrvjov06.rcgu.o
            "_PyErr_NormalizeException", referenced from:
                pyo3::err::PyErr::normalized::h7d9a9add5a9f2718 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "_PyTuple_New", referenced from:
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..ToPyObject$u20$for$u20$$LP$T0$C$T1$C$T2$RP$$GT$::to_object::h63a11cc92867e607 in tangram_python.1tl0fa3qul40nd3i.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..ToPyObject$u20$for$u20$$LP$T0$C$T1$C$T2$C$T3$C$T4$C$T5$RP$$GT$::to_object::h392a7be9ef4c35ae in tangram_python.1tl0fa3qul40nd3i.rcgu.o
                pyo3::types::tuple::PyTuple::new::h470b4ddb5e49cc7b in tangram_python.2c3m4ukimmpfnd8n.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..ToPyObject$u20$for$u20$$LP$T0$C$T1$RP$$GT$::to_object::h6c3bb41c4583c85a in tangram_python.zvibp762ydk5ehv.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$$RP$$GT$::into_py::hae5a219bfb129ede in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.14.rcgu.o)
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$$RP$$GT$::into_py::h7dbd5fdff22237f9 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.4.rcgu.o)
            "_PyFloat_AsDouble", referenced from:
                pyo3::types::floatob::_$LT$impl$u20$pyo3..conversion..FromPyObject$u20$for$u20$f64$GT$::extract::hebd5600a957bbeb3 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyList_SetItem", referenced from:
                pyo3::types::list::new_from_iter::h0dbc16e7322bef1e in tangram_python.2lqpkbze2zrtwfsy.rcgu.o
                pyo3::types::list::new_from_iter::h86409fecc8cc1831 in tangram_python.2lqpkbze2zrtwfsy.rcgu.o
                pyo3::types::list::new_from_iter::hc7229805ec71f2f9 in tangram_python.2lqpkbze2zrtwfsy.rcgu.o
            "_PyExc_InterruptedError", referenced from:
                _$LT$pyo3..exceptions..PyInterruptedError$u20$as$u20$pyo3..type_object..PyTypeInfo$GT$::type_object_raw::he0f06f5359ea503c in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.1.rcgu.o)
            "_PyType_FromSpec", referenced from:
                pyo3::pyclass::create_type_object::h0875fbe418d68068 in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                pyo3::pyclass::create_type_object::h261431ce5aee42c6 in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                pyo3::pyclass::create_type_object::h46afe820481ebfa6 in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                pyo3::pyclass::create_type_object::h616526ba8cf8ac30 in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                pyo3::pyclass::create_type_object::h6ae35e224dc7411b in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                pyo3::pyclass::create_type_object::h7da1fa3e5a99b00f in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                pyo3::pyclass::create_type_object::h8607eae4759e69ae in tangram_python.110mtyfaqhtuzyoi.rcgu.o
                ...
            "__Py_FalseStruct", referenced from:
                pyo3::ffi::boolobject::Py_False::hd03c03e29aeae6a0 in tangram_python.49vduc2lfm9a1w8j.rcgu.o
            "_PyType_IsSubtype", referenced from:
                pyo3::ffi::object::PyObject_TypeCheck::hf5c6db8e9586d7dd in tangram_python.1qxwhqktk1xippab.rcgu.o
            "_PyObject_GetIter", referenced from:
                pyo3::types::iterator::PyIterator::from_object::hfb5d87eb2f750ec5 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyDict_Next", referenced from:
                _$LT$pyo3..types..dict..PyDictIterator$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h7086dd48df8f6799 in tangram_python.4tbk8yq1phyr84bs.rcgu.o
            "_PyObject_SetAttrString", referenced from:
                pyo3::type_object::initialize_tp_dict::h4012e92ceb27b419 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.3.rcgu.o)
            "_PyBool_Type", referenced from:
                pyo3::ffi::boolobject::PyBool_Check::h12ea27aa421508e2 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.14.rcgu.o)
            "_PyEval_EvalCode", referenced from:
                pyo3::python::Python::run_code::hcc46486a5e422c59 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.2.rcgu.o)
            "_PyTuple_SetItem", referenced from:
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..ToPyObject$u20$for$u20$$LP$T0$C$T1$C$T2$RP$$GT$::to_object::h63a11cc92867e607 in tangram_python.1tl0fa3qul40nd3i.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..ToPyObject$u20$for$u20$$LP$T0$C$T1$C$T2$C$T3$C$T4$C$T5$RP$$GT$::to_object::h392a7be9ef4c35ae in tangram_python.1tl0fa3qul40nd3i.rcgu.o
                pyo3::types::tuple::PyTuple::new::h470b4ddb5e49cc7b in tangram_python.2c3m4ukimmpfnd8n.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..ToPyObject$u20$for$u20$$LP$T0$C$T1$RP$$GT$::to_object::h6c3bb41c4583c85a in tangram_python.zvibp762ydk5ehv.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$$RP$$GT$::into_py::hae5a219bfb129ede in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.14.rcgu.o)
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$$RP$$GT$::into_py::h7dbd5fdff22237f9 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.4.rcgu.o)
            "_PyErr_GivenExceptionMatches", referenced from:
                pyo3::err::PyErr::is_instance::hac5e5e610c6fc6ce in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
            "__Py_NoneStruct", referenced from:
                pyo3::ffi::object::Py_None::hd1957b1a12ecc072 in tangram_python.1qxwhqktk1xippab.rcgu.o
                pyo3::ffi::object::Py_None::hd7417889533e9b40 in libpyo3-806836c05471869a.rlib(pyo3-806836c05471869a.pyo3.99774691-cgu.6.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `tangram_python` due to previous error
nitsky commented 2 years ago

@comunidadio You should be successful building just the CLI with cargo build --release -p tangram_cli. The CLI will then be at target/release/tangram. You can also just run cargo run --release to build and run the CLI.

The compile error you ran into is caused by one of our depdencies (pyo3) not finding an appropriate python installation on your system. However, this is unnecessary for our needs so I just pushed a change disabling it. cargo build --release should work correctly now as well, even though it builds more of tangram than you need.

comunidadio commented 2 years ago

Some progress but fails a bit later now (same error both --release -p tangram_cli or just --release):

$ cargo build --release -p tangram_cli

error: failed to run custom build command for `tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app)`

Caused by:
  process didn't exit successfully: `/Users/c/dev/stack/tangram/target/release/build/tangram_app-3461ad5d0d8fc4fa/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=../../Cargo.lock
  cargo:rerun-if-changed=../

  --- stderr
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_model_index_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_new_model_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_playground_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_production_class_metrics_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_production_metrics_index_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_production_prediction_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_production_stats_column_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_production_stats_index_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_training_class_metrics_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_training_metrics_precision_recall_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_training_metrics_roc_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_training_stats_column_client` which is missing a lib target
  warning: tangram_app v0.0.0 (/Users/c/dev/stack/tangram/crates/app) ignoring invalid dependency `tangram_app_tuning_client` which is missing a lib target
     Compiling wasm-bindgen v0.2.78
     Compiling cfg-if v1.0.0
     Compiling itoa v0.4.8
     Compiling futures-core v0.3.17
  error[E0463]: can't find crate for `core`
    |
    = note: the `wasm32-unknown-unknown` target may not be installed
    = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

  For more information about this error, try `rustc --explain E0463`.
  error: could not compile `cfg-if` due to previous error
  warning: build failed, waiting for other jobs to finish...
  error[E0463]: can't find crate for `std`
    |
    = note: the `wasm32-unknown-unknown` target may not be installed
    = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

  error: build failed
  Error: cargo exit status: 101
nitsky commented 2 years ago

You can resolve this build error by installing the wasm32-unknown-unknown target. Assuming you installed Rust with rustup, you can run rustup target add wasm32-unknown-unknown then try building again.

comunidadio commented 2 years ago

@nitsky Thanks a lot for handholding a Rust noob like myself. Homebrew install didn't have rustup included, reinstalled from rust-lang.org and it builds fine now!