This message was deleted.
# ask-for-help
s
This message was deleted.
m
This is what I sometimes get:
Copy code
bentoml list
 Tag                               Size        Creation Time        Path
 covid_risk_classifier:pjzbhhs4t…  434.57 KiB  2022-11-04 18:29:19  ~/bentoml/bentos/covid_risk_cla…
 covid_risk_classifier:o5dyi3c3g…  431.65 KiB  2022-11-02 23:53:45  ~/bentoml/bentos/covid_risk_cla…
Does the terminal size matter? After resizing the terminal window:
Copy code
bentoml list
 Tag                                     Size        Creation Time        Path
 covid_risk_classifier:pjzbhhs4tcmkax6a  434.57 KiB  2022-11-04 18:29:19  ~/bentoml/bentos/covid_risk_classifier/pjzbhhs4tcmkax6a
 covid_risk_classifier:o5dyi3c3gotjoliq  431.65 KiB  2022-11-02 23:53:45  ~/bentoml/bentos/covid_risk_classifier/o5dyi3c3gotjoliq
I wrote a
Makefile
to streamline my workflow, but this is messing everything up:
Copy code
make debug
Rule -> debug
              USER: clamytoe
           PROJECT: covid_risk
     BENTOML_MODEL: covid_risk_model\:pezox2c4tchdcgky
BENTOML_CLASSIFIER: covid_risk_classifier\:pjzbhhs4t…
      DOCKER_IMAGE: covid_risk_classifier\:o5dyi3c3gotjoliq_docker
         CONTAINER:
          MY_IMAGE: clamytoe/covid_risk_classifier\:latest
            PICKLE: xgboost_eta=0.3_max_depth=5_min_child_weight=1.bin
Same as before, after the terminal was expanded:
Copy code
make debug
Rule -> debug
              USER: clamytoe
           PROJECT: covid_risk
     BENTOML_MODEL: covid_risk_model\:pezox2c4tchdcgky
BENTOML_CLASSIFIER: covid_risk_classifier\:pjzbhhs4tcmkax6a
      DOCKER_IMAGE: covid_risk_classifier\:pjzbhhs4tcmkax6a_docker
         CONTAINER:
          MY_IMAGE: clamytoe/covid_risk_classifier\:latest
            PICKLE: xgboost_eta=0.3_max_depth=5_min_child_weight=1.bin
b
I think u can output using JSON then you can pipe it to jq
m
@Benjamin Tan thank you! That helps!
🎉 1
Not the prettiest but it works, here's the code in my `Makefile`:
Copy code
BENTOML_CLASSIFIER= $(shell bentoml list -o json | grep 'tag' | grep $(PROJECT)_classifier | head -n1 | awk -F": \"" '{print $$2}' | sed s/\",//g | sed "s/:/\\\:/g")
a
Hi Martin you can use this jq query
b list -o json | jq ".[].tag"
b
I like how you
alias b=bentoml
a
saves like 6 char 😄
m
Thanks @Aaron Pham, that’s a lot cleaner! Unfortunately I don’t have jquery installed and including it as a dependency doesn’t seem reasonable either.
a
oh this is not jquery, but https://stedolan.github.io/jq/download/
but makes sense if you don’t want to install dependency for this
m
Oh sweet, thanks for the info. I think I’ll install it on my machine for my own use though!
b
jq
is really nice
a
quick enhancement
b list -o json | jq --arg PROJECT "$PROJECT" '.[].tag? | select(contains($PROJECT))'
😄
yq version:
b list -o yaml | yq eval '.[].tag | select(contains(strenv(PROJECT)))' -
m
Is yq another utility?
a
it is the equivalent of jq for yaml
but for most usecase i feel like jq is more than sufficient
m
Cool, thanks!
Not to be out done 😈:
bentoml list -o json | grep -oP '(?<="tag": ")\w+:\w+'
harpo parrot 1
a
-P is not available on grep for macos 😢
😢 1
m
Just tested it in my Makefile and it works, so going to use it. Looks much cleaner. Thanks for pushing me to look for a better solution.
🎉 1