You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using above bom file and module. After running iascable build it'll generate output folder with variable.yaml file.
We are passing below curl command as input parameter.
Plain CURL command:
curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool!\" }}"
Formatted command which works with Helm local install. We have to pass this command as inout value to BOM.
'''curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool\" }}"'''
We are trying to pass command as valid YAML syntax of bom file in below 2 scenario but it's failing after we run appy.sh file. Please find below steps to re-produce this error.
1. Scenario modify the variables.yaml file
Modify existing variable.yaml in the output folder by inserting the following curl command
# ubi
- name: terraform_gitops_ubi_command
value: "\'\'\'curl -X POST \"http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict\" -H \"accept: application/json\" -H \"grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock\" -H "content-type: application/json\" -d \" { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool!\" }}\"\'\'\'"
Execute iascable
Start the multipass
Inside the VM: execute apply.sh
You will not be asked for inserting the command variable
Following error appears:
parse error: Invalid numeric literal at line 1, column 68
parse error: Invalid numeric literal at line 1, column 68
parse error: Invalid numeric literal at line 1, column 68
Error: Value forenv variable 'NAME' not providedinenv()
Error: Value forenv variable 'NAME' not providedinenv()
2. Scenario not modify the variables.yaml file
Execute iascable
Start the multipass
Inside the VM execute: apply.sh
You will be asked for inserting the command variable we inserting following command:
'''curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool!\" }}"'''
Inspect the newly created variable.yaml file here we find following entry:
"'''curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict\" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { "rawDocument": { "text": "It is so easy to embed Watson NLP in application. Very cool!" }}"'''"
Starting terraform init
Passing Value :
- name: terraform_gitops_ubi_command
value: '''curl -X POST \"http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict\" -H \"accept: application/json\" -H \"grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock\" -H \"content-type: application/json\" -d \" { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool!\" }}\"'''
Result:
╷
│ Error: Missing newline after argument
│
│ on terraform.tfvars line 19:
│ 19: terraform_gitops_ubi_command = "'curl -X POST \\"http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict\\" -H \\"accept: application/json\\" -H \\"grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock\\" -H \\"content-type: application/json\\" -d \\" { \\"rawDocument\\": { \\"text\\": \\"It is so easy to embed Watson NLP in application. Very cool!\\" }}\\"'"
│
│ An argument definition must end with a newline.
Error After Terraform Init (edited)
The text was updated successfully, but these errors were encountered:
Issue: IASCABLE build apply.sh is unable to parse yaml formatted input value.
BOM File: https://github.ibm.com/isv-assets/watson-boms/blob/main/roks-new-nlp/bom.yaml#L22-L24
Module: https://github.com/cloud-native-toolkit/terraform-gitops-ubi
Variable Template: https://github.ibm.com/isv-assets/watson-boms/blob/main/roks-new-nlp/output/cluster-with-watson-nlp/variables-template.yaml#L67-L69
We are using above bom file and module. After running iascable build it'll generate output folder with
variable.yaml
file.We are passing below curl command as input parameter.
Plain CURL command:
Formatted command which works with Helm local install. We have to pass this command as inout value to BOM.
'''curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool\" }}"'''
We are trying to pass command as valid YAML syntax of bom file in below 2 scenario but it's failing after we run appy.sh file. Please find below steps to re-produce this error.
1. Scenario modify the
variables.yaml
filevariable.yaml
in the output folder by inserting the followingcurl
commandiascable
apply.sh
command
variable2. Scenario not modify the
variables.yaml
fileiascable
apply.sh
command
variable we inserting following command:'''curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { \"rawDocument\": { \"text\": \"It is so easy to embed Watson NLP in application. Very cool!\" }}"'''
variable.yaml
file here we find following entry:"'''curl -X POST "http://watson-nlp-watson-nlp:8080/v1/watson_runtime/NlpService/SyntaxPredict\" -H "accept: application/json" -H "grpc-metadata-mm-model-id: syntax_izumo_lang_en_stock" -H "content-type: application/json" -d " { "rawDocument": { "text": "It is so easy to embed Watson NLP in application. Very cool!" }}"'''"
The text was updated successfully, but these errors were encountered: