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

Fix timeout caused by nginx #4336

Merged
merged 3 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/nginx.conf.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ http {
proxy_pass http://studio;
proxy_redirect off;
proxy_set_header Host $host;
proxy_read_timeout 100s;
}

location /content/ {
Expand Down
11 changes: 6 additions & 5 deletions k8s/images/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM byrnedo/alpine-curl

# download all extra deps we need for the production container

# templating executable
RUN curl -L "https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_$(uname -sm|tr \ _).tgz" \ | tar -zxC /usr/bin
COPY /k8s/images/nginx/download_sigil.sh /tmp/download_sigil.sh
RUN chmod +x /tmp/download_sigil.sh
RUN /tmp/download_sigil.sh
Comment on lines +5 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to a script, since complex env vas substitution doesn't work in a Dockerfile.


FROM nginx:1.11
FROM nginx:1.25

RUN rm /etc/nginx/conf.d/* # if there's stuff here, nginx won't read sites-enabled
ADD deploy/nginx.conf.jinja2 /etc/nginx/nginx.conf.jinja2
ADD k8s/images/nginx/entrypoint.sh /usr/bin

# install the templating binary
COPY --from=0 /usr/bin/sigil /usr/bin
COPY --from=0 /tmp/sigil /usr/bin/

CMD entrypoint.sh
CMD entrypoint.sh
8 changes: 8 additions & 0 deletions k8s/images/nginx/download_sigil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
export SIGIL_VERSION=0.10.1
export OS=`sh -c "uname -s | tr '[:upper:]' '[:lower:]'"`
export ARCH=`sh -c "uname -m | tr '[:upper:]' '[:lower:]' | sed 's/aarch64/arm64/'"`


curl -L "https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/gliderlabs-sigil_${SIGIL_VERSION}_${OS}_${ARCH}.tgz" | tar -zxC /tmp
mv /tmp/gliderlabs-sigil-${ARCH} /tmp/sigil
Comment on lines +1 to +8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a refactor in our future lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually didn't carry out the refactor we talked about, where we can simply dispense with Sigil. Should I do that in this PR @DXCanas ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah. Too big a load, and this should be fixed ASAP. We should also think about the various paths forward. Hence my asking @bjester for his thoughts on moving some of this to infra:
#4336 (comment)