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

all: use alpine-3.14 #34508

Merged
merged 11 commits into from May 4, 2022
Merged

all: use alpine-3.14 #34508

merged 11 commits into from May 4, 2022

Conversation

keegancsmith
Copy link
Member

@keegancsmith keegancsmith commented Apr 26, 2022

Note: I am adding a lot of reviewers here, mainly for awareness than actually reviewing the code. The actual code changes are boring, the PR description is more important.

We have a 3.14 image available, but when we introduced it we ran into problems using it. This updates all images to use the newer version of alpine.

ruplacer --go \
  sourcegraph/alpine-3.12:142406_2022-04-14_8836ac3499f4@sha256:4681a48d1fb9a73fef1b540c08b3411f797351bbeda749f5dca21213a1e71526 \
  sourcegraph/alpine-3.14:142406_2022-04-14_8836ac3499f4@sha256:2a2d1cbaec78882661fe1aa5b0a4af0c23a37be2ea9ff8aadc2da5b80852c233

I also had to pin postgresql in the server image since we can't upgrade it otherwise customer upgrades fail (incompatible on disk data). Additionally we had to include libstc++ and libgcc for tree sitter.

Risks: I am relying on our CI to catch problems with this upgrade. The main risks here are us not testing things which exercise non-go binaries that rely on shared libraries. What comes to mind is things like p4 and tree-sitter, I am unsure if they get properly exercised. However, I think now is a good time to land a change like this since we have a lot of time until branch cut.

Test Plan: main dry run on CI to test docker image building and integration testing.

We have a 3.14 image available, but when we introduced it we ran into
problems using it. This is an attempt to update all images to use the
newer version of alpine. If anything breaks in CI, I will revert the
specific image which is breaking.

  ruplacer --go \
    sourcegraph/alpine-3.12:142406_2022-04-14_8836ac3499f4@sha256:4681a48d1fb9a73fef1b540c08b3411f797351bbeda749f5dca21213a1e71526 \
    sourcegraph/alpine-3.14:142406_2022-04-14_8836ac3499f4@sha256:2a2d1cbaec78882661fe1aa5b0a4af0c23a37be2ea9ff8aadc2da5b80852c233

Test Plan: main dry run on CI to test docker image building and
integration testing.
@cla-bot cla-bot bot added the cla-signed label Apr 26, 2022
Symbols is failing to build, which also means server is failing to
build. Trying this out again with those images set to apline 3.12.
@keegancsmith
Copy link
Member Author

@chrismwendt I know you have been making some changes to how we build symbols. Any idea why bumping the alpine distro to 3.14 causes the build to fail?

@keegancsmith
Copy link
Member Author

@chrismwendt the sanity check fails:

#16 [symbols 5/6] RUN env SANITY_CHECK=true /usr/local/bin/symbols
  | #16 sha256:60316c31d41b9902c408c105328267c167675ebb027438bb5f3d24129d6609fe
  | #16 0.544 Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/bin/symbols)
  | #16 0.544 Error loading shared library libgcc_s.so.1: No such file or directory (needed by /usr/local/bin/symbols)
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4copyEPcmm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: __cxa_end_catch: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_disposeEv: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEmmPKcm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: __cxa_begin_catch: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: __cxa_rethrow: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE9_M_mutateEmmPKwm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _Znwm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZdlPvm: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZSt20__throw_length_errorPKc: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _Unwind_Resume: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: _ZSt19__throw_logic_errorPKc: symbol not found
  | #16 0.544 Error relocating /usr/local/bin/symbols: __gxx_personality_v0: symbol not found
  | #16 ERROR: executor failed running [/bin/sh -c env SANITY_CHECK=true /usr/local/bin/symbols]: exit code: 127

@chrismwendt
Copy link
Contributor

I pushed a fix which adds apk add ... libstc++ libgcc for tree-sitter.

I'm guessing sourcegraph/alpine-3.12 already had those packages installed and 3.14 doesn't, but I'm not 100% sure 🤷

@keegancsmith
Copy link
Member Author

@chrismwendt thanks, that resolved it. Now the issue is a legit one, the version of postgres changes thanks to the different alpine and our CI caught a legit issue :)

2022-05-03 07:51:32.411 UTC [27] DETAIL:  The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.6.

@keegancsmith
Copy link
Member Author

The road was long, but CI is green.

@keegancsmith keegancsmith marked this pull request as ready for review May 4, 2022 06:53
@keegancsmith keegancsmith requested review from a team May 4, 2022 06:54
@keegancsmith
Copy link
Member Author

Note: I am adding a lot of reviewers here, mainly for awareness than actually reviewing the code. The actual code changes are boring, the PR description is more important.

@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented May 4, 2022

Codenotify: Notifying subscribers in CODENOTIFY files for diff 7c6bfb1...6f68853.

Notify File(s)
@beyang cmd/searcher/Dockerfile
enterprise/cmd/precise-code-intel-worker/Dockerfile
@bobheadxi docker-images/grafana/Dockerfile
docker-images/prometheus/Dockerfile
internal/cmd/resources-report/Dockerfile
@efritz cmd/worker/Dockerfile
enterprise/cmd/precise-code-intel-worker/Dockerfile
enterprise/cmd/worker/Dockerfile
@indradhanush cmd/repo-updater/Dockerfile
@ryanslade cmd/repo-updater/Dockerfile
@tsenart cmd/repo-updater/Dockerfile
internal/cmd/progress-bot/Dockerfile

@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented May 4, 2022

Codenotify: Notifying subscribers in OWNERS files for diff 7c6bfb1...6f68853.

Notify File(s)
@mrnugget dev/sg/Dockerfile
@sourcegraph/dev-experience dev/sg/Dockerfile

Copy link
Member

@jhchabran jhchabran left a comment

Choose a reason for hiding this comment

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

LGTM!

My spidey senses are worried we don't have the needed treesitter libs.
Copy link
Contributor

@dcomas dcomas left a comment

Choose a reason for hiding this comment

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

Thanks for updating this. No issues on our side.

@keegancsmith keegancsmith merged commit fa6a244 into main May 4, 2022
@keegancsmith keegancsmith deleted the main-dry-run/k/20220426-alpine-3.14 branch May 4, 2022 09:41
thiswayman pushed a commit that referenced this pull request May 4, 2022
We have a 3.14 image available, but when we introduced it we ran into problems
using it. This updates all images to use the newer version of alpine.

  ruplacer --go \
    sourcegraph/alpine-3.12:142406_2022-04-14_8836ac3499f4@sha256:4681a48d1fb9a73fef1b540c08b3411f797351bbeda749f5dca21213a1e71526 \
    sourcegraph/alpine-3.14:142406_2022-04-14_8836ac3499f4@sha256:2a2d1cbaec78882661fe1aa5b0a4af0c23a37be2ea9ff8aadc2da5b80852c233

I also had to pin postgresql in the server image since we can't upgrade it
otherwise customer upgrades fail (incompatible on disk data). Additionally we
had to include libstc++ and libgcc for tree sitter.

Risks: I am relying on our CI to catch problems with this upgrade. The main
risks here are us not testing things which exercise non-go binaries that rely
on shared libraries. What comes to mind is things like p4 and tree-sitter, I
am unsure if they get properly exercised. However, I think now is a good time
to land a change like this since we have a lot of time until branch cut.

Test Plan: main dry run on CI to test docker image building and integration
testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants