0

I am trying to run an container using YAML file and command to run the image is:

command: [
   "/bin/bash",
   "-c",
   "python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000000000000000000111111111110 --label Axis Test --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxxxxx\",\"password\":\"xxxxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxxxxx\"}"",
]

I am getting this error

Error while parsing yaml file:

while parsing a flow sequence in "axis.yaml", line 9, column 16 expected ',' or ']', but got '{' in "axis.yaml", line 12, column 331

screenshot of yaml file wallet-storage-config need to passed in double quotes other wise it show error while running the image as it Expecting property name enclosed in double quotes. If i replace the double quotes with single quotes in command than the container is failing with no logs

command: [
   '/bin/bash',
   '-c',
   'python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000test00000000000111111111110 --label Axis Test --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxxxxx\",\"password\":\"xxxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxxx\"}"',
]
api-version: 2019-12-01
location: eastus
name: testcontainer
properties:
  containers:
  - name: ariesagent
    properties:
      image: bcgovimages/aries-cloudagent:py36-1.14-1_0.5.1
      command: [
                  "/bin/bash",
                  "-c",
                  "python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000000000000000000111111111110 --label 'Axis Test' --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxxxxx\",\"password\":\"xxxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxx\"}"",
                ]
      ports:
      - port: 5000
        protocol: TCP
      - port: 10000
        protocol: TCP
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 1.5
  ipAddress:
    ports:
    - port: 5000
      protocol: TCP  
    - port: 10000
      protocol: TCP  
    type: Public
    dnsNameLabel: testcontainer-axis
  osType: Linux
tags: null
type: Microsoft.ContainerInstance/containerGroups

docker run command

docker run -d -p 5001:5000 -p 10001:10000 --name postgrearies1 bcgovimages/aries-cloudagent:py36-1.14-1_0.5.1 start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --admin-insecure-mode --seed 10000000000000000000111111111110 --wallet-type indy --log-level debug --storage-type indy --wallet-storage-type postgres_storage --wallet-name test2 --wallet-storage-config "{\"url\":\"xx.xx.xxx.xxx:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}" --wallet-storage-creds "{\"account\":\"xxx\",\"password\":\"xxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxx\"}"
yatharth meena
  • 369
  • 4
  • 13
  • Can you share the YAML you use to create the ACI? – Charles Xu Dec 16 '20 at 01:38
  • Added the yaml file – yatharth meena Dec 16 '20 at 04:50
  • also docker run command – yatharth meena Dec 16 '20 at 04:56
  • Why the command is different in the YAML and docker command? I can solve the double quotes problem, but it also does not run well, I don't know what does the command works for. – Charles Xu Dec 16 '20 at 08:10
  • when start was given directly in ACI , it wasnt able to access it, but /home/indy/.pyenv/versions/3.6.9/bin/aca-py is path where start is located inside container, so that why docker command is a bit different – yatharth meena Dec 16 '20 at 08:15
  • Does the image run well via the docker command? If not, I guess it's the problem of the image, not ACI. – Charles Xu Dec 16 '20 at 09:10
  • Yes, image run on docker with postgres as database , i have checked , after that only i tried deploying postgres on ACI, and than this image on ACI. I am able to achieve postgres on ACI the link to that question https://stackoverflow.com/questions/64980940/deploying-postgres-database-on-azure-container-instance – yatharth meena Dec 16 '20 at 09:50

1 Answers1

0

I am able to resolve it by passing required value as env in command

command: [
                  "/bin/bash",
                  "-c",
                  "python /home/indy/.pyenv/versions/3.6.9/bin/aca-py start -it http 0.0.0.0 10000 -ot http --admin 0.0.0.0 5000 --wallet-type indy --seed 10000000000000000000111111111110 --label ${AGENT_NAME} --admin-insecure-mode --log-level debug --wallet-storage-type postgres_storage --wallet-name newwallet --wallet-storage-config ${WALLET_CONFIG} --wallet-storage-creds ${WALLET_CRED}",
      ]   

and than passing those environment variables

environmentVariables:
      - name: AGENT_NAME
        value: xxxxxx
      - name: WALLET_CONFIG
        value: "{\"url\":\"xxxxx.xxxxzurecontainer.io:5432\",\"wallet_scheme\":\"DatabasePerWallet\"}"
      - name: WALLET_CRED
        value: "{\"account\":\"xxxxx\",\"password\":\"xxxxx\",\"admin_account\":\"postgres\",\"admin_password\":\"xxxxxx\"}" 
yatharth meena
  • 369
  • 4
  • 13