Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of issues with the scripts #17

Open
martdj opened this issue Jan 10, 2023 · 4 comments
Open

Couple of issues with the scripts #17

martdj opened this issue Jan 10, 2023 · 4 comments

Comments

@martdj
Copy link

martdj commented Jan 10, 2023

The load.sh script contains this line:
listOfImages+=("DX_DOCKER_IMAGE_PREREQS_CHECKER:hcl-prereqs-checker-image")
This should be:
listOfImages+=("DX_DOCKER_IMAGE_PREREQS_CHECKER:hcl-dx-prereqs-checker-image")

The scripts, when docker compose is executed as the root user, create directories in the .volumes directory. These directories are all created with root:root as the uid:gid. The containers, however run as 1000:1000 (core) and 1000:1001 (dam). These containers can't create directories under ./volumes/core/wp_profile, ./volumes/dam/db or ./volumes/dam/upload. As a result, the container error and exit. It would be good to either create these directories beforehand with the proper uid:gid, or script the init-scripts to do this there.

To fix it, I've added the following lines to set.sh. Just a suggestion:
export DX_PERSISTENT_PATH=/local/DX/data # location of persistent directories

if [ ! -d "$DX_PERSISTENT_PATH/core" ]
then
mkdir -p $DX_PERSISTENT_PATH/{core/wp_profile,dam/{db,upload}}
chown -R 1000:1000 $DX_PERSISTENT_PATH
chown -R 1000:1001 $DX_PERSISTENT_PATH/dam
fi

That also allows for these volumes in the dx.yaml:

  • ${DX_PERSISTENT_PATH:?.volumes}/core/wp_profile:/mnt/prereqs-checks-volumes/wp_profile

Personally, I wouldn't want my persistent volume in the same directory where the git scripts are.

@setusama
Copy link

Hy @martdj

Could you share how the output of your "set.sh" turned out?

Could you also share where you put the string in dx.yaml?

I'm having the same problems you reported and I'm not getting through.

Thanks

@martdj
Copy link
Author

martdj commented Jul 28, 2023

@setusama
For me it works fine. This is my output:
##################################
Docker-compose environment set to:

COMPOSE_PROJECT_NAME=dx
COMPOSE_FILE=/local/DX/dx-docker-compose/dx.yaml
DX_HOSTNAME=
DX_DOCKER_IMAGE_CORE=dx/core:v95_CF208_20221208-2224
DX_DOCKER_IMAGE_RINGAPI=dx/ringapi:v1.21.0_20221208-2240
DX_DOCKER_IMAGE_DAM=dx/digital-asset-manager:v1.20.0_20221208-2234
DX_DOCKER_IMAGE_DAM_DB_NODE=dx/persistence-node:v1.11_20221208-2238
DX_DOCKER_IMAGE_DAM_DB_CONNECTION_POOL=dx/persistence-connection-pool:v1.21.0_20221208-2237
DX_DOCKER_IMAGE_IMAGE_PROCESSOR=dx/image-processor:v1.21.0_20221208-2229
DX_DOCKER_IMAGE_CC=dx/content-composer:v1.21.0_20221208-2224
DX_DOCKER_IMAGE_DS=dx/design-studio:v0.12.0_20221208-2233
DX_DOCKER_IMAGE_HAPROXY=dx/haproxy:v1.4.0_20221208-2240
DX_DOCKER_IMAGE_PREREQS_CHECKER=dx/prereqs-checker:v0.1.0_20221208-2227

##################################

Make sure that you use '. ./set.sh' or 'source ./set.sh'. many people just run the script. That won't work.

@setusama
Copy link

setusama commented Jul 28, 2023

The load.sh script contains this line: listOfImages+=("DX_DOCKER_IMAGE_PREREQS_CHECKER:hcl-prereqs-checker-image") This should be: listOfImages+=("DX_DOCKER_IMAGE_PREREQS_CHECKER:hcl-dx-prereqs-checker-image")

The scripts, when docker compose is executed as the root user, create directories in the .volumes directory. These directories are all created with root:root as the uid:gid. The containers, however run as 1000:1000 (core) and 1000:1001 (dam). These containers can't create directories under ./volumes/core/wp_profile, ./volumes/dam/db or ./volumes/dam/upload. As a result, the container error and exit. It would be good to either create these directories beforehand with the proper uid:gid, or script the init-scripts to do this there.

To fix it, I've added the following lines to set.sh. Just a suggestion: export DX_PERSISTENT_PATH=/local/DX/data # location of persistent directories

if [ ! -d "$DX_PERSISTENT_PATH/core" ] then mkdir -p $DX_PERSISTENT_PATH/{core/wp_profile,dam/{db,upload}} chown -R 1000:1000 $DX_PERSISTENT_PATH chown -R 1000:1001 $DX_PERSISTENT_PATH/dam fi

That also allows for these volumes in the dx.yaml:

  • ${DX_PERSISTENT_PATH:?.volumes}/core/wp_profile:/mnt/prereqs-checks-volumes/wp_profile

Personally, I wouldn't want my persistent volume in the same directory where the git scripts are.

@setusama For me it works fine. This is my output: ################################## Docker-compose environment set to:

COMPOSE_PROJECT_NAME=dx COMPOSE_FILE=/local/DX/dx-docker-compose/dx.yaml DX_HOSTNAME= DX_DOCKER_IMAGE_CORE=dx/core:v95_CF208_20221208-2224 DX_DOCKER_IMAGE_RINGAPI=dx/ringapi:v1.21.0_20221208-2240 DX_DOCKER_IMAGE_DAM=dx/digital-asset-manager:v1.20.0_20221208-2234 DX_DOCKER_IMAGE_DAM_DB_NODE=dx/persistence-node:v1.11_20221208-2238 DX_DOCKER_IMAGE_DAM_DB_CONNECTION_POOL=dx/persistence-connection-pool:v1.21.0_20221208-2237 DX_DOCKER_IMAGE_IMAGE_PROCESSOR=dx/image-processor:v1.21.0_20221208-2229 DX_DOCKER_IMAGE_CC=dx/content-composer:v1.21.0_20221208-2224 DX_DOCKER_IMAGE_DS=dx/design-studio:v0.12.0_20221208-2233 DX_DOCKER_IMAGE_HAPROXY=dx/haproxy:v1.4.0_20221208-2240 DX_DOCKER_IMAGE_PREREQS_CHECKER=dx/prereqs-checker:v0.1.0_20221208-2227

##################################

Make sure that you use '. ./set.sh' or 'source ./set.sh'. many people just run the script. That won't work.

@martdj Thanks for the answer.

What I would like to know is how you declared this information in set.sh and then in dx.yaml.

Mine didn't work.

thanks

@martdj
Copy link
Author

martdj commented Jul 28, 2023

Not sure I understand what you mean. Those lines are literally the only ones I changed. I then do from the directory with the scripts (/local/DX/dx-docker-compose in my case)
. ./set.sh
docker compose up -d

That's it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants