Closed hemanth-mg closed 11 months ago
@hemanth-mg did you build the docker image locally following the instructions here? Docker cannot find the viya4-deployment
image to run.
@thpang - Yes we build from local only. When I run it for the 1st time with below command I got this error.
Docker command:
sudo docker run --rm \
> --group-add root \
> --user $(id -u):$(id -g) \
> --volume /deployments:/data \
> --volume /home/sasviyaadm/viya4-deployment-bnsf/ansible-vars.yaml:/config/config \
> --volume /home/sasviyaadm/viya4-iac-azure-bnsf/terraform.tfstate:/config/tfstate \
> --volume $HOME/.ssh/id_rsa:/config/jump_svr_private_key \
> viya4-deployment-bnsf --tags "baseline,viya,install"
vdm error :
TASK [vdm : Base overlays] *****************************************************
fatal: [localhost]: FAILED! =>
msg: |-
The task includes an option with an undefined variable. The error was: 'vdm_overlays' is undefined
The error appears to be in '/viya4-deployment/roles/vdm/tasks/main.yaml': line 39, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Base overlays
^ here
PLAY RECAP *********************************************************************
localhost : ok=53 changed=10 unreachable=0 failed=1 skipped=38 rescued=0 ignored=0
The Ansible summary.
Thursday 20 October 2022 16:19:01 +0000 (0:00:00.018) 0:00:27.400 ******
===============================================================================
vdm : assets - Download ------------------------------------------------- 8.97s
vdm : assets - Get License ---------------------------------------------- 2.30s
baseline : Deploy nfs-subdir-external-provisioner ----------------------- 1.59s
jump-server : jump-server - create folders ------------------------------ 1.26s
vdm : Download viya4-orders-cli ----------------------------------------- 1.02s
jump-server : jump-server - lookup groups ------------------------------- 0.99s
baseline : Deploy ingress-nginx ----------------------------------------- 0.90s
vdm : assets - Extract downloaded assets -------------------------------- 0.89s
baseline : Retreive K8s cluster information ----------------------------- 0.89s
baseline : Check for metrics service ------------------------------------ 0.84s
baseline : Remove deprecated efs-provisioner namespace ------------------ 0.82s
Gathering Facts --------------------------------------------------------- 0.74s
baseline : Retreive K8s cluster information ----------------------------- 0.73s
common : tfstate - export kubeconfig ------------------------------------ 0.58s
baseline : Remove deprecated nfs-client-provisioner --------------------- 0.42s
vdm : assets - Remove old files ----------------------------------------- 0.36s
vdm : copy -------------------------------------------------------------- 0.33s
baseline : Remove deprecated efs-provisioner ---------------------------- 0.30s
global tmp dir ---------------------------------------------------------- 0.28s
vdm : stat -------------------------------------------------------------- 0.26s
@thpang - I tried to modify the command and re-run the below command(removing -bnsf in last line) then only I got this error.
Docker command.
sudo docker run --rm \
> --group-add root \
> --user $(id -u):$(id -g) \
> --volume /deployments:/data \
> --volume /home/sasviyaadm/viya4-deployment-bnsf/ansible-vars.yaml:/config/config \
> --volume /home/sasviyaadm/viya4-iac-azure-bnsf/terraform.tfstate:/config/tfstate \
> --volume $HOME/.ssh/id_rsa:/config/jump_svr_private_key \
> viya4-deployment --tags "baseline,viya,install"
You'll need to jump into the running docker container and validate that what you built is correct. If you're doing this internally we have docker images pre-built that you can use. Reach out in teams and I'll provide the location.
@thpang -I'm not able to find your Id in Teams. Can you ping me in Teams (hemanth.mg02@outlook.com) or provide your teams id.
@thpang - I tried again by cloning from SAS (https:/github.com/sassoftware/viya4-deployment) but this I'm getting another error. seems to be certificate path is not valid. Can you please help me to get rid of this error. Your urgent help is highly appreciable.
Ok, first off not sure why you're using sudo
to run the docker commands. This should not be the case. Second you'll need to supply your ansible vars file not sure what/how your items there are affecting the docker container when it's running.
@thpang - I did supplied the ansible-vars.yaml please find the docker command below. Do I need to remove sudo and re-run the docker command again ?
sudo docker run --rm \
--group-add root \ --user $(id -u):$(id -g) \ --volume /deployments:/data \ --volume /sas/ansible-vars.yaml:/config/config \ --volume /home/sasviyaadm/viya4-iac-azure-bnsf/terraform.tfstate:/config/tfstate \ --volume $HOME/.ssh/id_rsa:/config/jump_svr_private_key \ viya4-deployment-bnsf --tags "baseline,viya,install"
@hemanth-mg, yes, running docker with sudo is not recommended. You should have docker installed and configured to run under your userid so that you can successfully run viya-deployment as shown in the examples at the bottom of this usage doc, https://github.com/sassoftware/viya4-deployment/blob/main/docs/user/DockerUsage.md Also, could you share the content of your ansible-vars.yaml file for others to see, I think Thomas was asking for you to share the content of it, not asking if you included it in your command or not.
@dhoucgitter @thpang I did tried again by removing the sudo but no luck. Please find the ansible details below.
@hemanth-mg, sharing your ansible-vars.yaml file helps. If you need to make the TLS_CERT and TLS_KEY files on your local workstation available to the docker container, you'll need to map the local host folder that they reside in to a folder mounted inside your docker container. As is, the docker container is not able to access them from your workstation's filesystem. You could do that by adding a --volume /hostFolder:/containerFolder directive to your docker command similar to the first --volume flag in your existing command. Check docker documentation for an explanation if you need additional instructions. You can see from the initial error you are encountering that neither the .pem or .key file can be found at /sas/
Here is my anisble-vars.yaml file. Do I need the add the volume as below (--volume /sas:/containerFolder ) my .pem or .key file inside the sas directory so I added the volume host path as /sas . How do I find the container folder ?
docker run --rm \ --group-add root \ --user $(id -u):$(id -g) \ --volume /sas/deployments:/data \ --volume /sas:/containerFolder \ --volume /sas/ansible-vars.yaml:/config/config \ --volume /home/sasviyaadm/viya4-iac-azure-bnsf/terraform.tfstate:/config/tfstate \ --volume $HOME/.ssh/id_rsa:/config/jump_svr_private_key \ viya4-deployment --tags "baseline,viya,install"
NAMESPACE: viya-dev
DEPLOY: true # Set to false to stop at generating the manifest
V4_CFG_MANAGE_STORAGE: true
V4_CFG_SAS_API_KEY: **** V4_CFG_SAS_API_SECRET: ***** V4_CFG_ORDER_NUMBER: **** V4_CFG_CADENCE_NAME: lts V4_CFG_CADENCE_VERSION: 2022.1
V4_CFG_INGRESS_TYPE: ingress V4_CFG_INGRESS_FQDN: viyadev.***.com
V4_CFG_TLS_MODE: "full-stack" # [full-stack|front-door|ingress-only|disabled]
V4_CFG_TLS_CERT: /sas/sas-viya-dev.pem V4_CFG_TLS_KEY: /sas/ sas-viya-dev.key
V4_CFG_POSTGRES_TYPE: internal
V4_CFG_EMBEDDED_LDAP_ENABLE: false
V4_CFG_CONSUL_ENABLE_LOADBALANCER: false
V4_CFG_CONNECT_ENABLE_LOADBALANCER: false
V4M_BASE_DOMAIN: viyadev.**.com
V4_CFG_CAS_WORKER_COUNT: 4
The container folder that you specify is up to you and should reflect the container path to both of the files that you have expressed in your ansible-vars.yaml file. In your case, since you have
V4_CFG_TLS_CERT: /sas/sas-viya-dev.pem
V4_CFG_TLS_KEY: /sas/sas-viya-dev.key
you are telling the docker container to expect to see those files under /sas in your container. Realize that if you are running DAC as a docker container, those paths reflect docker container paths now, not a path to your workstations local filesystem as they would if you were running DAC using a locally installed version of Ansible.
Since the docker --volume flag can mount your host's /sas folder to whatever path you want inside the container, you can mount those files to whatever container folder that you choose, as long as your ansible-vars.yaml V4_CFG_TLS entries are updated to reflect the containerPath that you specify there.
For the ansible-vars.yaml entries that you have now
--volume /sas:/sas
should work. If you decided that you wanted those file to exist at /mycerts in your container instead for some reason, like this:
V4_CFG_TLS_CERT: /mycerts/sas-viya-dev.pem
then your volume flag would need to change to this instead
--volume /sas:/mycerts
@dhoucgitter Thanks lot for valuable input. I followed your Instruction, Now it worked.
I have added below line in Docker command. --volume /sas:/sas
Issue was resolved, closing now.
I'm trying to deploy viya 4 but I got below error.
Here is some output.
Deployment command:
vdm error :
The Ansible summary.
I think I have made mistake in the command. When I corrected the command and rerun it again. I'm getting the different error.
Updated Docker command:
Error
Can some one please help me to get rid of this error. .