sassoftware / viya4-deployment

This project contains Ansible code that creates a baseline in an existing Kubernetes environment for use with the SAS Viya Platform, generates the manifest for an order, and then can also deploy that order into the Kubernetes environment specified.
Apache License 2.0
71 stars 64 forks source link

viya4-deployment "The error was: 'vdm_overlays' is undefined" #324

Closed hemanth-mg closed 11 months ago

hemanth-mg commented 2 years ago

I'm trying to deploy viya 4 but I got below error.

Here is some output.

Deployment 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

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:

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"

Error

Unable to find image 'viya4-deployment:latest' locally
docker: Error response from daemon: pull access denied for viya4-deployment, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

Can some one please help me to get rid of this error. . unnamed pngBNSF dev-Phase2 error1 BNSF dev-Phase2 error

thpang commented 2 years ago

@hemanth-mg did you build the docker image locally following the instructions here? Docker cannot find the viya4-deployment image to run.

hemanth-mg commented 2 years ago

@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

BNSF dev-Phase2 error

hemanth-mg commented 2 years ago

@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"

unnamed pngBNSF dev-Phase2 error1

thpang commented 2 years ago

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.

hemanth-mg commented 2 years ago

@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.

hemanth-mg commented 2 years ago

@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. image

thpang commented 2 years ago

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.

hemanth-mg commented 2 years ago

@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"

dhoucgitter commented 2 years ago

@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.

hemanth-mg commented 2 years ago

@dhoucgitter @thpang I did tried again by removing the sudo but no luck. Please find the ansible details below. anisble

dhoucgitter commented 2 years ago

@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/ within the container when the container tries to rename/copy them elsewhere.

hemanth-mg commented 2 years ago

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"


Cluster

NAMESPACE: viya-dev

MISC

DEPLOY: true # Set to false to stop at generating the manifest

LOADBALANCER_SOURCE_RANGES: ['']

Storage

V4_CFG_MANAGE_STORAGE: true

SAS API Access

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

Ingress

V4_CFG_INGRESS_TYPE: ingress V4_CFG_INGRESS_FQDN: viyadev.***.com

TLS

V4_CFG_TLS_MODE: "full-stack" # [full-stack|front-door|ingress-only|disabled]

omitted per Jeff V4_CFG_TLS_TRUSTED_CA_CERTS:

V4_CFG_TLS_CERT: /sas/sas-viya-dev.pem V4_CFG_TLS_KEY: /sas/ sas-viya-dev.key

Postgres

V4_CFG_POSTGRES_TYPE: internal

LDAP

V4_CFG_EMBEDDED_LDAP_ENABLE: false

Consul UI

V4_CFG_CONSUL_ENABLE_LOADBALANCER: false

SAS/CONNECT

V4_CFG_CONNECT_ENABLE_LOADBALANCER: false

Monitoring and Logging

uncomment and update the below values when deploying the viya4-monitoring-kubernetes stack

V4M_BASE_DOMAIN: viyadev.**.com

CAS

V4_CFG_CAS_WORKER_COUNT: 4

Viya Start and Stop Schedule

uncomment and update the values below with CronJob schedule expressions if you would

like to start and stop your Viya Deployment on a schedule

V4_CFG_VIYA_START_SCHEDULE: "0 7 1-5"

V4_CFG_VIYA_STOP_SCHEDULE: "0 19 1-5"


dhoucgitter commented 2 years ago

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

hemanth-mg commented 2 years ago

@dhoucgitter Thanks lot for valuable input. I followed your Instruction, Now it worked.

I have added below line in Docker command. --volume /sas:/sas

SAS Viya Deployment OP

riragh commented 11 months ago

Issue was resolved, closing now.