pulp-oci-images icon indicating copy to clipboard operation
pulp-oci-images copied to clipboard

Oneshots get called twice

Open newswangerd opened this issue 2 years ago • 4 comments

Describe the bug All of the oneshot scripts get called twice. To see an example of this check out the CI from galaxy_ng. postgres-prepare gets called here https://github.com/ansible/galaxy_ng/actions/runs/4765015133/jobs/8470280735?pr=1689#step:12:789 (line 788) and here https://github.com/ansible/galaxy_ng/actions/runs/4765015133/jobs/8470280735?pr=1689#step:12:1108 (line 1107).

This behavior happens for all of the oneshot scripts, which makes the containers take longer to start up.

To Reproduce Run the CI centos image and search the log output from the container for Calling /etc/init/postgres-prepare. It will show up twice per container start.

Expected behavior Oneshot scripts should only execute once.

newswangerd avatar Apr 24 '23 06:04 newswangerd

This is probably happen because of the logic for how we scale the workers in the multi-process containers:

  1. Copy the /etc/s6-rc/ to under /tmp
  2. Duplicate the worker services under /tmp
  3. Execute the /tmp subfolder as the new service configuration.

mikedep333 avatar Apr 25 '23 15:04 mikedep333

@newswangerd My bet is that this is only adding a few to several seconds. It's not like the migrations, which take a few minutes, get run twice. Does that seem to be your experience?

mikedep333 avatar Apr 25 '23 15:04 mikedep333

@mikedep333 i can't speak for the normal container images, but it adds a lot of time to oci-env with some of the profiles.

I have noticed that the set certs can be fairly time consuming. That might cause delays if it's run twice.

newswangerd avatar Apr 27 '23 05:04 newswangerd

This seems to be caused by having dependencies on base

newswangerd avatar May 25 '23 21:05 newswangerd