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

Unable to deploy with docker usage #227

Closed ceciivanov closed 10 months ago

ceciivanov commented 2 years ago

I'm getting the below error when i'm trying to deploy with docker run, {"msg": "The task includes an option with an undefined variable. The error was: 'CLUSTER_NAME' is undefined\n\nThe error appears to be in '/viya4-deployment/roles/common/tasks/main.yaml': line 202, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set DEPLOY_DIR\n ^ here\n"}

Maybe is something with the directories and paths ?, but i did everything as it said in the docker usage.md any help?

thpang commented 2 years ago

If you can pass along the docker command you're using. Something is not defined as it states. Thanks.

ashagraw91 commented 1 year ago

I am facing same issue , any solution?

Here is docker command

sudo docker run --rm --group-add root --user $(id -u):$(id -g) --volume $HOME/deployment-yaml/deployments:/data --volume $HOME/deploy-viya/xyz-xyz-simulator/viya4-deployment/ansible-vars.yaml:/config/config.yaml --volume $HOME/statefile/viya.tfstate:/config/viya.tfstate --volume $HOME/deploy-viya/xyz-xyz-simulator/viya4-iac-azure/.ssh/id_rsa:/config/jump_svr_private_key/id_rsa lll.azurecr.io/viya4-deployment:latest --tags "baseline,viya,install" -vvv

dhoucgitter commented 1 year ago

Hi @ashagraw91, please check the examples again in DockerUsage.md. Don't alter the values to the right of the ":" in the volume mount instructions, they should be left as is. You have added ".yaml" to one and ".tfstate" to another. Try using the following right-side values with your paths to the left of the ":" as the doc indicates. All the values to the right of the ":" in https://github.com/sassoftware/viya4-deployment/blob/main/docs/user/DockerVolumeMounts.md need to be expressed as is.

--volume $HOME/deployments/dev-cluster/dev-namespace/ansible-vars.yaml:/config/config \
--volume $HOME/deployments/dev-cluster/terraform.tfstate:/config/tfstate \
ashagraw91 commented 1 year ago

Thanks @dhoucgitter for the reply, actually I used that initially and i was getting this error:

fatal: [localhost]: FAILED! => changed=false ansible_facts: {} ansible_included_var_files: [] message: 'an error occurred while trying to read the file ''/config/config'': [Errno 21] Is a directory: b''/config/config'''

This was my script sudo docker run --rm --group-add root --user $(id -u):$(id -g) --volume $HOME/deployment-yaml/deployments:/data --volume $HOME/deploy-viya/xyz-xyz-simulator/viya4-deployment/ansible-vars.yaml:/config/config --volume $HOME/statefile/viya.tfstate:/config/tfstate --volume $HOME/deploy-viya/xyz-xyz-simulator/viya4-iac-azure/.ssh/id_rsa:/config/jump_svr_private_key/id_rsa lll.azurecr.io/viya4-deployment:latest --tags "baseline,viya,install" -vvv

Additional information: I am running it in azure pipeline in linux agent , it works fine locally but not in pipeline with all things similar

ashagraw91 commented 1 year ago

It is solved now. it is due to wrong path

dhoucgitter commented 1 year ago

Hi @ceciivanov, were you able to resolve your issue? If not, could you post the docker command that you are using.

dhoucgitter commented 10 months ago

Marking as stale/inactive. If there are additional questions, please open a new Github issue.

dhoucgitter commented 10 months ago

Closed #227 as completed.