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

Use new nginx version and update module build process #2

Open
wants to merge 114 commits into
base: master
Choose a base branch
from

Conversation

dima11051994
Copy link

We needed to merge all changes from the upstream repo in order to use the new version of nginx. But a lot of things have changed there since our fork was done, so there were conflicts. I resolved all the conflicts in a separate branch, checked that the new build process now works, and prepared this PR.
The previous PR can be closed because it is not valid.

thresheek and others added 30 commits August 28, 2018 19:34
The build sometimes fails to remove the `S.gpg-agent.extra` unix domain socket
when it deletes the temporary GNUPGHOME directory after running gpg commands.

    rm: can't remove '/tmp/tmp.hBDCKF/S.gpg-agent.extra': No such file or directory

The previous gpg --recv-keys command starts the gpg-agent. The gpg-agent
connects to the following sockets and does not terminate on its own.

    / # netstat -x -a -p
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
    unix  2      [ ACC ]     STREAM     LISTENING     8627378 17/dirmngr          /root/.gnupg/S.dirmngr
    unix  2      [ ACC ]     STREAM     LISTENING     8625135 21/gpg-agent        /root/.gnupg/S.gpg-agent
    unix  2      [ ACC ]     STREAM     LISTENING     8625136 21/gpg-agent        /root/.gnupg/S.gpg-agent.extra
    unix  2      [ ACC ]     STREAM     LISTENING     8625137 21/gpg-agent        /root/.gnupg/S.gpg-agent.browser
    unix  2      [ ACC ]     STREAM     LISTENING     8625138 21/gpg-agent        /root/.gnupg/S.gpg-agent.ssh

If one of the sockets is removed, then the agent terminates and removes the
other sockets as well. This causes a race condition between `rm -rf $GNUPGHOME`
and gpg-agent. If gpg-agent manages to remove the sockets first, then `rm`
fails while trying to remove the same socket.

Move to gnupg1 in alpine just like we do for stretch. Gnupg version 1
does not launch a GPG agent. It is not possible to disable gpg-agent in
gnupg version 2.

(cherry picked from commit 684e1c6)
Signed-off-by: Konstantin Pavlov <[email protected]>
(cherry picked from commit 4209281)
Signed-off-by: Konstantin Pavlov <[email protected]>
For the architectures unavailable on nginx.org, build from the official
packaging sources.

Also adds njs.
While at it, merge mainline versioning changes.
101 was chosen as UID/GID for both supported platforms since that's the
first unused pair.

This also looks forward compatible at least for now with Debian Buster
and Alpine 3.10 as from the :edge tag of the time writing this message.

Fixes: nginxinc#218.
And other minor formatting fixes

Signed-off-by: Konstantin Pavlov <[email protected]>
This makes stable images buildable until the next version bump.
Signed-off-by: Konstantin Pavlov <[email protected]>
thresheek and others added 28 commits December 15, 2020 17:38
…esses

The script is a no-op bye default, you would need to enable its logic by
setting an NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE variable to any
value.

The script then tries to get the following values:

 - getconf _NPROCESSORS_ONLN
 - the amount of cpus from cpuset cgroupv1
 - the quotas from cpu/cpuacct cgroupv1
 - the amount of cpus from cgroupv2
 - the quotas from cgroupv2

The lowest of all five is then applied to nginx.conf.

Fixes nginxinc#472
…rsion

We're now using a tip of default branch on pkg-oss which moves fast and
breaks things.  A better solution is probably to check out a specific
nginx tag and build whatever is available for it.  This, however, is not
currently possible with 1.19.6, and only works for 1.19.7.  This should
probably be reverted once we have enough tags supporting it.
While at it, bumped alpine base image to 3.13 and njs to 0.5.3
While at it, move mainline builds to alpine 3.14.
@dima11051994 dima11051994 requested a review from evanpdk August 27, 2021 08:23
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

Successfully merging this pull request may close these issues.